@webiny/admin-ui 6.5.2-beta.1 → 6.5.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.stories.js.map +1 -1
- package/Accordion/components/AccordionBackgroundProvider.js.map +1 -1
- package/Accordion/components/AccordionTrigger.js.map +1 -1
- package/AdminUiProvider/AdminUiProvider.js.map +1 -1
- package/Checkbox/primitives/CheckboxPrimitive.js.map +1 -1
- package/CheckboxGroup/primitives/CheckboxGroupPrimitive.js.map +1 -1
- package/DataTable/DataTable.js +1 -1
- package/DataTable/DataTable.js.map +1 -1
- package/DataTable/DataTable.stories.js +1 -1
- package/DataTable/DataTable.stories.js.map +1 -1
- package/DatePicker/DatePicker.js.map +1 -1
- package/DatePicker/DatePicker.stories.js.map +1 -1
- package/DatePicker/primitives/components/DatePickerTrigger.js.map +1 -1
- package/Dialog/components/DialogContent.js.map +1 -1
- package/Dialog/components/DialogOverlay.js.map +1 -1
- package/Drawer/components/DrawerContent.js.map +1 -1
- package/Drawer/components/DrawerOverlay.js.map +1 -1
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/DropdownMenu/DropdownMenu.stories.js +1 -1
- package/DropdownMenu/DropdownMenu.stories.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuCheckboxItem.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuContent.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuItem.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuLabel.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuSubContent.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuSubTrigger.js.map +1 -1
- package/FilePicker/primitives/components/previews/RichItemPreview/ThumbnailActions.js.map +1 -1
- package/Grid/Grid.js +1 -1
- package/Grid/Grid.js.map +1 -1
- package/HeaderBar/HeaderBar.stories.js.map +1 -1
- package/ImageEditor/ImageEditor.stories.js.map +1 -1
- package/Input/InputPrimitive.js.map +1 -1
- package/List/List.stories.js.map +1 -1
- package/MultiSelect/primitives/MultiSelectPrimitive.js.map +1 -1
- package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
- package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
- package/ScrollArea/ScrollArea.js.map +1 -1
- package/SegmentedControl/SegmentedControl.stories.js.map +1 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.js +6 -6
- package/SegmentedControl/primitives/SegmentedControlPrimitive.stories.js.map +1 -1
- package/Select/primitives/SelectPrimitive.js.map +1 -1
- package/Sidebar/Sidebar.stories.js.map +1 -1
- package/Sidebar/components/SidebarProvider.js.map +1 -1
- package/Sidebar/components/items/SidebarMenuProvider.js.map +1 -1
- package/Slider/Slider.js.map +1 -1
- package/Slider/primitives/SliderPrimitive.js.map +1 -1
- package/Switch/primitives/SwitchPrimitive.js.map +1 -1
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/components/Context.js.map +1 -1
- package/Toast/components/ToastIcon.js.map +1 -1
- package/Toggle/primitives/TogglePrimitive.js.map +1 -1
- package/ToggleGroup/primitives/ToggleGroupPrimitive.js.map +1 -1
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tree/Tree.js.map +1 -1
- package/Widget/components/WidgetActionsContext.js.map +1 -1
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable/DataTable.stories.js","sources":["../../src/DataTable/DataTable.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport type { DataTableColumns, DataTableDefaultData, DataTableSorting } from \"./DataTable.js\";\nimport { DataTable } from \"./DataTable.js\";\nimport { Avatar } from \"~/Avatar/index.js\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DataTable> = {\n title: \"Components/DataTable\",\n component: DataTable,\n parameters: {\n layout: \"padded\"\n }\n};\n\nexport default meta;\ntype Story<T extends Record<string, any> & DataTableDefaultData> = StoryObj<typeof DataTable<T>>;\n\n// Declare the data structure.\ninterface Entry {\n id: string;\n name: string;\n createdBy: string;\n lastModified: string;\n status: string;\n}\n\n// Define the columns structure for the table.\nconst columns: DataTableColumns<Entry> = {\n name: {\n header: \"Title\"\n },\n createdBy: {\n header: \"Author\"\n },\n lastModified: {\n header: \"Last Modified\"\n },\n status: {\n header: \"Status\"\n }\n};\n\n// Define the data to display.\nconst data = [\n {\n id: \"entry-1\",\n name: \"Getting Started Guide\",\n createdBy: \"John Doe\",\n lastModified: \"1 hour ago\",\n status: \"Published\"\n },\n {\n id: \"entry-2\",\n name: \"User Documentation\",\n createdBy: \"Jane Smith\",\n lastModified: \"3 days ago\",\n status: \"Draft\"\n },\n {\n id: \"entry-3\",\n name: \"API Reference\",\n createdBy: \"John Doe\",\n lastModified: \"1 week ago\",\n status: \"Published\"\n }\n];\n\nexport const Default: Story<Entry> = {\n args: {\n data,\n columns\n }\n};\n\nexport const Bordered: Story<Entry> = {\n args: {\n ...Default.args,\n bordered: true\n }\n};\n\nexport const WithStickyHeader: Story<Entry> = {\n args: {\n ...Default.args,\n stickyHeader: true\n }\n};\n\nexport const WithSelectableRows: Story<Entry> = {\n args: Default.args,\n render: args => {\n const [selectedRows, setSelectedRows] = useState<Entry[]>([]);\n\n return (\n <DataTable\n {...args}\n selectedRows={selectedRows}\n onSelectRow={rows => setSelectedRows(rows)}\n />\n );\n }\n};\n\nexport const WithLoading: Story<Entry> = {\n args: {\n columns\n },\n render: ({ columns }) => {\n const [loading, setLoading] = useState(true);\n const [tableData, setTableData] = useState<Entry[]>([]);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setTableData(data); // your predefined data\n setLoading(false);\n }, 5000);\n\n return () => clearTimeout(timer);\n }, []);\n\n return <DataTable columns={columns} data={tableData} loading={loading} />;\n }\n};\n\nexport const WithLongColumnContent: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n header: \"Name - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n },\n data: data.map(entry => ({\n ...entry,\n name: `${entry.name} - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.`\n }))\n }\n};\n\nexport const WithCustomCellRenderer: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n cell: (entry: Entry) => {\n return (\n <div className={\"flex items-center gap-sm-extra\"}>\n <Avatar\n image={\n <Avatar.Image\n src=\"https://github.com/webiny-bot.png\"\n alt=\"@webiny\"\n />\n }\n fallback={<Avatar.Fallback>{entry.name.charAt(0)}</Avatar.Fallback>}\n size={\"xl\"}\n />\n <div>\n <Text className={\"text-neutral-primary font-semibold\"} as={\"div\"}>\n {entry.name}\n </Text>\n <Text\n size={\"sm\"}\n className={\"text-neutral-strong\"}\n as={\"div\"}\n >{`Last updated: ${entry.lastModified}`}</Text>\n </div>\n </div>\n );\n }\n }\n }\n }\n};\n\nexport const WithCustomColumnSize: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n size: 200\n }\n }\n }\n};\n\nexport const WithCustomColumnClassName: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n lastModified: {\n ...columns.lastModified,\n className: \"bg-primary-subtle\"\n },\n status: {\n ...columns.status,\n className: \"text-right\"\n }\n }\n }\n};\n\nexport const WithSorting: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n enableSorting: true\n },\n lastModified: {\n ...columns.lastModified,\n enableSorting: true\n }\n },\n sorting: [\n {\n id: \"lastModified\",\n desc: true\n }\n ]\n },\n render: ({ sorting: argsSorting = [], ...args }) => {\n const [sorting, setSorting] = useState<DataTableSorting>(argsSorting);\n return <DataTable {...args} sorting={sorting} onSortingChange={setSorting} />;\n }\n};\n\n// Add a Documentation story\nexport const Documentation: Story<Entry> = {\n args: {\n bordered: true,\n stickyHeader: true,\n columns: {\n name: {\n header: \"Title\",\n enableSorting: true\n },\n createdBy: {\n header: \"Author\"\n },\n lastModified: {\n header: \"Last Modified\",\n enableSorting: true\n },\n status: {\n header: \"Status\"\n }\n },\n data: [\n {\n id: \"entry-1\",\n name: \"Getting Started Guide\",\n createdBy: \"John Doe\",\n lastModified: \"1 hour ago\",\n status: \"Published\"\n },\n {\n id: \"entry-2\",\n name: \"User Documentation\",\n createdBy: \"Jane Smith\",\n lastModified: \"3 days ago\",\n status: \"Draft\"\n },\n {\n id: \"entry-3\",\n name: \"API Reference\",\n createdBy: \"John Doe\",\n lastModified: \"1 week ago\",\n status: \"Published\"\n }\n ]\n },\n render: args => {\n const [selectedRows, setSelectedRows] = useState<Entry[]>([]);\n const [sorting, setSorting] = useState<DataTableSorting>([]);\n\n return (\n <DataTable\n {...args}\n selectedRows={selectedRows}\n onSelectRow={rows => setSelectedRows(rows)}\n sorting={sorting}\n onSortingChange={setSorting}\n />\n );\n },\n parameters: {\n docs: {\n description: {\n story: \"This example shows a DataTable with selectable rows, sorting, and a sticky header.\"\n }\n }\n },\n argTypes: {\n bordered: {\n description: \"Show or hide borders.\",\n control: \"boolean\",\n defaultValue: true\n },\n stickyHeader: {\n description: \"Enable sticky header.\",\n control: \"boolean\",\n defaultValue: true\n },\n columns: {\n description: \"Columns definition. Please refer to the code example for details.\",\n control: false\n },\n data: {\n description:\n \"Data to display into DataTable body. Please refer to the code example for details.\",\n control: false\n }\n }\n};\n"],"names":["meta","DataTable","columns","data","Default","Bordered","WithStickyHeader","WithSelectableRows","args","selectedRows","setSelectedRows","useState","rows","WithLoading","loading","setLoading","tableData","setTableData","useEffect","timer","setTimeout","clearTimeout","WithLongColumnContent","entry","WithCustomCellRenderer","Avatar","Text","WithCustomColumnSize","WithCustomColumnClassName","WithSorting","argsSorting","sorting","set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,oBAACV,WAASA;YACL,GAAGO,IAAI;YACR,cAAcC;YACd,aAAaG,CAAAA,OAAQF,gBAAgBE;YACrC,SAASmB;YACT,iBAAiBC;;IAG7B;IACA,YAAY;QACR,MAAM;YACF,aAAa;gBACT,OAAO;YACX;QACJ;IACJ;IACA,UAAU;QACN,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,cAAc;YACV,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,SAAS;YACL,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aACI;YACJ,SAAS;QACb;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"DataTable/DataTable.stories.js","sources":["../../src/DataTable/DataTable.stories.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport type { DataTableColumns, DataTableDefaultData, DataTableSorting } from \"./DataTable.js\";\nimport { DataTable } from \"./DataTable.js\";\nimport { Avatar } from \"~/Avatar/index.js\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DataTable> = {\n title: \"Components/DataTable\",\n component: DataTable,\n parameters: {\n layout: \"padded\"\n }\n};\n\nexport default meta;\ntype Story<T extends Record<string, any> & DataTableDefaultData> = StoryObj<typeof DataTable<T>>;\n\n// Declare the data structure.\ninterface Entry {\n id: string;\n name: string;\n createdBy: string;\n lastModified: string;\n status: string;\n}\n\n// Define the columns structure for the table.\nconst columns: DataTableColumns<Entry> = {\n name: {\n header: \"Title\"\n },\n createdBy: {\n header: \"Author\"\n },\n lastModified: {\n header: \"Last Modified\"\n },\n status: {\n header: \"Status\"\n }\n};\n\n// Define the data to display.\nconst data = [\n {\n id: \"entry-1\",\n name: \"Getting Started Guide\",\n createdBy: \"John Doe\",\n lastModified: \"1 hour ago\",\n status: \"Published\"\n },\n {\n id: \"entry-2\",\n name: \"User Documentation\",\n createdBy: \"Jane Smith\",\n lastModified: \"3 days ago\",\n status: \"Draft\"\n },\n {\n id: \"entry-3\",\n name: \"API Reference\",\n createdBy: \"John Doe\",\n lastModified: \"1 week ago\",\n status: \"Published\"\n }\n];\n\nexport const Default: Story<Entry> = {\n args: {\n data,\n columns\n }\n};\n\nexport const Bordered: Story<Entry> = {\n args: {\n ...Default.args,\n bordered: true\n }\n};\n\nexport const WithStickyHeader: Story<Entry> = {\n args: {\n ...Default.args,\n stickyHeader: true\n }\n};\n\nexport const WithSelectableRows: Story<Entry> = {\n args: Default.args,\n render: args => {\n const [selectedRows, setSelectedRows] = useState<Entry[]>([]);\n\n return (\n <DataTable\n {...args}\n selectedRows={selectedRows}\n onSelectRow={rows => setSelectedRows(rows)}\n />\n );\n }\n};\n\nexport const WithLoading: Story<Entry> = {\n args: {\n columns\n },\n render: ({ columns }) => {\n const [loading, setLoading] = useState(true);\n const [tableData, setTableData] = useState<Entry[]>([]);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setTableData(data); // your predefined data\n setLoading(false);\n }, 5000);\n\n return () => clearTimeout(timer);\n }, []);\n\n return <DataTable columns={columns} data={tableData} loading={loading} />;\n }\n};\n\nexport const WithLongColumnContent: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n header: \"Name - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n }\n },\n data: data.map(entry => ({\n ...entry,\n name: `${entry.name} - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.`\n }))\n }\n};\n\nexport const WithCustomCellRenderer: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n cell: (entry: Entry) => {\n return (\n <div className={\"flex items-center gap-sm-extra\"}>\n <Avatar\n image={\n <Avatar.Image\n src=\"https://github.com/webiny-bot.png\"\n alt=\"@webiny\"\n />\n }\n fallback={<Avatar.Fallback>{entry.name.charAt(0)}</Avatar.Fallback>}\n size={\"xl\"}\n />\n <div>\n <Text className={\"text-neutral-primary font-semibold\"} as={\"div\"}>\n {entry.name}\n </Text>\n <Text\n size={\"sm\"}\n className={\"text-neutral-strong\"}\n as={\"div\"}\n >{`Last updated: ${entry.lastModified}`}</Text>\n </div>\n </div>\n );\n }\n }\n }\n }\n};\n\nexport const WithCustomColumnSize: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n size: 200\n }\n }\n }\n};\n\nexport const WithCustomColumnClassName: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n lastModified: {\n ...columns.lastModified,\n className: \"bg-primary-subtle\"\n },\n status: {\n ...columns.status,\n className: \"text-right\"\n }\n }\n }\n};\n\nexport const WithSorting: Story<Entry> = {\n args: {\n ...Default.args,\n columns: {\n ...columns,\n name: {\n ...columns.name,\n enableSorting: true\n },\n lastModified: {\n ...columns.lastModified,\n enableSorting: true\n }\n },\n sorting: [\n {\n id: \"lastModified\",\n desc: true\n }\n ]\n },\n render: ({ sorting: argsSorting = [], ...args }) => {\n const [sorting, setSorting] = useState<DataTableSorting>(argsSorting);\n return <DataTable {...args} sorting={sorting} onSortingChange={setSorting} />;\n }\n};\n\n// Add a Documentation story\nexport const Documentation: Story<Entry> = {\n args: {\n bordered: true,\n stickyHeader: true,\n columns: {\n name: {\n header: \"Title\",\n enableSorting: true\n },\n createdBy: {\n header: \"Author\"\n },\n lastModified: {\n header: \"Last Modified\",\n enableSorting: true\n },\n status: {\n header: \"Status\"\n }\n },\n data: [\n {\n id: \"entry-1\",\n name: \"Getting Started Guide\",\n createdBy: \"John Doe\",\n lastModified: \"1 hour ago\",\n status: \"Published\"\n },\n {\n id: \"entry-2\",\n name: \"User Documentation\",\n createdBy: \"Jane Smith\",\n lastModified: \"3 days ago\",\n status: \"Draft\"\n },\n {\n id: \"entry-3\",\n name: \"API Reference\",\n createdBy: \"John Doe\",\n lastModified: \"1 week ago\",\n status: \"Published\"\n }\n ]\n },\n render: args => {\n const [selectedRows, setSelectedRows] = useState<Entry[]>([]);\n const [sorting, setSorting] = useState<DataTableSorting>([]);\n\n return (\n <DataTable\n {...args}\n selectedRows={selectedRows}\n onSelectRow={rows => setSelectedRows(rows)}\n sorting={sorting}\n onSortingChange={setSorting}\n />\n );\n },\n parameters: {\n docs: {\n description: {\n story: \"This example shows a DataTable with selectable rows, sorting, and a sticky header.\"\n }\n }\n },\n argTypes: {\n bordered: {\n description: \"Show or hide borders.\",\n control: \"boolean\",\n defaultValue: true\n },\n stickyHeader: {\n description: \"Enable sticky header.\",\n control: \"boolean\",\n defaultValue: true\n },\n columns: {\n description: \"Columns definition. Please refer to the code example for details.\",\n control: false\n },\n data: {\n description:\n \"Data to display into DataTable body. Please refer to the code example for details.\",\n control: false\n }\n }\n};\n"],"names":["meta","DataTable","columns","data","Default","Bordered","WithStickyHeader","WithSelectableRows","args","selectedRows","setSelectedRows","useState","rows","WithLoading","loading","setLoading","tableData","setTableData","useEffect","timer","setTimeout","clearTimeout","WithLongColumnContent","entry","WithCustomCellRenderer","Avatar","Text","WithCustomColumnSize","WithCustomColumnClassName","WithSorting","argsSorting","sorting","setSorting","Documentation"],"mappings":";;;;AAOA,MAAMA,OAA+B;IACjC,OAAO;IACP,WAAWC;IACX,YAAY;QACR,QAAQ;IACZ;AACJ;AAEA,0BAAeD;AAaf,MAAME,4BAAmC;IACrC,MAAM;QACF,QAAQ;IACZ;IACA,WAAW;QACP,QAAQ;IACZ;IACA,cAAc;QACV,QAAQ;IACZ;IACA,QAAQ;QACJ,QAAQ;IACZ;AACJ;AAGA,MAAMC,OAAO;IACT;QACI,IAAI;QACJ,MAAM;QACN,WAAW;QACX,cAAc;QACd,QAAQ;IACZ;IACA;QACI,IAAI;QACJ,MAAM;QACN,WAAW;QACX,cAAc;QACd,QAAQ;IACZ;IACA;QACI,IAAI;QACJ,MAAM;QACN,WAAW;QACX,cAAc;QACd,QAAQ;IACZ;CACH;AAEM,MAAMC,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AA2BmB;QACzD,OAAO,WAAP,GAAO,oBAAC7B,WAASA;YAAE,GAAGO,IAAI;YAAE,SAASuB;YAAS,iBAAiBC;;IACnE;AACJ;AAGO,MAAMC,gBAA8B;IACvC,MAAM;QACF,UAAU;QACV,cAAc;QACd,SAAS;YACL,MAAM;gBACF,QAAQ;gBACR,eAAe;YACnB;YACA,WAAW;gBACP,QAAQ;YACZ;YACA,cAAc;gBACV,QAAQ;gBACR,eAAe;YACnB;YACA,QAAQ;gBACJ,QAAQ;YACZ;QACJ;QACA,MAAM;YACF;gBACI,IAAI;gBACJ,MAAM;gBACN,WAAW;gBACX,cAAc;gBACd,QAAQ;YACZ;YACA;gBACI,IAAI;gBACJ,MAAM;gBACN,WAAW;gBACX,cAAc;gBACd,QAAQ;YACZ;YACA;gBACI,IAAI;gBACJ,MAAM;gBACN,WAAW;gBACX,cAAc;gBACd,QAAQ;YACZ;SACH;IACL;IACA,QAAQzB,CAAAA;QACJ,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SAAkB,EAAE;QAC5D,MAAM,CAACoB,SAASC,WAAW,GAAGrB,SAA2B,EAAE;QAE3D,OAAO,WAAP,GACI,oBAACV,WAASA;YACL,GAAGO,IAAI;YACR,cAAcC;YACd,aAAaG,CAAAA,OAAQF,gBAAgBE;YACrC,SAASmB;YACT,iBAAiBC;;IAG7B;IACA,YAAY;QACR,MAAM;YACF,aAAa;gBACT,OAAO;YACX;QACJ;IACJ;IACA,UAAU;QACN,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,cAAc;YACV,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,SAAS;YACL,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aACI;YACJ,SAAS;QACb;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker/DatePicker.js","sources":["../../src/DatePicker/DatePicker.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { DatePickerPrimitiveProps } from \"./primitives/index.js\";\nimport { DatePickerPrimitive } from \"./primitives/index.js\";\nimport type { FormComponentProps } from \"~/FormComponent/index.js\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote\n} from \"~/FormComponent/index.js\";\nimport { Text } from \"~/Text/index.js\";\n\ninterface DatePickerOwnProps {\n showTimezone?: boolean;\n}\n\ntype DatePickerProps = DatePickerPrimitiveProps & FormComponentProps & DatePickerOwnProps;\n\nconst TimezoneLabel = () => {\n const timezone = useMemo(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []);\n return (\n <Text size={\"sm\"} className={\"text-neutral-strong mt-xxs\"}>\n Timezone: {timezone}\n </Text>\n );\n};\n\nconst DecoratableDatePicker = ({\n label,\n description,\n note,\n hint,\n required,\n disabled,\n validation,\n showTimezone = false,\n ...props\n}: DatePickerProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n\n return (\n <div className=\"w-full\">\n <FormComponentLabel\n text={label}\n hint={hint}\n required={required}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <DatePickerPrimitive\n {...(props as DatePickerPrimitiveProps)}\n disabled={disabled}\n invalid={invalid}\n />\n {showTimezone && <TimezoneLabel />}\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\n\nconst DatePicker = makeDecoratable(\"DatePicker\", DecoratableDatePicker);\n\nexport { DatePicker, type DatePickerProps };\n"],"names":["TimezoneLabel","timezone","useMemo","Intl","Text","DecoratableDatePicker","label","description","note","hint","required","disabled","validation","showTimezone","props","validationIsValid","validationMessage","invalid","FormComponentLabel","FormComponentDescription","DatePickerPrimitive","FormComponentErrorMessage","FormComponentNote","DatePicker","makeDecoratable"],"mappings":";;;;;AAmBA,MAAMA,gBAAgB;IAClB,MAAMC,WAAWC,QAAQ,IAAMC,KAAK,cAAc,GAAG,eAAe,GAAG,QAAQ,EAAE,EAAE;IACnF,OAAO,WAAP,GACI,oBAACC,MAAIA;QAAC,MAAM;QAAM,WAAW;OAA8B,cAC5CH;AAGvB;AAEA,MAAMI,wBAAwB,CAAC,EAC3BC,KAAK,EACLC,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,eAAe,KAAK,EACpB,GAAGC,OACW;IACd,MAAM,EAAE,SAASC,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGJ,cAAc,CAAC;IAClF,MAAMK,UAAUf,QAAQ,IAAMa,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAE9E,OAAO,WAAP,GACI,oBAAC;QAAI,WAAU;qBACX,oBAACG,oBAAkBA;QACf,MAAMZ;QACN,MAAMG;QACN,UAAUC;QACV,UAAUC;QACV,SAASM;sBAEb,oBAACE,0BAAwBA;QAAC,MAAMZ;QAAa,UAAUI;sBACvD,oBAACS,qBAAmBA;QACf,GAAIN,KAAK;QACV,UAAUH;QACV,SAASM;QAEZJ,gBAAgB,WAAhBA,GAAgB,oBAACb,
|
|
1
|
+
{"version":3,"file":"DatePicker/DatePicker.js","sources":["../../src/DatePicker/DatePicker.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { makeDecoratable } from \"~/utils.js\";\nimport type { DatePickerPrimitiveProps } from \"./primitives/index.js\";\nimport { DatePickerPrimitive } from \"./primitives/index.js\";\nimport type { FormComponentProps } from \"~/FormComponent/index.js\";\nimport {\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel,\n FormComponentNote\n} from \"~/FormComponent/index.js\";\nimport { Text } from \"~/Text/index.js\";\n\ninterface DatePickerOwnProps {\n showTimezone?: boolean;\n}\n\ntype DatePickerProps = DatePickerPrimitiveProps & FormComponentProps & DatePickerOwnProps;\n\nconst TimezoneLabel = () => {\n const timezone = useMemo(() => Intl.DateTimeFormat().resolvedOptions().timeZone, []);\n return (\n <Text size={\"sm\"} className={\"text-neutral-strong mt-xxs\"}>\n Timezone: {timezone}\n </Text>\n );\n};\n\nconst DecoratableDatePicker = ({\n label,\n description,\n note,\n hint,\n required,\n disabled,\n validation,\n showTimezone = false,\n ...props\n}: DatePickerProps) => {\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n const invalid = useMemo(() => validationIsValid === false, [validationIsValid]);\n\n return (\n <div className=\"w-full\">\n <FormComponentLabel\n text={label}\n hint={hint}\n required={required}\n disabled={disabled}\n invalid={invalid}\n />\n <FormComponentDescription text={description} disabled={disabled} />\n <DatePickerPrimitive\n {...(props as DatePickerPrimitiveProps)}\n disabled={disabled}\n invalid={invalid}\n />\n {showTimezone && <TimezoneLabel />}\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={invalid}\n disabled={disabled}\n />\n <FormComponentNote text={note} disabled={disabled} />\n </div>\n );\n};\n\nconst DatePicker = makeDecoratable(\"DatePicker\", DecoratableDatePicker);\n\nexport { DatePicker, type DatePickerProps };\n"],"names":["TimezoneLabel","timezone","useMemo","Intl","Text","DecoratableDatePicker","label","description","note","hint","required","disabled","validation","showTimezone","props","validationIsValid","validationMessage","invalid","FormComponentLabel","FormComponentDescription","DatePickerPrimitive","FormComponentErrorMessage","FormComponentNote","DatePicker","makeDecoratable"],"mappings":";;;;;AAmBA,MAAMA,gBAAgB;IAClB,MAAMC,WAAWC,QAAQ,IAAMC,KAAK,cAAc,GAAG,eAAe,GAAG,QAAQ,EAAE,EAAE;IACnF,OAAO,WAAP,GACI,oBAACC,MAAIA;QAAC,MAAM;QAAM,WAAW;OAA8B,cAC5CH;AAGvB;AAEA,MAAMI,wBAAwB,CAAC,EAC3BC,KAAK,EACLC,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,eAAe,KAAK,EACpB,GAAGC,OACW;IACd,MAAM,EAAE,SAASC,iBAAiB,EAAE,SAASC,iBAAiB,EAAE,GAAGJ,cAAc,CAAC;IAClF,MAAMK,UAAUf,QAAQ,IAAMa,AAAsB,UAAtBA,mBAA6B;QAACA;KAAkB;IAE9E,OAAO,WAAP,GACI,oBAAC;QAAI,WAAU;qBACX,oBAACG,oBAAkBA;QACf,MAAMZ;QACN,MAAMG;QACN,UAAUC;QACV,UAAUC;QACV,SAASM;sBAEb,oBAACE,0BAAwBA;QAAC,MAAMZ;QAAa,UAAUI;sBACvD,oBAACS,qBAAmBA;QACf,GAAIN,KAAK;QACV,UAAUH;QACV,SAASM;QAEZJ,gBAAgB,WAAhBA,GAAgB,oBAACb,eAAAA,OAAAA,WAAAA,GAClB,oBAACqB,2BAAyBA;QACtB,MAAML;QACN,SAASC;QACT,UAAUN;sBAEd,oBAACW,mBAAiBA;QAAC,MAAMd;QAAM,UAAUG;;AAGrD;AAEA,MAAMY,aAAaC,gBAAgB,cAAcnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker/DatePicker.stories.js","sources":["../../src/DatePicker/DatePicker.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { addDays, nextSaturday } from \"date-fns\";\nimport { DatePicker } from \"./DatePicker.js\";\n\nconst meta: Meta<typeof DatePicker> = {\n title: \"Components/Form/DatePicker\",\n component: DatePicker,\n argTypes: {\n onChange: { action: \"onChange\" },\n type: {\n control: \"select\",\n options: [\n \"date\",\n \"birthday\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState<any>();\n return <DatePicker {...args} value={value} onChange={setValue} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof DatePicker>;\n\nexport const Default: Story = {\n args: {\n type: \"date\"\n }\n};\n\nexport const WithLabel: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\"\n }\n};\n\nexport const WithLabelRequired: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n type: \"date\",\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithNotes: Story = {\n args: {\n type: \"date\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithErrors: Story = {\n args: {\n type: \"date\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Disabled: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const FullExample: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithPresets: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n const presets = [\n { label: \"Today\", value: () => new Date() },\n { label: \"Tomorrow\", value: () => addDays(new Date(), 1) },\n { label: \"In 3 days\", value: () => addDays(new Date(), 3) },\n { label: \"In a week\", value: () => addDays(new Date(), 7) },\n { label: \"In 2 weeks\", value: () => addDays(new Date(), 14) },\n { label: \"Next Saturday\", value: () => nextSaturday(new Date()) }\n ];\n return (\n <DatePicker {...args} type=\"date\" value={value} onChange={setValue} presets={presets} />\n );\n },\n args: {\n label: \"Pick a date\",\n description: \"Choose a date or use a preset.\"\n }\n};\n\n/**\n * Picks a date one step at a time: a day, then a month, then a year (newest first). Built for\n * dates far in the past, like a date of birth. The value is a `YYYY-MM-DD` string.\n */\nexport const TypeBirthday: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>(\"1990-02-09\");\n return (\n <div className=\"flex flex-col gap-md max-w-[480px]\">\n <DatePicker {...args} type=\"birthday\" value={value} onChange={setValue} />\n <span className=\"text-sm text-neutral-muted\">Value: {value ?? \"(empty)\"}</span>\n </div>\n );\n },\n args: {\n label: \"Date of birth\"\n }\n};\n\n/**\n * With `minDate` and `maxDate`, years run from the latest allowed one down to the earliest,\n * and days and months that can't make an allowed date are dimmed. Here: 18 to 100 years old.\n */\nexport const TypeBirthdayWithLimits: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n const today = new Date();\n const [minDate] = useState(\n () => new Date(today.getFullYear() - 100, today.getMonth(), today.getDate())\n );\n const [maxDate] = useState(\n () => new Date(today.getFullYear() - 18, today.getMonth(), today.getDate())\n );\n return (\n <div className=\"flex flex-col gap-md max-w-[480px]\">\n <DatePicker\n {...args}\n type=\"birthday\"\n value={value}\n onChange={setValue}\n minDate={minDate}\n maxDate={maxDate}\n />\n <span className=\"text-sm text-neutral-muted\">Value: {value ?? \"(empty)\"}</span>\n </div>\n );\n },\n args: {\n label: \"Date of birth\",\n description: \"You must be 18 or older.\"\n }\n};\n\nexport const TypeTime: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"time\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Time\"\n }\n};\n\nexport const TypeDateTimeLocal: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeLocal\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (local)\"\n }\n};\n\nexport const TypeDateTimeTz: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeTz\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (with timezone)\"\n }\n};\n\nexport const TypeMonth: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"month\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Month\"\n }\n};\n\nexport const TypeWeek: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"week\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Week\"\n }\n};\n\nexport const TypeYear: Story = {\n render: args => {\n const [value, setValue] = useState<number | undefined>();\n return (\n <DatePicker\n {...args}\n type=\"year\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Year\"\n }\n};\n\nexport const TypeDateRange: Story = {\n render: args => {\n const [value, setValue] = useState<{ from?: string; to?: string } | undefined>();\n return <DatePicker {...args} type=\"dateRange\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date Range\"\n }\n};\n\nexport const TypeMultipleDates: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleDates\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Dates\"\n }\n};\n\nexport const TypeMultipleMonths: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleMonths\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Months\"\n }\n};\n\nexport const TypeMultipleYears: Story = {\n render: args => {\n const [value, setValue] = useState<number[]>([]);\n return (\n <DatePicker\n {...args}\n type=\"multipleYears\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Multiple Years\"\n }\n};\n\nconst formatValue = (value: any): string => {\n if (value === undefined || value === null) {\n return \"undefined\";\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n if (Array.isArray(value)) {\n return JSON.stringify(\n value.map((v: any) => (v instanceof Date ? v.toISOString() : v)),\n null,\n 2\n );\n }\n if (typeof value === \"object\") {\n return JSON.stringify(value, (_k, v) => (v instanceof Date ? v.toISOString() : v), 2);\n }\n return String(value);\n};\n\nconst DocumentationInner = (args: any) => {\n const isMultiple = (args.type as string)?.startsWith(\"multiple\");\n const [value, setValue] = useState<any>(isMultiple ? [] : undefined);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n const handleChange = (newValue: any) => {\n setValue(newValue);\n const isEmpty =\n newValue === undefined ||\n newValue === null ||\n newValue === \"\" ||\n (Array.isArray(newValue) && newValue.length === 0);\n if (args.required && isEmpty) {\n setValidation({ isValid: false, message: \"This field is required\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n };\n\n return (\n <div>\n <DatePicker {...args} value={value} onChange={handleChange} validation={validation} />\n <div className=\"mt-md rounded-md border-sm border-neutral-muted bg-neutral-light p-sm\">\n <div className=\"text-xs font-medium text-neutral-dimmed mb-xs\">Current value</div>\n <pre className=\"text-sm text-neutral-strong whitespace-pre-wrap m-0\">\n {formatValue(value)}\n </pre>\n </div>\n </div>\n );\n};\n\nexport const Documentation: Story = {\n render: args => {\n return <DocumentationInner key={args.type as string} {...args} />;\n },\n args: {\n type: \"date\",\n label: \"Event Date\",\n required: true,\n disabled: false,\n description: \"Select the date for your event\",\n note: \"Note: Choose a date that works for all participants\",\n placeholder: \"Pick a date\",\n validation: undefined\n },\n argTypes: {\n type: {\n description: \"The type of date picker variant to render\",\n control: \"select\",\n options: [\n \"date\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n label: {\n description: \"Label text displayed above the picker\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required\",\n control: \"boolean\",\n defaultValue: true\n },\n disabled: {\n description: \"Disables the date picker\",\n control: \"boolean\",\n defaultValue: false\n },\n description: {\n description: \"Helper text displayed below the label\",\n control: \"text\"\n },\n note: {\n description: \"Additional note displayed below the picker\",\n control: \"text\"\n },\n placeholder: {\n description: \"Placeholder text shown when no date is selected\",\n control: \"text\"\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onChange: {\n description: \"Callback function when the value changes\"\n }\n }\n};\n"],"names":["meta","DatePicker","args","value","setValue","useState","Default","WithLabel","WithLabelRequired","WithDescription","WithNotes","WithErrors","Disabled","FullExample","WithPresets","presets","Date","addDays","nextSaturday","TypeBirthday","TypeBirthdayWithLimits","today","minDate","maxDate","TypeTime","TypeDateTimeLocal","TypeDateTimeTz","TypeMonth","TypeWeek","TypeYear","TypeDateRange","TypeMultipleDates","TypeMultipleMonths","TypeMultipleYears","formatValue","Array","JSON","v","_k","String","DocumentationInner","isMultiple","undefined","validation","setValidation","handleChange","newValue","isEmpty","Documentation"],"mappings":";;;AAKA,MAAMA,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,UAAU;QACN,UAAU;YAAE,QAAQ;QAAW;QAC/B,MAAM;YACF,SAAS;YACT,SAAS;gBACL;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,cAAc;QAClB;QACA,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,OAAOC,SAAS,GAAGC;QAC1B,OAAO,WAAP,GAAO,oBAACJ,YAAUA;YAAE,GAAGC,IAAI;YAAE,OAAOC;YAAO,UAAUC;;IACzD;AACJ;AAEA,2BAAeJ;AAGR,MAAMM,UAAiB;IAC1B,MAAM;QACF,MAAM;IACV;AACJ;AAEO,MAAMC,YAAmB;IAC5B,MAAM;QACF,MAAM;QACN,OAAO;IACX;AACJ;AAEO,MAAMC,oBAA2B;IACpC,MAAM;QACF,MAAM;QACN,OAAO;QACP,UAAU;IACd;AACJ;AAEO,MAAMC,kBAAyB;IAClC,MAAM;QACF,MAAM;QACN,aAAa;IACjB;AACJ;AAEO,MAAMC,YAAmB;IAC5B,MAAM;QACF,MAAM;QACN,MAAM;IACV;AACJ;AAEO,MAAMC,aAAoB;IAC7B,MAAM;QACF,MAAM;QACN,YAAY;YACR,SAAS;YACT,SAAS;QACb;I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YAAO,SAAS;QAAyB,KAElEA,cAAc;YAAE,SAAS;YAAM,SAAS;QAAG;IAEnD;IAEA,OAAO,WAAP,GACI,oBAAC,2BACG,oBAAC3C,YAAUA;QAAE,GAAGC,IAAI;QAAE,OAAOC;QAAO,UAAU0C;QAAc,YAAYF;sBACxE,oBAAC;QAAI,WAAU;qBACX,oBAAC;QAAI,WAAU;OAAgD,gCAC/D,oBAAC;QAAI,WAAU;OACVT,YAAY/B;AAKjC;AAEO,MAAM6C,gBAAuB;IAChC,QAAQ9C,CAAAA,OACG,WAAP,GAAO,oBAACsC,oBAAkBA;YAAC,KAAKtC,KAAK,IAAI;YAAa,GAAGA,IAAI;;IAEjE,MAAM;QACF,MAAM;QACN,OAAO;QACP,UAAU;QACV,UAAU;QACV,aAAa;QACb,MAAM;QACN,aAAa;QACb,YAAYwC;IAChB;IACA,UAAU;QACN,MAAM;YACF,aAAa;YACb,SAAS;YACT,SAAS;gBACL;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,cAAc;QAClB;QACA,OAAO;YACH,aAAa;YACb,SAAS;QACb;QACA,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,UAAU;YACN,aAAa;YACb,SAAS;YACT,cAAc;QAClB;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,MAAM;YACF,aAAa;YACb,SAAS;QACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,YAAY;YACR,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"DatePicker/DatePicker.stories.js","sources":["../../src/DatePicker/DatePicker.stories.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { addDays, nextSaturday } from \"date-fns\";\nimport { DatePicker } from \"./DatePicker.js\";\n\nconst meta: Meta<typeof DatePicker> = {\n title: \"Components/Form/DatePicker\",\n component: DatePicker,\n argTypes: {\n onChange: { action: \"onChange\" },\n type: {\n control: \"select\",\n options: [\n \"date\",\n \"birthday\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => {\n const [value, setValue] = useState<any>();\n return <DatePicker {...args} value={value} onChange={setValue} />;\n }\n};\n\nexport default meta;\ntype Story = StoryObj<typeof DatePicker>;\n\nexport const Default: Story = {\n args: {\n type: \"date\"\n }\n};\n\nexport const WithLabel: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\"\n }\n};\n\nexport const WithLabelRequired: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true\n }\n};\n\nexport const WithDescription: Story = {\n args: {\n type: \"date\",\n description: \"Provide the required information for processing your request.\"\n }\n};\n\nexport const WithNotes: Story = {\n args: {\n type: \"date\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\"\n }\n};\n\nexport const WithErrors: Story = {\n args: {\n type: \"date\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const Disabled: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n disabled: true\n }\n};\n\nexport const FullExample: Story = {\n args: {\n type: \"date\",\n label: \"Any field label\",\n required: true,\n description: \"Provide the required information for processing your request.\",\n note: \"Note: Ensure your selection or input is accurate before proceeding.\",\n validation: {\n isValid: false,\n message: \"This field is required.\"\n }\n }\n};\n\nexport const WithPresets: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n const presets = [\n { label: \"Today\", value: () => new Date() },\n { label: \"Tomorrow\", value: () => addDays(new Date(), 1) },\n { label: \"In 3 days\", value: () => addDays(new Date(), 3) },\n { label: \"In a week\", value: () => addDays(new Date(), 7) },\n { label: \"In 2 weeks\", value: () => addDays(new Date(), 14) },\n { label: \"Next Saturday\", value: () => nextSaturday(new Date()) }\n ];\n return (\n <DatePicker {...args} type=\"date\" value={value} onChange={setValue} presets={presets} />\n );\n },\n args: {\n label: \"Pick a date\",\n description: \"Choose a date or use a preset.\"\n }\n};\n\n/**\n * Picks a date one step at a time: a day, then a month, then a year (newest first). Built for\n * dates far in the past, like a date of birth. The value is a `YYYY-MM-DD` string.\n */\nexport const TypeBirthday: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>(\"1990-02-09\");\n return (\n <div className=\"flex flex-col gap-md max-w-[480px]\">\n <DatePicker {...args} type=\"birthday\" value={value} onChange={setValue} />\n <span className=\"text-sm text-neutral-muted\">Value: {value ?? \"(empty)\"}</span>\n </div>\n );\n },\n args: {\n label: \"Date of birth\"\n }\n};\n\n/**\n * With `minDate` and `maxDate`, years run from the latest allowed one down to the earliest,\n * and days and months that can't make an allowed date are dimmed. Here: 18 to 100 years old.\n */\nexport const TypeBirthdayWithLimits: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n const today = new Date();\n const [minDate] = useState(\n () => new Date(today.getFullYear() - 100, today.getMonth(), today.getDate())\n );\n const [maxDate] = useState(\n () => new Date(today.getFullYear() - 18, today.getMonth(), today.getDate())\n );\n return (\n <div className=\"flex flex-col gap-md max-w-[480px]\">\n <DatePicker\n {...args}\n type=\"birthday\"\n value={value}\n onChange={setValue}\n minDate={minDate}\n maxDate={maxDate}\n />\n <span className=\"text-sm text-neutral-muted\">Value: {value ?? \"(empty)\"}</span>\n </div>\n );\n },\n args: {\n label: \"Date of birth\",\n description: \"You must be 18 or older.\"\n }\n};\n\nexport const TypeTime: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"time\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Time\"\n }\n};\n\nexport const TypeDateTimeLocal: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeLocal\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (local)\"\n }\n};\n\nexport const TypeDateTimeTz: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"dateTimeTz\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date & Time (with timezone)\"\n }\n};\n\nexport const TypeMonth: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"month\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Month\"\n }\n};\n\nexport const TypeWeek: Story = {\n render: args => {\n const [value, setValue] = useState<string | undefined>();\n return <DatePicker {...args} type=\"week\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Week\"\n }\n};\n\nexport const TypeYear: Story = {\n render: args => {\n const [value, setValue] = useState<number | undefined>();\n return (\n <DatePicker\n {...args}\n type=\"year\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Year\"\n }\n};\n\nexport const TypeDateRange: Story = {\n render: args => {\n const [value, setValue] = useState<{ from?: string; to?: string } | undefined>();\n return <DatePicker {...args} type=\"dateRange\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Date Range\"\n }\n};\n\nexport const TypeMultipleDates: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleDates\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Dates\"\n }\n};\n\nexport const TypeMultipleMonths: Story = {\n render: args => {\n const [value, setValue] = useState<string[]>([]);\n return <DatePicker {...args} type=\"multipleMonths\" value={value} onChange={setValue} />;\n },\n args: {\n label: \"Multiple Months\"\n }\n};\n\nexport const TypeMultipleYears: Story = {\n render: args => {\n const [value, setValue] = useState<number[]>([]);\n return (\n <DatePicker\n {...args}\n type=\"multipleYears\"\n value={value}\n onChange={setValue}\n yearRange={[2015, 2035]}\n />\n );\n },\n args: {\n label: \"Multiple Years\"\n }\n};\n\nconst formatValue = (value: any): string => {\n if (value === undefined || value === null) {\n return \"undefined\";\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n if (Array.isArray(value)) {\n return JSON.stringify(\n value.map((v: any) => (v instanceof Date ? v.toISOString() : v)),\n null,\n 2\n );\n }\n if (typeof value === \"object\") {\n return JSON.stringify(value, (_k, v) => (v instanceof Date ? v.toISOString() : v), 2);\n }\n return String(value);\n};\n\nconst DocumentationInner = (args: any) => {\n const isMultiple = (args.type as string)?.startsWith(\"multiple\");\n const [value, setValue] = useState<any>(isMultiple ? [] : undefined);\n const [validation, setValidation] = useState({ isValid: true, message: \"\" });\n\n const handleChange = (newValue: any) => {\n setValue(newValue);\n const isEmpty =\n newValue === undefined ||\n newValue === null ||\n newValue === \"\" ||\n (Array.isArray(newValue) && newValue.length === 0);\n if (args.required && isEmpty) {\n setValidation({ isValid: false, message: \"This field is required\" });\n } else {\n setValidation({ isValid: true, message: \"\" });\n }\n };\n\n return (\n <div>\n <DatePicker {...args} value={value} onChange={handleChange} validation={validation} />\n <div className=\"mt-md rounded-md border-sm border-neutral-muted bg-neutral-light p-sm\">\n <div className=\"text-xs font-medium text-neutral-dimmed mb-xs\">Current value</div>\n <pre className=\"text-sm text-neutral-strong whitespace-pre-wrap m-0\">\n {formatValue(value)}\n </pre>\n </div>\n </div>\n );\n};\n\nexport const Documentation: Story = {\n render: args => {\n return <DocumentationInner key={args.type as string} {...args} />;\n },\n args: {\n type: \"date\",\n label: \"Event Date\",\n required: true,\n disabled: false,\n description: \"Select the date for your event\",\n note: \"Note: Choose a date that works for all participants\",\n placeholder: \"Pick a date\",\n validation: undefined\n },\n argTypes: {\n type: {\n description: \"The type of date picker variant to render\",\n control: \"select\",\n options: [\n \"date\",\n \"time\",\n \"dateTimeLocal\",\n \"dateTimeTz\",\n \"month\",\n \"week\",\n \"year\",\n \"dateRange\",\n \"multipleDates\",\n \"multipleMonths\",\n \"multipleYears\"\n ],\n defaultValue: \"date\"\n },\n label: {\n description: \"Label text displayed above the picker\",\n control: \"text\"\n },\n required: {\n description: \"Makes the field required\",\n control: \"boolean\",\n defaultValue: true\n },\n disabled: {\n description: \"Disables the date picker\",\n control: \"boolean\",\n defaultValue: false\n },\n description: {\n description: \"Helper text displayed below the label\",\n control: \"text\"\n },\n note: {\n description: \"Additional note displayed below the picker\",\n control: \"text\"\n },\n placeholder: {\n description: \"Placeholder text shown when no date is selected\",\n control: \"text\"\n },\n validation: {\n description:\n \"Object containing validation state and message. Please refer to the example code for details on usage.\"\n },\n onChange: {\n description: \"Callback function when the value changes\"\n }\n }\n};\n"],"names":["meta","DatePicker","args","value","setValue","useState","Default","WithLabel","WithLabelRequired","WithDescription","WithNotes","WithErrors","Disabled","FullExample","WithPresets","presets","Date","addDays","nextSaturday","TypeBirthday","TypeBirthdayWithLimits","today","minDate","maxDate","TypeTime","TypeDateTimeLocal","TypeDateTimeTz","TypeMonth","TypeWeek","TypeYear","TypeDateRange","TypeMultipleDates","TypeMultipleMonths","TypeMultipleYears","formatValue","Array","JSON","v","_k","String","DocumentationInner","isMultiple","undefined","validation","setValidation","handleChange","newValue","isEmpty","Documentation"],"mappings":";;;AAKA,MAAMA,OAAgC;IAClC,OAAO;IACP,WAAWC;IACX,UAAU;QACN,UAAU;YAAE,QAAQ;QAAW;QAC/B,MAAM;YACF,SAAS;YACT,SAAS;gBACL;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,cAAc;QAClB;QACA,UAAU;YACN,SAAS;YACT,cAAc;QAClB;IACJ;IACA,YAAY;QACR,QAAQ;IACZ;IACA,QAAQC,CAAAA;QACJ,MAAM,CAACC,OAAOC,SAAS,GAAGC;QAC1B,OAAO,WAAP,GAAO,oBAACJ,YAAUA;YAAE,GAAGC,IAAI;YAAE,OAAOC;YAAO,UAAUC;;IACzD;AACJ;AAEA,2BAAeJ;AAGR,MAAMM,UAAiB;IAC1B,MAAM;QACF,MAAM;IACV;AACJ;AAE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ACb;QACA,aAAa;YACT,aAAa;YACb,SAAS;QACb;QACA,YAAY;YACR,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker/primitives/components/DatePickerTrigger.js","sources":["../../../../src/DatePicker/primitives/components/DatePickerTrigger.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { ReactComponent as CalendarMonthIcon } from \"@webiny/icons/calendar_month.svg\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/schedule.svg\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { inputVariants, type InputPrimitiveProps } from \"~/Input/index.js\";\nimport { PopoverPrimitive } from \"~/Popover/index.js\";\nimport { cn } from \"~/utils.js\";\n\ninterface DatePickerTriggerProps {\n displayValue?: string;\n placeholder?: string;\n disabled?: boolean;\n size?: InputPrimitiveProps[\"size\"];\n variant?: InputPrimitiveProps[\"variant\"];\n invalid?: InputPrimitiveProps[\"invalid\"];\n iconType?: \"calendar\" | \"time\";\n}\n\nconst DatePickerTriggerInner = forwardRef<\n HTMLDivElement,\n DatePickerTriggerProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n displayValue,\n placeholder,\n disabled,\n size,\n variant,\n invalid,\n iconType = \"calendar\",\n className,\n ...props\n },\n ref\n ) => {\n const IconComponent = iconType === \"time\" ? ScheduleIcon : CalendarMonthIcon;\n const iconLabel = iconType === \"time\" ? \"Time\" : \"Calendar\";\n\n return (\n <PopoverPrimitive.Trigger asChild>\n <div\n ref={ref}\n role=\"button\"\n tabIndex={0}\n data-disabled={disabled}\n className={cn(\n inputVariants({ size, variant, invalid }),\n \"cursor-pointer justify-between select-none min-w-0 overflow-hidden\",\n disabled && \"pointer-events-none opacity-50\",\n className\n )}\n {...props}\n >\n <span className={cn(\"truncate\", !displayValue && \"text-neutral-dimmed\")}>\n {displayValue || placeholder || \"Select...\"}\n </span>\n <Icon icon={<IconComponent />} label={iconLabel} size=\"sm\" color=\"inherit\" />\n </div>\n </PopoverPrimitive.Trigger>\n );\n }\n);\n\nDatePickerTriggerInner.displayName = \"DatePickerTrigger\";\n\nexport { DatePickerTriggerInner as DatePickerTrigger, type DatePickerTriggerProps };\n"],"names":["DatePickerTriggerInner","forwardRef","displayValue","placeholder","disabled","size","variant","invalid","iconType","className","props","ref","IconComponent","ScheduleIcon","CalendarMonthIcon","iconLabel","PopoverPrimitive","cn","inputVariants","Icon"],"mappings":";;;;;;;AAkBA,MAAMA,yBAAyB,
|
|
1
|
+
{"version":3,"file":"DatePicker/primitives/components/DatePickerTrigger.js","sources":["../../../../src/DatePicker/primitives/components/DatePickerTrigger.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { ReactComponent as CalendarMonthIcon } from \"@webiny/icons/calendar_month.svg\";\nimport { ReactComponent as ScheduleIcon } from \"@webiny/icons/schedule.svg\";\nimport { Icon } from \"~/Icon/index.js\";\nimport { inputVariants, type InputPrimitiveProps } from \"~/Input/index.js\";\nimport { PopoverPrimitive } from \"~/Popover/index.js\";\nimport { cn } from \"~/utils.js\";\n\ninterface DatePickerTriggerProps {\n displayValue?: string;\n placeholder?: string;\n disabled?: boolean;\n size?: InputPrimitiveProps[\"size\"];\n variant?: InputPrimitiveProps[\"variant\"];\n invalid?: InputPrimitiveProps[\"invalid\"];\n iconType?: \"calendar\" | \"time\";\n}\n\nconst DatePickerTriggerInner = forwardRef<\n HTMLDivElement,\n DatePickerTriggerProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n displayValue,\n placeholder,\n disabled,\n size,\n variant,\n invalid,\n iconType = \"calendar\",\n className,\n ...props\n },\n ref\n ) => {\n const IconComponent = iconType === \"time\" ? ScheduleIcon : CalendarMonthIcon;\n const iconLabel = iconType === \"time\" ? \"Time\" : \"Calendar\";\n\n return (\n <PopoverPrimitive.Trigger asChild>\n <div\n ref={ref}\n role=\"button\"\n tabIndex={0}\n data-disabled={disabled}\n className={cn(\n inputVariants({ size, variant, invalid }),\n \"cursor-pointer justify-between select-none min-w-0 overflow-hidden\",\n disabled && \"pointer-events-none opacity-50\",\n className\n )}\n {...props}\n >\n <span className={cn(\"truncate\", !displayValue && \"text-neutral-dimmed\")}>\n {displayValue || placeholder || \"Select...\"}\n </span>\n <Icon icon={<IconComponent />} label={iconLabel} size=\"sm\" color=\"inherit\" />\n </div>\n </PopoverPrimitive.Trigger>\n );\n }\n);\n\nDatePickerTriggerInner.displayName = \"DatePickerTrigger\";\n\nexport { DatePickerTriggerInner as DatePickerTrigger, type DatePickerTriggerProps };\n"],"names":["DatePickerTriggerInner","forwardRef","displayValue","placeholder","disabled","size","variant","invalid","iconType","className","props","ref","IconComponent","ScheduleIcon","CalendarMonthIcon","iconLabel","PopoverPrimitive","cn","inputVariants","Icon"],"mappings":";;;;;;;AAkBA,MAAMA,yBAAyB,WAAzBA,GAAyBC,WAI3B,CACI,EACIC,YAAY,EACZC,WAAW,EACXC,QAAQ,EACRC,IAAI,EACJC,OAAO,EACPC,OAAO,EACPC,WAAW,UAAU,EACrBC,SAAS,EACT,GAAGC,OACN,EACDC;IAEA,MAAMC,gBAAgBJ,AAAa,WAAbA,WAAsBK,8BAAeC;IAC3D,MAAMC,YAAYP,AAAa,WAAbA,WAAsB,SAAS;IAEjD,OAAO,WAAP,GACI,oBAACQ,iBAAiB,OAAO;QAAC;qBACtB,oBAAC;QACG,KAAKL;QACL,MAAK;QACL,UAAU;QACV,iBAAeP;QACf,WAAWa,GACPC,cAAc;YAAEb;YAAMC;YAASC;QAAQ,IACvC,sEACAH,YAAY,kCACZK;QAEH,GAAGC,KAAK;qBAET,oBAAC;QAAK,WAAWO,GAAG,YAAY,CAACf,gBAAgB;OAC5CA,gBAAgBC,eAAe,4BAEpC,oBAACgB,MAAIA;QAAC,oBAAM,oBAACP,eAAAA;QAAkB,OAAOG;QAAW,MAAK;QAAK,OAAM;;AAIjF;AAGJf,uBAAuB,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog/components/DialogContent.js","sources":["../../../src/Dialog/components/DialogContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst dialogContentVariants = cva(\n [\n \"fixed left-[50%] top-[50%] border-none bg-neutral-base shadow-lg focus-visible:outline-none rounded-xl text-md text-neutral-strong\",\n \"translate-x-[-50%] translate-y-[-50%] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"focus:outline-none focus-visible:outline-none\",\n \"max-w-[calc(100vw-var(--spacing-lg))] max-h-[calc(100vh-var(--spacing-lg))] z-dialog\",\n \"grid grid-rows-[auto_1fr_auto] overflow-hidden\"\n ],\n {\n variants: {\n size: {\n sm: \"w-[384px]\",\n md: \"w-[520px]\",\n lg: \"w-[640px]\",\n xl: \"w-[800px]\",\n full: \"w-screen h-screen\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport interface DialogContentProps\n extends\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContentVariants> {\n dismissible?: boolean;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n closeButton?: React.ReactNode;\n overlay?: React.ReactNode;\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n { className, dismissible, size, header, footer, closeButton, overlay, children, ...props },\n ref\n ) => {\n const dismissibleProps = React.useMemo<\n Pick<DialogPrimitive.DialogContentProps, \"onInteractOutside\" | \"onEscapeKeyDown\">\n >(() => {\n if (dismissible === false) {\n return {\n onInteractOutside: event => event.preventDefault(),\n onEscapeKeyDown: event => event.preventDefault()\n };\n }\n\n return {};\n }, [dismissible]);\n\n return (\n <DialogPrimitive.Content\n {...dismissibleProps}\n {...props}\n ref={ref}\n className={cn(dialogContentVariants({ size }), className)}\n // TODO: An optional accessible description to be announced when the dialog is opened. At the moment we skip this.\n aria-describedby={undefined}\n >\n {(header || closeButton) && (\n <div className=\"row-start-1 relative\">\n {header}\n {closeButton}\n </div>\n )}\n <div className=\"row-start-2 min-h-0 overflow-hidden pr-xs\">{children}</div>\n {footer && <div className=\"row-start-3\">{footer}</div>}\n {overlay}\n </DialogPrimitive.Content>\n );\n }\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nexport { DialogContent };\n"],"names":["dialogContentVariants","cva","DialogContent","React","className","dismissible","size","header","footer","closeButton","overlay","children","props","ref","dismissibleProps","event","DialogPrimitive","cn","undefined"],"mappings":";;;AAIA,MAAMA,wBAAwBC,IAC1B;IACI;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,MAAM;YACF,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,MAAM;QACV;IACJ;IACA,iBAAiB;QACb,MAAM;IACV;AACJ;AAcJ,MAAMC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Dialog/components/DialogContent.js","sources":["../../../src/Dialog/components/DialogContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nconst dialogContentVariants = cva(\n [\n \"fixed left-[50%] top-[50%] border-none bg-neutral-base shadow-lg focus-visible:outline-none rounded-xl text-md text-neutral-strong\",\n \"translate-x-[-50%] translate-y-[-50%] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"focus:outline-none focus-visible:outline-none\",\n \"max-w-[calc(100vw-var(--spacing-lg))] max-h-[calc(100vh-var(--spacing-lg))] z-dialog\",\n \"grid grid-rows-[auto_1fr_auto] overflow-hidden\"\n ],\n {\n variants: {\n size: {\n sm: \"w-[384px]\",\n md: \"w-[520px]\",\n lg: \"w-[640px]\",\n xl: \"w-[800px]\",\n full: \"w-screen h-screen\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport interface DialogContentProps\n extends\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContentVariants> {\n dismissible?: boolean;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n closeButton?: React.ReactNode;\n overlay?: React.ReactNode;\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n { className, dismissible, size, header, footer, closeButton, overlay, children, ...props },\n ref\n ) => {\n const dismissibleProps = React.useMemo<\n Pick<DialogPrimitive.DialogContentProps, \"onInteractOutside\" | \"onEscapeKeyDown\">\n >(() => {\n if (dismissible === false) {\n return {\n onInteractOutside: event => event.preventDefault(),\n onEscapeKeyDown: event => event.preventDefault()\n };\n }\n\n return {};\n }, [dismissible]);\n\n return (\n <DialogPrimitive.Content\n {...dismissibleProps}\n {...props}\n ref={ref}\n className={cn(dialogContentVariants({ size }), className)}\n // TODO: An optional accessible description to be announced when the dialog is opened. At the moment we skip this.\n aria-describedby={undefined}\n >\n {(header || closeButton) && (\n <div className=\"row-start-1 relative\">\n {header}\n {closeButton}\n </div>\n )}\n <div className=\"row-start-2 min-h-0 overflow-hidden pr-xs\">{children}</div>\n {footer && <div className=\"row-start-3\">{footer}</div>}\n {overlay}\n </DialogPrimitive.Content>\n );\n }\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nexport { DialogContent };\n"],"names":["dialogContentVariants","cva","DialogContent","React","className","dismissible","size","header","footer","closeButton","overlay","children","props","ref","dismissibleProps","event","DialogPrimitive","cn","undefined"],"mappings":";;;AAIA,MAAMA,wBAAwBC,IAC1B;IACI;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,MAAM;YACF,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,MAAM;QACV;IACJ;IACA,iBAAiB;QACb,MAAM;IACV;AACJ;AAcJ,MAAMC,gBAAgB,WAAhBA,GAAgBC,wBAAAA,UAAgB,CAIlC,CACI,EAAEC,SAAS,EAAEC,WAAW,EAAEC,IAAI,EAAEC,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGC,OAAO,EAC1FC;IAEA,MAAMC,mBAAmBX,wBAAAA,OAAa,CAEpC;QACE,IAAIE,AAAgB,UAAhBA,aACA,OAAO;YACH,mBAAmBU,CAAAA,QAASA,MAAM,cAAc;YAChD,iBAAiBA,CAAAA,QAASA,MAAM,cAAc;QAClD;QAGJ,OAAO,CAAC;IACZ,GAAG;QAACV;KAAY;IAEhB,OAAO,WAAP,GACI,sCAACW,OAAAA,OAAuB;QACnB,GAAGF,gBAAgB;QACnB,GAAGF,KAAK;QACT,KAAKC;QACL,WAAWI,GAAGjB,sBAAsB;YAAEM;QAAK,IAAIF;QAE/C,oBAAkBc;OAEhBX,AAAAA,CAAAA,UAAUE,WAAU,mBAClB,sCAAC;QAAI,WAAU;OACVF,QACAE,cAAAA,WAAAA,GAGT,sCAAC;QAAI,WAAU;OAA6CE,WAC3DH,UAAU,WAAVA,GAAU,sCAAC;QAAI,WAAU;OAAeA,SACxCE;AAGb;AAGJR,cAAc,WAAW,GAAGc,OAAAA,OAAAA,CAAAA,WAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog/components/DialogOverlay.js","sources":["../../../src/Dialog/components/DialogOverlay.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nexport const DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n id={\"admin-ui.dialog-overlay\"}\n ref={ref}\n className={cn(\n \"fixed inset-0 bg-neutral-dark/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\n\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n"],"names":["DialogOverlay","React","className","props","ref","DialogPrimitive","cn"],"mappings":";;;AAIO,MAAMA,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Dialog/components/DialogOverlay.js","sources":["../../../src/Dialog/components/DialogOverlay.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nexport const DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n id={\"admin-ui.dialog-overlay\"}\n ref={ref}\n className={cn(\n \"fixed inset-0 bg-neutral-dark/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\n\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n"],"names":["DialogOverlay","React","className","props","ref","DialogPrimitive","cn"],"mappings":";;;AAIO,MAAMA,gBAAgB,WAAhBA,GAAgBC,wBAAAA,UAAgB,CAG3C,CAAC,EAAEC,SAAS,EAAE,GAAGC,OAAO,EAAEC,MAAAA,WAAAA,GACxB,sCAACC,OAAAA,OAAuB;QACpB,IAAI;QACJ,KAAKD;QACL,WAAWE,GACP,4JACAJ;QAEH,GAAGC,KAAK;;AAIjBH,cAAc,WAAW,GAAGK,OAAAA,OAAAA,CAAAA,WAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer/components/DrawerContent.js","sources":["../../../src/Drawer/components/DrawerContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nexport interface DrawerContentProps\n extends\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>,\n VariantProps<typeof drawerVariants> {\n width?: React.CSSProperties[\"width\"];\n modal?: boolean;\n}\n\nconst drawerVariants = cva(\n [\n \"fixed gap-4 bg-neutral-base text-md text-neutral-strong focus-visible:outline-none shadow-lg\",\n \"transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n \"max-w-full h-full z-drawer\"\n ],\n {\n variants: {\n size: {\n sm: \"w-[384px]\",\n md: \"w-[520px]\",\n lg: \"w-[640px]\",\n xl: \"w-[1024px]\"\n },\n side: {\n left: [\n \"inset-y-0 left-0\",\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\"\n ],\n right: [\n \"inset-y-0 right-0\",\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\"\n ]\n }\n },\n defaultVariants: {\n size: \"md\",\n side: \"right\"\n }\n }\n);\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ side, size, modal, width, className, style = {}, children, ...props }, ref) => {\n // When modal is set to false, we want to prevent the user from closing the drawer by clicking outside of it.\n // Only by clicking on \"X\" icon or by pressing the escape key should the drawer be closed.\n const modalProps = React.useMemo<\n Pick<DrawerPrimitive.DialogContentProps, \"onInteractOutside\">\n >(() => {\n if (modal === false) {\n return {\n onInteractOutside: event => event.preventDefault()\n };\n }\n\n return {};\n }, [modal]);\n\n return (\n <DrawerPrimitive.Content\n {...modalProps}\n {...props}\n ref={ref}\n className={cn(drawerVariants({ side, size }), className)}\n style={{ width, ...style }}\n // TODO: An optional accessible description to be announced when the dialog is opened. At the moment we skip this.\n aria-describedby={undefined}\n >\n <div className={\"flex flex-col justify-between h-full\"}>{children}</div>\n </DrawerPrimitive.Content>\n );\n});\n\nDrawerContent.displayName = DrawerPrimitive.Content.displayName;\n\nexport { DrawerContent };\n"],"names":["drawerVariants","cva","DrawerContent","React","side","size","modal","width","className","style","children","props","ref","modalProps","event","DrawerPrimitive","cn","undefined"],"mappings":";;;AAYA,MAAMA,iBAAiBC,IACnB;IACI;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,MAAM;YACF,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;QACR;QACA,MAAM;YACF,MAAM;gBACF;gBACA;aACH;YACD,OAAO;gBACH;gBACA;aACH;QACL;IACJ;IACA,iBAAiB;QACb,MAAM;QACN,MAAM;IACV;AACJ;AAGJ,MAAMC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Drawer/components/DrawerContent.js","sources":["../../../src/Drawer/components/DrawerContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\n\nexport interface DrawerContentProps\n extends\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>,\n VariantProps<typeof drawerVariants> {\n width?: React.CSSProperties[\"width\"];\n modal?: boolean;\n}\n\nconst drawerVariants = cva(\n [\n \"fixed gap-4 bg-neutral-base text-md text-neutral-strong focus-visible:outline-none shadow-lg\",\n \"transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n \"max-w-full h-full z-drawer\"\n ],\n {\n variants: {\n size: {\n sm: \"w-[384px]\",\n md: \"w-[520px]\",\n lg: \"w-[640px]\",\n xl: \"w-[1024px]\"\n },\n side: {\n left: [\n \"inset-y-0 left-0\",\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\"\n ],\n right: [\n \"inset-y-0 right-0\",\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\"\n ]\n }\n },\n defaultVariants: {\n size: \"md\",\n side: \"right\"\n }\n }\n);\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ side, size, modal, width, className, style = {}, children, ...props }, ref) => {\n // When modal is set to false, we want to prevent the user from closing the drawer by clicking outside of it.\n // Only by clicking on \"X\" icon or by pressing the escape key should the drawer be closed.\n const modalProps = React.useMemo<\n Pick<DrawerPrimitive.DialogContentProps, \"onInteractOutside\">\n >(() => {\n if (modal === false) {\n return {\n onInteractOutside: event => event.preventDefault()\n };\n }\n\n return {};\n }, [modal]);\n\n return (\n <DrawerPrimitive.Content\n {...modalProps}\n {...props}\n ref={ref}\n className={cn(drawerVariants({ side, size }), className)}\n style={{ width, ...style }}\n // TODO: An optional accessible description to be announced when the dialog is opened. At the moment we skip this.\n aria-describedby={undefined}\n >\n <div className={\"flex flex-col justify-between h-full\"}>{children}</div>\n </DrawerPrimitive.Content>\n );\n});\n\nDrawerContent.displayName = DrawerPrimitive.Content.displayName;\n\nexport { DrawerContent };\n"],"names":["drawerVariants","cva","DrawerContent","React","side","size","modal","width","className","style","children","props","ref","modalProps","event","DrawerPrimitive","cn","undefined"],"mappings":";;;AAYA,MAAMA,iBAAiBC,IACnB;IACI;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,MAAM;YACF,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;QACR;QACA,MAAM;YACF,MAAM;gBACF;gBACA;aACH;YACD,OAAO;gBACH;gBACA;aACH;QACL;IACJ;IACA,iBAAiB;QACb,MAAM;QACN,MAAM;IACV;AACJ;AAGJ,MAAMC,gBAAgB,WAAhBA,GAAgBC,wBAAAA,UAAgB,CAGpC,CAAC,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,CAAC,CAAC,EAAEC,QAAQ,EAAE,GAAGC,OAAO,EAAEC;IAGxE,MAAMC,aAAaV,wBAAAA,OAAa,CAE9B;QACE,IAAIG,AAAU,UAAVA,OACA,OAAO;YACH,mBAAmBQ,CAAAA,QAASA,MAAM,cAAc;QACpD;QAGJ,OAAO,CAAC;IACZ,GAAG;QAACR;KAAM;IAEV,OAAO,WAAP,GACI,sCAACS,OAAAA,OAAuB;QACnB,GAAGF,UAAU;QACb,GAAGF,KAAK;QACT,KAAKC;QACL,WAAWI,GAAGhB,eAAe;YAAEI;YAAMC;QAAK,IAAIG;QAC9C,OAAO;YAAED;YAAO,GAAGE,KAAK;QAAC;QAEzB,oBAAkBQ;qBAElB,sCAAC;QAAI,WAAW;OAAyCP;AAGrE;AAEAR,cAAc,WAAW,GAAGa,OAAAA,OAAAA,CAAAA,WAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer/components/DrawerOverlay.js","sources":["../../../src/Drawer/components/DrawerOverlay.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nexport const DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 bg-neutral-dark/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-drawer-backdrop\",\n className\n )}\n {...props}\n />\n));\n\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n"],"names":["DrawerOverlay","React","className","props","ref","DrawerPrimitive","cn"],"mappings":";;;AAIO,MAAMA,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Drawer/components/DrawerOverlay.js","sources":["../../../src/Drawer/components/DrawerOverlay.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DrawerPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nexport const DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 bg-neutral-dark/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-drawer-backdrop\",\n className\n )}\n {...props}\n />\n));\n\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n"],"names":["DrawerOverlay","React","className","props","ref","DrawerPrimitive","cn"],"mappings":";;;AAIO,MAAMA,gBAAgB,WAAhBA,GAAgBC,wBAAAA,UAAgB,CAG3C,CAAC,EAAEC,SAAS,EAAE,GAAGC,OAAO,EAAEC,MAAAA,WAAAA,GACxB,sCAACC,OAAAA,OAAuB;QACpB,KAAKD;QACL,WAAWE,GACP,8KACAJ;QAEH,GAAGC,KAAK;;AAIjBH,cAAc,WAAW,GAAGK,OAAAA,OAAAA,CAAAA,WAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/DropdownMenu.js","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DropdownMenuRoot } from \"./components/DropdownMenuRoot.js\";\nimport { DropdownMenuTrigger } from \"./components/DropdownMenuTrigger.js\";\nimport { DropdownMenuContent } from \"./components/DropdownMenuContent.js\";\nimport { DropdownMenuSeparator } from \"./components/DropdownMenuSeparator.js\";\nimport { DropdownMenuItem, type DropdownMenuItemProps } from \"./components/DropdownMenuItem.js\";\nimport { DropdownMenuLink, type DropdownMenuLinkProps } from \"./components/DropdownMenuLink.js\";\nimport { DropdownMenuCheckboxItem } from \"./components/DropdownMenuCheckboxItem.js\";\nimport { DropdownMenuLabel } from \"./components/DropdownMenuLabel.js\";\nimport { DropdownMenuGroup } from \"./components/DropdownMenuGroup.js\";\nimport { DropdownMenuPortal } from \"./components/DropdownMenuPortal.js\";\n\ninterface DropdownMenuProps\n extends\n React.ComponentPropsWithoutRef<typeof DropdownMenuRoot>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuContent> {\n trigger?: React.ReactNode;\n children: React.ReactNode;\n}\n\nconst DropdownMenuBase = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuRoot>,\n DropdownMenuProps\n>((props, ref) => {\n const { rootProps, triggerProps, contentProps } = React.useMemo(() => {\n const {\n // Root props.\n defaultOpen,\n open,\n onOpenChange,\n\n dir,\n\n // Trigger props.\n trigger,\n\n // Content props.\n ...rest\n } = props;\n\n return {\n rootProps: {\n defaultOpen,\n open,\n onOpenChange,\n dir\n },\n triggerProps: {\n // Temporary fix. We need this because `ref` doesn't get passed to components\n // that are decorated with `makeDecoratable`. This will be fixed in the future.\n children: <div className={\"inline-block leading-none\"}>{trigger}</div>\n },\n contentProps: rest\n };\n }, [props]);\n\n return (\n <DropdownMenuRoot {...rootProps}>\n {triggerProps.children && <DropdownMenuTrigger {...triggerProps} asChild />}\n <DropdownMenuPortal>\n <DropdownMenuContent {...contentProps} ref={ref} />\n </DropdownMenuPortal>\n </DropdownMenuRoot>\n );\n});\n\nDropdownMenuBase.displayName = \"DropdownMenu\";\n\nconst DecoratableDropdownMenu = makeDecoratable(\"DropdownMenu\", DropdownMenuBase);\n\nconst DropdownMenu = withStaticProps(DecoratableDropdownMenu, {\n Separator: DropdownMenuSeparator,\n Label: DropdownMenuLabel,\n Group: DropdownMenuGroup,\n Item: DropdownMenuItem,\n Link: DropdownMenuLink,\n CheckboxItem: DropdownMenuCheckboxItem\n});\n\nexport { DropdownMenu, type DropdownMenuItemProps, type DropdownMenuLinkProps };\n"],"names":["DropdownMenuBase","React","props","ref","rootProps","triggerProps","contentProps","defaultOpen","open","onOpenChange","dir","trigger","rest","DropdownMenuRoot","DropdownMenuTrigger","DropdownMenuPortal","DropdownMenuContent","DecoratableDropdownMenu","makeDecoratable","DropdownMenu","withStaticProps","DropdownMenuSeparator","DropdownMenuLabel","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLink","DropdownMenuCheckboxItem"],"mappings":";;;;;;;;;;;;AAqBA,MAAMA,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu/DropdownMenu.js","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { DropdownMenuRoot } from \"./components/DropdownMenuRoot.js\";\nimport { DropdownMenuTrigger } from \"./components/DropdownMenuTrigger.js\";\nimport { DropdownMenuContent } from \"./components/DropdownMenuContent.js\";\nimport { DropdownMenuSeparator } from \"./components/DropdownMenuSeparator.js\";\nimport { DropdownMenuItem, type DropdownMenuItemProps } from \"./components/DropdownMenuItem.js\";\nimport { DropdownMenuLink, type DropdownMenuLinkProps } from \"./components/DropdownMenuLink.js\";\nimport { DropdownMenuCheckboxItem } from \"./components/DropdownMenuCheckboxItem.js\";\nimport { DropdownMenuLabel } from \"./components/DropdownMenuLabel.js\";\nimport { DropdownMenuGroup } from \"./components/DropdownMenuGroup.js\";\nimport { DropdownMenuPortal } from \"./components/DropdownMenuPortal.js\";\n\ninterface DropdownMenuProps\n extends\n React.ComponentPropsWithoutRef<typeof DropdownMenuRoot>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuContent> {\n trigger?: React.ReactNode;\n children: React.ReactNode;\n}\n\nconst DropdownMenuBase = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuRoot>,\n DropdownMenuProps\n>((props, ref) => {\n const { rootProps, triggerProps, contentProps } = React.useMemo(() => {\n const {\n // Root props.\n defaultOpen,\n open,\n onOpenChange,\n\n dir,\n\n // Trigger props.\n trigger,\n\n // Content props.\n ...rest\n } = props;\n\n return {\n rootProps: {\n defaultOpen,\n open,\n onOpenChange,\n dir\n },\n triggerProps: {\n // Temporary fix. We need this because `ref` doesn't get passed to components\n // that are decorated with `makeDecoratable`. This will be fixed in the future.\n children: <div className={\"inline-block leading-none\"}>{trigger}</div>\n },\n contentProps: rest\n };\n }, [props]);\n\n return (\n <DropdownMenuRoot {...rootProps}>\n {triggerProps.children && <DropdownMenuTrigger {...triggerProps} asChild />}\n <DropdownMenuPortal>\n <DropdownMenuContent {...contentProps} ref={ref} />\n </DropdownMenuPortal>\n </DropdownMenuRoot>\n );\n});\n\nDropdownMenuBase.displayName = \"DropdownMenu\";\n\nconst DecoratableDropdownMenu = makeDecoratable(\"DropdownMenu\", DropdownMenuBase);\n\nconst DropdownMenu = withStaticProps(DecoratableDropdownMenu, {\n Separator: DropdownMenuSeparator,\n Label: DropdownMenuLabel,\n Group: DropdownMenuGroup,\n Item: DropdownMenuItem,\n Link: DropdownMenuLink,\n CheckboxItem: DropdownMenuCheckboxItem\n});\n\nexport { DropdownMenu, type DropdownMenuItemProps, type DropdownMenuLinkProps };\n"],"names":["DropdownMenuBase","React","props","ref","rootProps","triggerProps","contentProps","defaultOpen","open","onOpenChange","dir","trigger","rest","DropdownMenuRoot","DropdownMenuTrigger","DropdownMenuPortal","DropdownMenuContent","DecoratableDropdownMenu","makeDecoratable","DropdownMenu","withStaticProps","DropdownMenuSeparator","DropdownMenuLabel","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLink","DropdownMenuCheckboxItem"],"mappings":";;;;;;;;;;;;AAqBA,MAAMA,mBAAmB,WAAnBA,GAAmBC,wBAAAA,UAAgB,CAGvC,CAACC,OAAOC;IACN,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,YAAY,EAAE,GAAGL,wBAAAA,OAAa,CAAC;QAC5D,MAAM,EAEFM,WAAW,EACXC,IAAI,EACJC,YAAY,EAEZC,GAAG,EAGHC,OAAO,EAGP,GAAGC,MACN,GAAGV;QAEJ,OAAO;YACH,WAAW;gBACPK;gBACAC;gBACAC;gBACAC;YACJ;YACA,cAAc;gBAGV,UAAU,WAAV,GAAU,sCAAC;oBAAI,WAAW;mBAA8BC;YAC5D;YACA,cAAcC;QAClB;IACJ,GAAG;QAACV;KAAM;IAEV,OAAO,WAAP,GACI,sCAACW,kBAAqBT,WACjBC,aAAa,QAAQ,IAAI,WAAJ,GAAI,sCAACS,qBAAmBA;QAAE,GAAGT,YAAY;QAAE;sBACjE,sCAACU,oBAAkBA,MAAAA,WAAAA,GACf,sCAACC,qBAAmBA;QAAE,GAAGV,YAAY;QAAE,KAAKH;;AAI5D;AAEAH,iBAAiB,WAAW,GAAG;AAE/B,MAAMiB,0BAA0BC,gBAAgB,gBAAgBlB;AAEhE,MAAMmB,eAAeC,gBAAgBH,yBAAyB;IAC1D,WAAWI;IACX,OAAOC;IACP,OAAOC;IACP,MAAMC;IACN,MAAMC;IACN,cAAcC;AAClB"}
|
|
@@ -22,7 +22,7 @@ const meta = {
|
|
|
22
22
|
argTypes: {}
|
|
23
23
|
};
|
|
24
24
|
const DropdownMenu_stories = meta;
|
|
25
|
-
const { Label
|
|
25
|
+
const { Label, Separator, Group, Item, Link, CheckboxItem } = DropdownMenu;
|
|
26
26
|
const Default = {
|
|
27
27
|
args: {
|
|
28
28
|
trigger: /*#__PURE__*/ react.createElement(Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/DropdownMenu.stories.js","sources":["../../src/DropdownMenu/DropdownMenu.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { DropdownMenu } from \"./DropdownMenu.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { ReactComponent as Cloud } from \"@webiny/icons/cloud.svg\";\nimport { ReactComponent as LogOut } from \"@webiny/icons/logout.svg\";\nimport { ReactComponent as LifeBuoy } from \"@webiny/icons/safety_check.svg\";\nimport { ReactComponent as CreditCard } from \"@webiny/icons/credit_score.svg\";\nimport { ReactComponent as Plus } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusCircle } from \"@webiny/icons/add_circle.svg\";\nimport { ReactComponent as Settings } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as Users } from \"@webiny/icons/people.svg\";\nimport { ReactComponent as UserPlus } from \"@webiny/icons/person_add.svg\";\nimport { ReactComponent as User } from \"@webiny/icons/person.svg\";\nimport { ReactComponent as Keyboard } from \"@webiny/icons/keyboard.svg\";\nimport { ReactComponent as Mail } from \"@webiny/icons/mail.svg\";\nimport { ReactComponent as MessageSquare } from \"@webiny/icons/chat_bubble.svg\";\nimport { ReactComponent as LinkIcon } from \"@webiny/icons/link.svg\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DropdownMenu> = {\n title: \"Components/Dropdown Menu\",\n component: DropdownMenu,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof DropdownMenu>;\n\nconst { Label, Separator, Group, Item, Link, CheckboxItem } = DropdownMenu;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2 (target: _blank)\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n target={\"_blank\"}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SimpleMenuWithIcons: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithSubMenus: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon element={<User />} label={\"Profile\"} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon label={\"Team\"} element={<Users />} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon label={\"Invite user\"} element={<UserPlus />} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nconst TARGET_LEVELS = [\n {\n id: \"viewer\",\n label: \"Viewer\",\n description: \"Can view content, but not modify it\"\n },\n {\n id: \"editor\",\n label: \"Editor\",\n description: \"Can view and modify content\"\n },\n {\n id: \"owner\",\n label: \"Owner\",\n description: \"Can edit and manage content permissions\"\n }\n];\n\nexport const WithCheckboxItems: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n {TARGET_LEVELS.map(level => (\n <CheckboxItem\n key={level.id}\n checked={level.id === \"viewer\"}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n console.log(\"Selected level:\", level.id);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item text={\"Remove access\"} />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithOnOpenChange: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n onOpenChange: opened => {\n console.log(`Menu is ${opened ? \"opened\" : \"closed\"}.`);\n },\n children: (\n <>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const Documentation: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {\n trigger: {\n description:\n \"The trigger element that opens the menu. Please refer to the example code for details.\"\n },\n children: {\n description: \"The content of the menu. Please refer to the example code for details.\"\n }\n }\n};\n"],"names":["meta","DropdownMenu","Label","Separator","Group","Item","Link","CheckboxItem","Default","Button","User","CreditCard","Settings","Keyboard","Users","UserPlus","Mail","MessageSquare","PlusCircle","Plus","LifeBuoy","Cloud","LogOut","LinkIcon","SimpleMenuWithIcons","WithSubMenus","TARGET_LEVELS","WithCheckboxItems","level","Text","console","WithOnOpenChange","opened","Documentation"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAMA,OAAkC;IACpC,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,6BAAeD;AAIf,MAAM,EAAEE,OAAAA,KAAK,EAAEC,WAAAA,SAAS,EAAEC,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,cAAAA,YAAY,EAAE,GAAGN;AAEv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.stories.js","sources":["../../src/DropdownMenu/DropdownMenu.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { DropdownMenu } from \"./DropdownMenu.js\";\nimport { Button } from \"~/Button/index.js\";\nimport { ReactComponent as Cloud } from \"@webiny/icons/cloud.svg\";\nimport { ReactComponent as LogOut } from \"@webiny/icons/logout.svg\";\nimport { ReactComponent as LifeBuoy } from \"@webiny/icons/safety_check.svg\";\nimport { ReactComponent as CreditCard } from \"@webiny/icons/credit_score.svg\";\nimport { ReactComponent as Plus } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as PlusCircle } from \"@webiny/icons/add_circle.svg\";\nimport { ReactComponent as Settings } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as Users } from \"@webiny/icons/people.svg\";\nimport { ReactComponent as UserPlus } from \"@webiny/icons/person_add.svg\";\nimport { ReactComponent as User } from \"@webiny/icons/person.svg\";\nimport { ReactComponent as Keyboard } from \"@webiny/icons/keyboard.svg\";\nimport { ReactComponent as Mail } from \"@webiny/icons/mail.svg\";\nimport { ReactComponent as MessageSquare } from \"@webiny/icons/chat_bubble.svg\";\nimport { ReactComponent as LinkIcon } from \"@webiny/icons/link.svg\";\nimport { Text } from \"~/Text/index.js\";\n\nconst meta: Meta<typeof DropdownMenu> = {\n title: \"Components/Dropdown Menu\",\n component: DropdownMenu,\n argTypes: {}\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof DropdownMenu>;\n\nconst { Label, Separator, Group, Item, Link, CheckboxItem } = DropdownMenu;\n\nexport const Default: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2 (target: _blank)\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n target={\"_blank\"}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const SimpleMenuWithIcons: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithSubMenus: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon element={<User />} label={\"Profile\"} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon label={\"Billing\"} element={<CreditCard />} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon label={\"Settings\"} element={<Settings />} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon label={\"Keyboard shortcuts\"} element={<Keyboard />} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon label={\"Team\"} element={<Users />} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon label={\"Invite user\"} element={<UserPlus />} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n >\n <Item\n icon={<Item.Icon label={\"Email\"} element={<Mail />} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon label={\"Message\"} element={<MessageSquare />} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nconst TARGET_LEVELS = [\n {\n id: \"viewer\",\n label: \"Viewer\",\n description: \"Can view content, but not modify it\"\n },\n {\n id: \"editor\",\n label: \"Editor\",\n description: \"Can view and modify content\"\n },\n {\n id: \"owner\",\n label: \"Owner\",\n description: \"Can edit and manage content permissions\"\n }\n];\n\nexport const WithCheckboxItems: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n {TARGET_LEVELS.map(level => (\n <CheckboxItem\n key={level.id}\n checked={level.id === \"viewer\"}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n console.log(\"Selected level:\", level.id);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item text={\"Remove access\"} />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const WithOnOpenChange: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n onOpenChange: opened => {\n console.log(`Menu is ${opened ? \"opened\" : \"closed\"}.`);\n },\n children: (\n <>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </>\n )\n },\n argTypes: {}\n};\n\nexport const Documentation: Story = {\n args: {\n trigger: <Button variant=\"primary\" text={\"Open\"} />,\n children: (\n <>\n <Label text={\"My Account\"} />\n <Item icon={<Item.Icon label={\"Profile\"} element={<User />} />} text={\"Profile\"} />\n <Group>\n <Item\n icon={<Item.Icon element={<CreditCard />} label={\"Billing\"} />}\n text={\"Billing\"}\n />\n <Item\n icon={<Item.Icon element={<Settings />} label={\"Settings\"} />}\n text={\"Settings\"}\n />\n <Item\n icon={<Item.Icon element={<Keyboard />} label={\"Keyboard shortcuts\"} />}\n text={\"Keyboard shortcuts\"}\n />\n </Group>\n <Separator />\n <Group>\n <Item icon={<Item.Icon element={<Users />} label={\"Team\"} />} text={\"Team\"} />\n <Item\n icon={<Item.Icon element={<UserPlus />} label={\"Invite users\"} />}\n text={\"Invite users\"}\n >\n <Item\n icon={<Item.Icon element={<Mail />} label={\"Email\"} />}\n text={\"Email\"}\n />\n <Item\n icon={<Item.Icon element={<MessageSquare />} label={\"Message\"} />}\n text={\"Message\"}\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"More...\"} element={<PlusCircle />} />}\n text={\"More...\"}\n />\n </Item>\n <Item\n icon={<Item.Icon label={\"New Team\"} element={<Plus />} />}\n text={\"New Team\"}\n />\n </Group>\n <Separator />\n <Item\n icon={<Item.Icon label={\"Support\"} element={<LifeBuoy />} />}\n text={\"Support\"}\n />\n <Item\n icon={<Item.Icon label={\"API\"} element={<Cloud />} />}\n text={\"API\"}\n disabled\n />\n <Separator />\n <Item\n icon={<Item.Icon label={\"Log out\"} element={<LogOut />} />}\n text={\"Log out\"}\n />\n <Separator />\n <Label text={\"Links\"} />\n <Link\n text={\"Link 1\"}\n to={\"#link-1\"}\n icon={<Link.Icon label=\"Link 1\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 2\"}\n to={\"#link-2\"}\n icon={<Link.Icon label=\"Link 2\" element={<LinkIcon />} />}\n />\n <Link\n text={\"Link 3\"}\n to={\"#link-3\"}\n icon={<Link.Icon label=\"Link 3\" element={<LinkIcon />} />}\n />\n </>\n )\n },\n argTypes: {\n trigger: {\n description:\n \"The trigger element that opens the menu. Please refer to the example code for details.\"\n },\n children: {\n description: \"The content of the menu. Please refer to the example code for details.\"\n }\n }\n};\n"],"names":["meta","DropdownMenu","Label","Separator","Group","Item","Link","CheckboxItem","Default","Button","User","CreditCard","Settings","Keyboard","Users","UserPlus","Mail","MessageSquare","PlusCircle","Plus","LifeBuoy","Cloud","LogOut","LinkIcon","SimpleMenuWithIcons","WithSubMenus","TARGET_LEVELS","WithCheckboxItems","level","Text","console","WithOnOpenChange","opened","Documentation"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAMA,OAAkC;IACpC,OAAO;IACP,WAAWC;IACX,UAAU,CAAC;AACf;AAEA,6BAAeD;AAIf,MAAM,EAAEE,KAAK,EAAEC,SAAS,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAEC,YAAY,EAAE,GAAGN;AAEvD,MAAMO,UAAiB;IAC1B,MAAM;QACF,SAAS,WAAT,GAAS,oBAACC,QAAMA;YAAC,SAAQ;YAAU,MAAM;;QACzC,UAAU,WAAV,GACI,wDACI,oBAACP,OAAAA;YAAM,MAAM;0BACb,oBAACG,MAAAA;YAAK,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAO;gBAAW,uBAAS,oBAACK,2BAAIA;;YAAS,MAAM;0BACtE,oBAACN,OAAAA,MAAAA,WAAAA,GACG,oBAACC,MAAAA;YACG,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACM,iCAAUA;gBAAK,OAAO;;YACjD,MAAM;0BAEV,oBAACN,MAAAA;YACG,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACO,6BAAQA;gBAAK,OAAO;;YAC/C,MAAM;0BAEV,oBAACP,MAAAA;YACG,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACQ,6BAAQA;gBAAK,OAAO;;YAC/C,MAAM;2BAGd,oBAACV,WAAAA,OAAAA,WAAAA,GACD,oBAACC,OAAAA,MAAAA,WAAAA,GACG,oBAACC,MAAAA;YAAK,oBAAM,oBAACA,KAAK,IAAI;gBAAC,uBAAS,oBAACS,2BAAKA;gBAAK,OAAO;;YAAY,MAAM;0BACpE,oBAACT,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AAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAAA;YACG,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;0BAEtD,oBAACjB,MAAAA;YACG,MAAM;YACN,IAAI;YACJ,oBAAM,oBAACA,KAAK,IAAI;gBAAC,OAAM;gBAAS,uBAAS,oBAACiB,yBAAQA;;;IAIlE;IACA,UAAU;QACN,SAAS;YACL,aACI;QACR;QACA,UAAU;YACN,aAAa;QACjB;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuCheckboxItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuCheckboxItem.tsx"],"sourcesContent":["import React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { ReactComponent as Check } from \"@webiny/icons/check.svg\";\n\nexport interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n> {\n text?: React.ReactNode;\n}\n\nconst DropdownMenuCheckboxItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuItemProps\n>(({ className, text, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"group relative cursor-default select-none items-center rounded-sm px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n className\n )}\n checked={checked}\n {...props}\n >\n <div\n className={cn(\n \"flex min-size-md px-sm py-xs-plus gap-sm-extra items-center text-md rounded-sm group-focus:bg-neutral-dimmed transition-colors\",\n { \"[&_svg]:fill-neutral-disabled\": props.disabled }\n )}\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <Check />\n </DropdownMenuPrimitive.ItemIndicator>\n {!checked && <svg aria-hidden=\"true\" />}\n <span>{text}</span>\n </div>\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItemBase.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nexport const DropdownMenuCheckboxItem = makeDecoratable(\n \"DropdownMenuCheckboxItem\",\n DropdownMenuCheckboxItemBase\n);\n"],"names":["DropdownMenuCheckboxItemBase","React","className","text","checked","props","ref","DropdownMenuPrimitive","cn","Check","DropdownMenuCheckboxItem","makeDecoratable"],"mappings":";;;;AAWA,MAAMA,+BAA+B,
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuCheckboxItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuCheckboxItem.tsx"],"sourcesContent":["import React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { ReactComponent as Check } from \"@webiny/icons/check.svg\";\n\nexport interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n> {\n text?: React.ReactNode;\n}\n\nconst DropdownMenuCheckboxItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuItemProps\n>(({ className, text, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"group relative cursor-default select-none items-center rounded-sm px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n className\n )}\n checked={checked}\n {...props}\n >\n <div\n className={cn(\n \"flex min-size-md px-sm py-xs-plus gap-sm-extra items-center text-md rounded-sm group-focus:bg-neutral-dimmed transition-colors\",\n { \"[&_svg]:fill-neutral-disabled\": props.disabled }\n )}\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <Check />\n </DropdownMenuPrimitive.ItemIndicator>\n {!checked && <svg aria-hidden=\"true\" />}\n <span>{text}</span>\n </div>\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItemBase.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nexport const DropdownMenuCheckboxItem = makeDecoratable(\n \"DropdownMenuCheckboxItem\",\n DropdownMenuCheckboxItemBase\n);\n"],"names":["DropdownMenuCheckboxItemBase","React","className","text","checked","props","ref","DropdownMenuPrimitive","cn","Check","DropdownMenuCheckboxItem","makeDecoratable"],"mappings":";;;;AAWA,MAAMA,+BAA+B,WAA/BA,GAA+BC,MAAAA,UAAgB,CAGnD,CAAC,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC,OAAO,EAAEC,MAAAA,WAAAA,GACvC,oBAACC,aAAAA,YAAkC;QAC/B,KAAKD;QACL,WAAWE,GACP,+GACA,6FACA,yEACAN;QAEJ,SAASE;QACR,GAAGC,KAAK;qBAET,oBAAC;QACG,WAAWG,GACP,kIACA;YAAE,iCAAiCH,MAAM,QAAQ;QAAC;qBAGtD,oBAACE,aAAAA,aAAmC,sBAChC,oBAACE,gBAAKA,QAET,CAACL,WAAW,WAAXA,GAAW,oBAAC;QAAI,eAAY;sBAC9B,oBAAC,cAAMD;AAKnBH,6BAA6B,WAAW,GAAGO,aAAAA,YAAAA,CAAAA,WAA8C;AAElF,MAAMG,2BAA2BC,gBACpC,4BACAX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuContent.js","sources":["../../../src/DropdownMenu/components/DropdownMenuContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, collisionPadding = 8, ...props }, ref) => (\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n \"flex flex-col z-popover min-w-32 overflow-hidden rounded-md gap-xxs bg-white py-xs-plus text-neutral-primary shadow-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 border-sm border-solid border-neutral-muted\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nexport { DropdownMenuContent };\n"],"names":["DropdownMenuContent","React","className","sideOffset","collisionPadding","props","ref","DropdownMenuPrimitive","cn"],"mappings":";;;AAIA,MAAMA,sBAAsB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuContent.js","sources":["../../../src/DropdownMenu/components/DropdownMenuContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, collisionPadding = 8, ...props }, ref) => (\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n \"flex flex-col z-popover min-w-32 overflow-hidden rounded-md gap-xxs bg-white py-xs-plus text-neutral-primary shadow-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 border-sm border-solid border-neutral-muted\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nexport { DropdownMenuContent };\n"],"names":["DropdownMenuContent","React","className","sideOffset","collisionPadding","props","ref","DropdownMenuPrimitive","cn"],"mappings":";;;AAIA,MAAMA,sBAAsB,WAAtBA,GAAsBC,wBAAAA,UAAgB,CAG1C,CAAC,EAAEC,SAAS,EAAEC,aAAa,CAAC,EAAEC,mBAAmB,CAAC,EAAE,GAAGC,OAAO,EAAEC,MAAAA,WAAAA,GAC9D,sCAACC,aAAAA,OAA6B;QAC1B,KAAKD;QACL,YAAYH;QACZ,kBAAkBC;QAClB,WAAWI,GACP,yfACAN;QAEH,GAAGG,KAAK;;AAGjBL,oBAAoB,WAAW,GAAGO,aAAAA,OAAAA,CAAAA,WAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\nimport { DropdownMenuSubRoot } from \"./DropdownMenuSubRoot.js\";\nimport { DropdownMenuSubTrigger } from \"./DropdownMenuSubTrigger.js\";\nimport { DropdownMenuPortal } from \"./DropdownMenuPortal.js\";\nimport { DropdownMenuSubContent } from \"./DropdownMenuSubContent.js\";\nimport { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from \"./DropdownMenuItemIcon.js\";\nimport { LinkComponentProps, useAdminUi } from \"~/index.js\";\n\ninterface DropdownMenuItemBaseProps {\n icon?: React.ReactNode;\n readOnly?: boolean;\n variant?: \"destructive\";\n text?: React.ReactNode;\n disabled?: boolean;\n onClick?: React.MouseEventHandler;\n /**\n * Keep the menu open after selecting this item. Useful for items that toggle a value\n * (e.g. a checkbox), where the user expects to make multiple selections in one session.\n */\n preventClose?: boolean;\n}\n\ntype DropdownMenuItemButtonProps = (DropdownMenuItemBaseProps &\n React.HTMLAttributes<HTMLDivElement>) & { to?: never };\ntype DropdownMenuItemLinkProps = DropdownMenuItemBaseProps & LinkComponentProps;\n\ntype DropdownMenuItemProps = DropdownMenuItemButtonProps | DropdownMenuItemLinkProps;\n\nconst variants = cva(\n [\n \"group relative cursor-default select-none items-center rounded-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n \"[&_a]:no-underline! [&_a]:text-neutral-primary!\"\n ],\n {\n variants: {\n variant: {\n destructive: [\"text-destructive-primary!\", \"[&_svg]:fill-destructive\"]\n },\n readOnly: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n readOnly: false\n }\n }\n);\n\nconst DropdownMenuItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(\n (\n {\n className,\n icon,\n text,\n readOnly,\n variant,\n disabled,\n onClick,\n preventClose,\n children,\n ...linkProps\n },\n ref\n ) => {\n const { linkComponent: LinkComponent } = useAdminUi();\n\n if (children) {\n return (\n <DropdownMenuSubRoot>\n <DropdownMenuSubTrigger>\n {icon}\n <span>{text}</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>{children}</DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSubRoot>\n );\n }\n const sharedProps = {\n className: cn(\n \"flex px-sm py-xs-plus gap-sm-extra items-center text-md rounded-sm transition-colors group-focus:bg-neutral-dimmed\",\n {\n \"[&_svg]:fill-neutral-disabled!\": disabled\n }\n )\n };\n\n const content = linkProps.to ? (\n <LinkComponent {...sharedProps} {...linkProps}>\n {icon}\n <span>{text}</span>\n </LinkComponent>\n ) : (\n <div {...sharedProps} onClick={onClick}>\n {icon}\n <span>{text}</span>\n </div>\n );\n\n return (\n <DropdownMenuPrimitive.Item\n disabled={disabled}\n ref={ref}\n className={cn(variants({ readOnly, variant }), className)}\n onSelect={preventClose ? event => event.preventDefault() : undefined}\n >\n {content}\n </DropdownMenuPrimitive.Item>\n );\n }\n);\n\nDropdownMenuItemBase.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DecoratableDropdownMenuItem = makeDecoratable(\"DropdownMenuItem\", DropdownMenuItemBase);\n\nconst DropdownMenuItem = Object.assign(DecoratableDropdownMenuItem, {\n Icon: DropdownMenuItemIcon\n});\n\nexport {\n DropdownMenuItem,\n type DropdownMenuItemProps,\n type DropdownMenuItemButtonProps,\n type DropdownMenuItemLinkProps,\n type DropdownMenuItemIconProps\n};\n"],"names":["variants","cva","DropdownMenuItemBase","React","className","icon","text","readOnly","variant","disabled","onClick","preventClose","children","linkProps","ref","LinkComponent","useAdminUi","DropdownMenuSubRoot","DropdownMenuSubTrigger","DropdownMenuPortal","DropdownMenuSubContent","sharedProps","cn","content","DropdownMenuPrimitive","event","undefined","DecoratableDropdownMenuItem","makeDecoratable","DropdownMenuItem","Object","DropdownMenuItemIcon"],"mappings":";;;;;;;;;AA8BA,MAAMA,WAAWC,IACb;IACI;IACA;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YACL,aAAa;gBAAC;gBAA6B;aAA2B;QAC1E;QACA,UAAU;YACN,MAAM;QACV;IACJ;IACA,iBAAiB;QACb,UAAU;IACd;AACJ;AAGJ,MAAMC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuItem.js","sources":["../../../src/DropdownMenu/components/DropdownMenuItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, cva, makeDecoratable } from \"~/utils.js\";\nimport { DropdownMenuSubRoot } from \"./DropdownMenuSubRoot.js\";\nimport { DropdownMenuSubTrigger } from \"./DropdownMenuSubTrigger.js\";\nimport { DropdownMenuPortal } from \"./DropdownMenuPortal.js\";\nimport { DropdownMenuSubContent } from \"./DropdownMenuSubContent.js\";\nimport { DropdownMenuItemIcon, type DropdownMenuItemIconProps } from \"./DropdownMenuItemIcon.js\";\nimport { LinkComponentProps, useAdminUi } from \"~/index.js\";\n\ninterface DropdownMenuItemBaseProps {\n icon?: React.ReactNode;\n readOnly?: boolean;\n variant?: \"destructive\";\n text?: React.ReactNode;\n disabled?: boolean;\n onClick?: React.MouseEventHandler;\n /**\n * Keep the menu open after selecting this item. Useful for items that toggle a value\n * (e.g. a checkbox), where the user expects to make multiple selections in one session.\n */\n preventClose?: boolean;\n}\n\ntype DropdownMenuItemButtonProps = (DropdownMenuItemBaseProps &\n React.HTMLAttributes<HTMLDivElement>) & { to?: never };\ntype DropdownMenuItemLinkProps = DropdownMenuItemBaseProps & LinkComponentProps;\n\ntype DropdownMenuItemProps = DropdownMenuItemButtonProps | DropdownMenuItemLinkProps;\n\nconst variants = cva(\n [\n \"group relative cursor-default select-none items-center rounded-sm\",\n \"text-md text-neutral-primary no-underline!\",\n \"px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n \"[&_a]:no-underline! [&_a]:text-neutral-primary!\"\n ],\n {\n variants: {\n variant: {\n destructive: [\"text-destructive-primary!\", \"[&_svg]:fill-destructive\"]\n },\n readOnly: {\n true: \"pointer-events-none\"\n }\n },\n defaultVariants: {\n readOnly: false\n }\n }\n);\n\nconst DropdownMenuItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(\n (\n {\n className,\n icon,\n text,\n readOnly,\n variant,\n disabled,\n onClick,\n preventClose,\n children,\n ...linkProps\n },\n ref\n ) => {\n const { linkComponent: LinkComponent } = useAdminUi();\n\n if (children) {\n return (\n <DropdownMenuSubRoot>\n <DropdownMenuSubTrigger>\n {icon}\n <span>{text}</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>{children}</DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSubRoot>\n );\n }\n const sharedProps = {\n className: cn(\n \"flex px-sm py-xs-plus gap-sm-extra items-center text-md rounded-sm transition-colors group-focus:bg-neutral-dimmed\",\n {\n \"[&_svg]:fill-neutral-disabled!\": disabled\n }\n )\n };\n\n const content = linkProps.to ? (\n <LinkComponent {...sharedProps} {...linkProps}>\n {icon}\n <span>{text}</span>\n </LinkComponent>\n ) : (\n <div {...sharedProps} onClick={onClick}>\n {icon}\n <span>{text}</span>\n </div>\n );\n\n return (\n <DropdownMenuPrimitive.Item\n disabled={disabled}\n ref={ref}\n className={cn(variants({ readOnly, variant }), className)}\n onSelect={preventClose ? event => event.preventDefault() : undefined}\n >\n {content}\n </DropdownMenuPrimitive.Item>\n );\n }\n);\n\nDropdownMenuItemBase.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DecoratableDropdownMenuItem = makeDecoratable(\"DropdownMenuItem\", DropdownMenuItemBase);\n\nconst DropdownMenuItem = Object.assign(DecoratableDropdownMenuItem, {\n Icon: DropdownMenuItemIcon\n});\n\nexport {\n DropdownMenuItem,\n type DropdownMenuItemProps,\n type DropdownMenuItemButtonProps,\n type DropdownMenuItemLinkProps,\n type DropdownMenuItemIconProps\n};\n"],"names":["variants","cva","DropdownMenuItemBase","React","className","icon","text","readOnly","variant","disabled","onClick","preventClose","children","linkProps","ref","LinkComponent","useAdminUi","DropdownMenuSubRoot","DropdownMenuSubTrigger","DropdownMenuPortal","DropdownMenuSubContent","sharedProps","cn","content","DropdownMenuPrimitive","event","undefined","DecoratableDropdownMenuItem","makeDecoratable","DropdownMenuItem","Object","DropdownMenuItemIcon"],"mappings":";;;;;;;;;AA8BA,MAAMA,WAAWC,IACb;IACI;IACA;IACA;IACA;IACA;IACA;CACH,EACD;IACI,UAAU;QACN,SAAS;YACL,aAAa;gBAAC;gBAA6B;aAA2B;QAC1E;QACA,UAAU;YACN,MAAM;QACV;IACJ;IACA,iBAAiB;QACb,UAAU;IACd;AACJ;AAGJ,MAAMC,uBAAuB,WAAvBA,GAAuBC,wBAAAA,UAAgB,CAIzC,CACI,EACIC,SAAS,EACTC,IAAI,EACJC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACN,EACDC;IAEA,MAAM,EAAE,eAAeC,aAAa,EAAE,GAAGC;IAEzC,IAAIJ,UACA,OAAO,WAAP,GACI,sCAACK,qBAAmBA,MAAAA,WAAAA,GAChB,sCAACC,wBAAsBA,MAClBb,MAAAA,WAAAA,GACD,sCAAC,cAAMC,QAAAA,WAAAA,GAEX,sCAACa,oBAAkBA,MAAAA,WAAAA,GACf,sCAACC,wBAAsBA,MAAER;IAKzC,MAAMS,cAAc;QAChB,WAAWC,GACP,sHACA;YACI,kCAAkCb;QACtC;IAER;IAEA,MAAMc,UAAUV,UAAU,EAAE,GAAG,WAAH,GACxB,sCAACE,eAAAA;QAAe,GAAGM,WAAW;QAAG,GAAGR,SAAS;OACxCR,MAAAA,WAAAA,GACD,sCAAC,cAAMC,SAAAA,WAAAA,GAGX,sCAAC;QAAK,GAAGe,WAAW;QAAE,SAASX;OAC1BL,MAAAA,WAAAA,GACD,sCAAC,cAAMC;IAIf,OAAO,WAAP,GACI,sCAACkB,aAAAA,IAA0B;QACvB,UAAUf;QACV,KAAKK;QACL,WAAWQ,GAAGtB,SAAS;YAAEO;YAAUC;QAAQ,IAAIJ;QAC/C,UAAUO,eAAec,CAAAA,QAASA,MAAM,cAAc,KAAKC;OAE1DH;AAGb;AAGJrB,qBAAqB,WAAW,GAAGsB,aAAAA,IAAAA,CAAAA,WAAsC;AAEzE,MAAMG,8BAA8BC,gBAAgB,oBAAoB1B;AAExE,MAAM2B,mBAAmBC,OAAO,MAAM,CAACH,6BAA6B;IAChE,MAAMI;AACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuLabel.js","sources":["../../../src/DropdownMenu/components/DropdownMenuLabel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\n\nexport interface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Label\n> {\n text: React.ReactNode;\n}\n\nconst DropdownMenuLabelBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuLabelProps\n>(({ className, text, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"py-sm pl-sm-extra pr-md text-sm uppercase text-neutral-strong font-semibold\",\n className\n )}\n {...props}\n >\n {text}\n </DropdownMenuPrimitive.Label>\n));\nDropdownMenuLabelBase.displayName = DropdownMenuPrimitive.Label.displayName;\n\nexport const DropdownMenuLabel = makeDecoratable(\"DropdownMenuLabel\", DropdownMenuLabelBase);\n"],"names":["DropdownMenuLabelBase","React","className","text","props","ref","DropdownMenuPrimitive","cn","DropdownMenuLabel","makeDecoratable"],"mappings":";;;AAUA,MAAMA,wBAAwB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuLabel.js","sources":["../../../src/DropdownMenu/components/DropdownMenuLabel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\n\nexport interface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Label\n> {\n text: React.ReactNode;\n}\n\nconst DropdownMenuLabelBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuLabelProps\n>(({ className, text, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"py-sm pl-sm-extra pr-md text-sm uppercase text-neutral-strong font-semibold\",\n className\n )}\n {...props}\n >\n {text}\n </DropdownMenuPrimitive.Label>\n));\nDropdownMenuLabelBase.displayName = DropdownMenuPrimitive.Label.displayName;\n\nexport const DropdownMenuLabel = makeDecoratable(\"DropdownMenuLabel\", DropdownMenuLabelBase);\n"],"names":["DropdownMenuLabelBase","React","className","text","props","ref","DropdownMenuPrimitive","cn","DropdownMenuLabel","makeDecoratable"],"mappings":";;;AAUA,MAAMA,wBAAwB,WAAxBA,GAAwBC,wBAAAA,UAAgB,CAG5C,CAAC,EAAEC,SAAS,EAAEC,IAAI,EAAE,GAAGC,OAAO,EAAEC,MAAAA,WAAAA,GAC9B,sCAACC,aAAAA,KAA2B;QACxB,KAAKD;QACL,WAAWE,GACP,+EACAL;QAEH,GAAGE,KAAK;OAERD;AAGTH,sBAAsB,WAAW,GAAGM,aAAAA,KAAAA,CAAAA,WAAuC;AAEpE,MAAME,oBAAoBC,gBAAgB,qBAAqBT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuSubContent.js","sources":["../../../src/DropdownMenu/components/DropdownMenuSubContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n avoidCollisions={false}\n className={cn(\n \"border-sm border-solid border-neutral-muted z-popover min-w-32 overflow-hidden rounded-md border bg-white py-xs-plus text-neutral-primary shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n // Added these to match alignment shown in the design.\n sideOffset={-9}\n alignOffset={-2}\n {...props}\n />\n));\n\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nexport { DropdownMenuSubContent };\n"],"names":["DropdownMenuSubContent","React","className","props","ref","DropdownMenuPrimitive","cn"],"mappings":";;;AAIA,MAAMA,yBAAyB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuSubContent.js","sources":["../../../src/DropdownMenu/components/DropdownMenuSubContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n avoidCollisions={false}\n className={cn(\n \"border-sm border-solid border-neutral-muted z-popover min-w-32 overflow-hidden rounded-md border bg-white py-xs-plus text-neutral-primary shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n // Added these to match alignment shown in the design.\n sideOffset={-9}\n alignOffset={-2}\n {...props}\n />\n));\n\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nexport { DropdownMenuSubContent };\n"],"names":["DropdownMenuSubContent","React","className","props","ref","DropdownMenuPrimitive","cn"],"mappings":";;;AAIA,MAAMA,yBAAyB,WAAzBA,GAAyBC,wBAAAA,UAAgB,CAG7C,CAAC,EAAEC,SAAS,EAAE,GAAGC,OAAO,EAAEC,MAAAA,WAAAA,GACxB,sCAACC,aAAAA,UAAgC;QAC7B,KAAKD;QACL,iBAAiB;QACjB,WAAWE,GACP,weACAJ;QAGJ,YAAY;QACZ,aAAa;QACZ,GAAGC,KAAK;;AAIjBH,uBAAuB,WAAW,GAAGK,aAAAA,UAAAA,CAAAA,WAA4C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu/components/DropdownMenuSubTrigger.js","sources":["../../../src/DropdownMenu/components/DropdownMenuSubTrigger.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\nimport { ReactComponent as ChevronRight } from \"@webiny/icons/chevron_right.svg\";\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"group flex cursor-default select-none items-center rounded-sm px-xs-plus text-md outline-none\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"rounded-sm gap-sm-extra group-focus:bg-neutral-dimmed flex items-center w-full px-sm py-xs-plus transition-colors\",\n \"[&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0 [&_svg]:fill-neutral-xstrong\"\n )}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nexport { DropdownMenuSubTrigger };\n"],"names":["DropdownMenuSubTrigger","React","className","children","props","ref","DropdownMenuPrimitive","cn","ChevronRight"],"mappings":";;;;AAKA,MAAMA,yBAAyB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu/components/DropdownMenuSubTrigger.js","sources":["../../../src/DropdownMenu/components/DropdownMenuSubTrigger.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn } from \"~/utils.js\";\nimport { ReactComponent as ChevronRight } from \"@webiny/icons/chevron_right.svg\";\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"group flex cursor-default select-none items-center rounded-sm px-xs-plus text-md outline-none\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"rounded-sm gap-sm-extra group-focus:bg-neutral-dimmed flex items-center w-full px-sm py-xs-plus transition-colors\",\n \"[&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0 [&_svg]:fill-neutral-xstrong\"\n )}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nexport { DropdownMenuSubTrigger };\n"],"names":["DropdownMenuSubTrigger","React","className","children","props","ref","DropdownMenuPrimitive","cn","ChevronRight"],"mappings":";;;;AAKA,MAAMA,yBAAyB,WAAzBA,GAAyBC,wBAAAA,UAAgB,CAG7C,CAAC,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,OAAO,EAAEC,MAAAA,WAAAA,GAClC,sCAACC,aAAAA,UAAgC;QAC7B,KAAKD;QACL,WAAWE,GACP,iGACAL;QAEH,GAAGE,KAAK;qBAET,sCAAC;QACG,WAAWG,GACP,qHACA;OAGHJ,UAAAA,WAAAA,GACD,sCAACK,gBAAYA;QAAC,WAAU;;AAKpCR,uBAAuB,WAAW,GAAGM,aAAAA,UAAAA,CAAAA,WAA4C"}
|