{"version":3,"file":"SeparatorWidget-CMWb2k-L.cjs","names":["getColorField","Ban"],"sources":["../../widgets/src/widgets/SeparatorWidget.tsx"],"sourcesContent":["import type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport type { ColorOptions } from \"@fluid-app/portal-core/types\";\nimport { Ban } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport { getColorField } from \"../core/fields\";\n\ntype SpacingOptions = 0 | 2 | 4 | 6 | 8 | 10;\n\ntype SeparatorWidgetProps = ComponentProps<\"div\"> & {\n  orientation?: \"horizontal\" | \"vertical\";\n  color?: ColorOptions;\n  thickness?: `${number}px`;\n  width?: `${number}%`;\n  marginTop?: SpacingOptions;\n  marginBottom?: SpacingOptions;\n};\n\nexport function SeparatorWidget({\n  orientation = \"horizontal\",\n  color = \"muted\",\n  thickness = \"1px\",\n  width = \"100%\",\n  marginTop = 4,\n  marginBottom = 4,\n  className,\n  style,\n  ...props\n}: SeparatorWidgetProps): React.JSX.Element {\n  const isHorizontal = orientation === \"horizontal\";\n\n  return (\n    <div\n      className={`flex ${isHorizontal ? \"flex-row justify-center\" : \"h-full flex-col items-center\"} ${className ?? \"\"}`}\n      style={{\n        ...(isHorizontal\n          ? {\n              marginTop: `${marginTop * 4}px`,\n              marginBottom: `${marginBottom * 4}px`,\n            }\n          : {\n              paddingTop: `${marginTop * 4}px`,\n              paddingBottom: `${marginBottom * 4}px`,\n            }),\n        ...style,\n      }}\n      aria-hidden=\"true\"\n      {...props}\n    >\n      {isHorizontal ? (\n        <div\n          className={`bg-${color}`}\n          style={{\n            width,\n            height: thickness,\n          }}\n        />\n      ) : (\n        <div\n          className={`bg-${color}`}\n          style={{\n            width: thickness,\n            height: \"100%\",\n          }}\n        />\n      )}\n    </div>\n  );\n}\n\nexport const separatorWidgetPropertySchema: WidgetPropertySchema = {\n  widgetType: \"SeparatorWidget\",\n  displayName: \"Separator\",\n  fields: [\n    {\n      key: \"orientation\",\n      label: \"Orientation\",\n      type: \"select\",\n      description: \"Direction of the separator line\",\n      defaultValue: \"horizontal\",\n      options: [\n        { label: \"Horizontal\", value: \"horizontal\" },\n        { label: \"Vertical\", value: \"vertical\" },\n      ],\n      group: \"Separator\",\n    },\n    getColorField({\n      key: \"color\",\n      label: \"Color\",\n      description: \"Color of the separator line\",\n      defaultValue: \"muted\",\n      group: \"Separator\",\n    }),\n    {\n      key: \"thickness\",\n      label: \"Thickness\",\n      type: \"cssUnit\",\n      description: \"Thickness of the separator line\",\n      defaultValue: \"1px\",\n      allowedUnits: [\"px\"],\n      minByUnit: { px: 1 },\n      maxByUnit: { px: 20 },\n      stepByUnit: { px: 1 },\n      group: \"Separator\",\n    },\n    {\n      key: \"width\",\n      label: \"Width\",\n      type: \"cssUnit\",\n      description: \"Width of the separator\",\n      defaultValue: \"100%\",\n      allowedUnits: [\"%\"],\n      defaultUnit: \"%\",\n      minByUnit: { \"%\": 1 },\n      maxByUnit: { \"%\": 100 },\n      stepByUnit: { \"%\": 1 },\n      group: \"Separator\",\n      requiresKeyValue: { key: \"orientation\", value: \"horizontal\" },\n    },\n    {\n      key: \"marginTop\",\n      label: \"Margin Top\",\n      type: \"buttonGroup\",\n      description: \"Space above the separator\",\n      defaultValue: 4,\n      options: [\n        { icon: Ban, ariaLabel: \"No top margin\", value: 0 },\n        { label: \"SM\", value: 2 },\n        { label: \"MD\", value: 4 },\n        { label: \"LG\", value: 6 },\n        { label: \"XL\", value: 8 },\n        { label: \"FULL\", value: 10 },\n      ],\n      group: \"Spacing\",\n    },\n    {\n      key: \"marginBottom\",\n      label: \"Margin Bottom\",\n      type: \"buttonGroup\",\n      description: \"Space below the separator\",\n      defaultValue: 4,\n      options: [\n        { icon: Ban, ariaLabel: \"No bottom margin\", value: 0 },\n        { label: \"SM\", value: 2 },\n        { label: \"MD\", value: 4 },\n        { label: \"LG\", value: 6 },\n        { label: \"XL\", value: 8 },\n        { label: \"FULL\", value: 10 },\n      ],\n      group: \"Spacing\",\n    },\n  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