@webiny/admin-ui 6.2.0-beta.0 → 6.3.0-beta.0
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.d.ts +1 -1
- package/Accordion/Accordion.mdx +437 -463
- package/Accordion/components/AccordionContent.js.map +1 -1
- package/Alert/Alert.d.ts +1 -1
- package/Alert/Alert.js.map +1 -1
- package/Alert/Alert.mdx +80 -83
- package/AutoComplete/AutoComplete.mdx +63 -55
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js.map +1 -1
- package/Avatar/Avatar.mdx +52 -43
- package/Button/Button.d.ts +1 -1
- package/Button/Button.js.map +1 -1
- package/Button/Button.mdx +50 -42
- package/Button/IconButton.d.ts +1 -1
- package/Button/IconButton.js.map +1 -1
- package/Card/components/CardContent.d.ts +1 -1
- package/Card/components/CardTitle.d.ts +1 -1
- package/Checkbox/Checkbox.mdx +51 -49
- package/Checkbox/primitives/CheckboxPrimitive.d.ts +1 -1
- package/CheckboxGroup/CheckboxGroup.mdx +51 -53
- package/CodeEditor/CodeEditor.mdx +44 -43
- package/ColorPicker/ColorPicker.mdx +41 -40
- package/Command/components/Item.d.ts +1 -1
- package/Command/components/Item.js.map +1 -1
- package/DataTable/DataTable.mdx +537 -542
- package/DataTable/components/ColumnSorter.d.ts +1 -1
- package/DataTable/components/ColumnSorter.js.map +1 -1
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/components/DialogContent.d.ts +1 -1
- package/Dialog/components/DialogContent.js +1 -1
- package/Dialog/components/DialogContent.js.map +1 -1
- package/Dialog/components/DialogFooter.d.ts +1 -1
- package/Dialog/components/DialogFooter.js.map +1 -1
- package/Dialog/components/DialogTitle.d.ts +1 -1
- package/Drawer/Drawer.js.map +1 -1
- package/Drawer/Drawer.mdx +73 -64
- package/Drawer/components/DrawerContent.d.ts +1 -1
- package/Drawer/components/DrawerContent.js.map +1 -1
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/DropdownMenu/DropdownMenu.mdx +155 -256
- package/DropdownMenu/components/DropdownMenuCheckboxItem.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuLabel.js.map +1 -1
- package/FilePicker/FilePicker.mdx +69 -69
- package/FilePicker/primitives/FilePickerPrimitive.d.ts +19 -19
- package/FilePicker/primitives/FilePickerPrimitive.js.map +1 -1
- package/FilePicker/primitives/components/Trigger.d.ts +1 -1
- package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +1 -1
- package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
- package/FilePicker/primitives/components/types.js.map +1 -1
- package/FormComponent/Description.d.ts +1 -1
- package/FormComponent/ErrorMessage.d.ts +1 -1
- package/FormComponent/Note.d.ts +1 -1
- package/Grid/Grid.d.ts +2 -2
- package/Grid/Grid.js.map +1 -1
- package/Grid/Grid.mdx +111 -121
- package/HeaderBar/HeaderBar.mdx +98 -99
- package/Heading/Heading.d.ts +1 -1
- package/Heading/Heading.js.map +1 -1
- package/Heading/Heading.mdx +63 -58
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js.map +1 -1
- package/Icon/Icon.mdx +79 -147
- package/IconPicker/IconPicker.mdx +66 -64
- package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
- package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
- package/Image/Image.js.map +1 -1
- package/Input/Input.mdx +67 -56
- package/Input/InputPrimitive.d.ts +1 -1
- package/Label/Label.d.ts +1 -1
- package/Label/Label.js.map +1 -1
- package/Label/Label.mdx +42 -42
- package/Label/components/LabelDescription.d.ts +1 -1
- package/Label/components/LabelRequired.d.ts +1 -1
- package/Label/components/LabelValue.d.ts +1 -1
- package/Link/Link.d.ts +1 -1
- package/Link/Link.mdx +129 -116
- package/List/List.d.ts +1 -1
- package/List/List.js.map +1 -1
- package/List/List.mdx +317 -329
- package/List/components/ListItem.d.ts +1 -1
- package/List/components/ListItem.js.map +1 -1
- package/Loader/Loader.d.ts +2 -2
- package/Loader/Loader.js.map +1 -1
- package/Loader/Loader.mdx +96 -91
- package/MultiAutoComplete/MultiAutoComplete.mdx +52 -51
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.d.ts +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenterWithUniqueValues.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js.map +1 -1
- package/MultiFilePicker/MultiFilePicker.mdx +84 -80
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.js.map +1 -1
- package/Popover/Popover.mdx +112 -118
- package/Popover/primitives/components/PopoverArrow.d.ts +1 -1
- package/Popover/primitives/components/PopoverContent.d.ts +1 -1
- package/RadioGroup/RadioGroup.mdx +62 -59
- package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
- package/RangeSlider/RangeSlider.mdx +48 -47
- package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
- package/RangeSlider/primitives/components/RangeSliderValue.d.ts +1 -1
- package/RangeSlider/primitives/components/RangeSliderValue.js.map +1 -1
- package/ScrollArea/ScrollArea.js.map +1 -1
- package/SegmentedControl/SegmentedControl.mdx +59 -59
- package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
- package/Select/Select.mdx +52 -43
- package/Select/primitives/components/SelectTrigger.d.ts +1 -1
- package/Select/primitives/components/SelectTrigger.js.map +1 -1
- package/Select/primitives/presenters/SelectPresenter.d.ts +1 -1
- package/Separator/Separator.d.ts +1 -1
- package/Separator/Separator.mdx +139 -150
- package/Sidebar/Sidebar.js.map +1 -1
- package/Sidebar/Sidebar.mdx +66 -88
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.d.ts +1 -1
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.js.map +1 -1
- package/Skeleton/Skeleton.d.ts +1 -1
- package/Skeleton/Skeleton.js.map +1 -1
- package/Skeleton/Skeleton.mdx +37 -37
- package/Slider/Slider.mdx +48 -47
- package/Slider/primitives/SliderPrimitive.js.map +1 -1
- package/Slider/primitives/components/SliderSideValue.d.ts +1 -1
- package/Slider/primitives/components/SliderSideValue.js.map +1 -1
- package/Slider/primitives/components/SliderTooltip.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIcon.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIcon.js.map +1 -1
- package/SteppedProgress/components/SteppedProgressIndicator.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIndicator.js.map +1 -1
- package/Switch/Switch.mdx +44 -42
- package/Switch/primitives/SwitchPrimitive.d.ts +1 -1
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js.map +1 -1
- package/Table/components/Direction.d.ts +1 -1
- package/Table/components/Direction.js.map +1 -1
- package/Table/components/Header.d.ts +1 -1
- package/Table/components/Header.js.map +1 -1
- package/Table/components/Resizer.d.ts +1 -1
- package/Table/components/Resizer.js.map +1 -1
- package/Table/components/Row.d.ts +1 -1
- package/Table/components/Row.js.map +1 -1
- package/Tabs/Tabs.mdx +297 -292
- package/Tabs/components/Content.d.ts +1 -1
- package/Tabs/components/List.d.ts +1 -1
- package/Tabs/components/Trigger.d.ts +1 -1
- package/Tag/Tag.d.ts +1 -1
- package/Tag/Tag.js.map +1 -1
- package/Tag/Tag.mdx +68 -64
- package/Tags/primitives/TagsPrimitive.js.map +1 -1
- package/Text/Text.d.ts +1 -1
- package/Text/Text.mdx +54 -48
- package/Textarea/Textarea.mdx +49 -39
- package/Textarea/TextareaPrimitive.d.ts +1 -1
- package/Textarea/TextareaPrimitive.js.map +1 -1
- package/Toast/Toast.mdx +63 -53
- package/Toast/components/ToastRoot.d.ts +1 -1
- package/Tooltip/Tooltip.mdx +197 -198
- package/Tooltip/components/TooltipArrow.d.ts +1 -1
- package/Tooltip/components/TooltipContent.d.ts +1 -1
- package/Tree/components/Item.d.ts +1 -1
- package/Tree/useTree.d.ts +1 -1
- package/Widget/components/WidgetContent.d.ts +1 -1
- package/package.json +15 -15
package/Select/Select.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Meta, Controls } from
|
|
1
|
+
import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
|
|
2
2
|
|
|
3
|
-
import * as SelectStories from
|
|
3
|
+
import * as SelectStories from "./Select.stories";
|
|
4
4
|
|
|
5
5
|
<Meta of={SelectStories} />
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ import React, { useState } from "react";
|
|
|
16
16
|
import { Select } from "@webiny/admin-ui";
|
|
17
17
|
|
|
18
18
|
const SelectExample = () => {
|
|
19
|
-
|
|
19
|
+
const [value, setValue] = useState("");
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<Select
|
|
@@ -36,25 +36,26 @@ const SelectExample = () => {
|
|
|
36
36
|
onChange={setValue}
|
|
37
37
|
/>
|
|
38
38
|
);
|
|
39
|
+
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
export default SelectExample;
|
|
42
43
|
|
|
43
44
|
`} }
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
additionalActions={[
|
|
46
|
+
{
|
|
47
|
+
title: 'Open in GitHub',
|
|
48
|
+
onClick: () => {
|
|
49
|
+
window.open(
|
|
50
|
+
'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Select/Select.tsx',
|
|
51
|
+
'_blank'
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
]}
|
|
55
56
|
/>
|
|
56
57
|
|
|
57
|
-
<Controls of={SelectStories.Documentation} exclude={["onChange", "onOpenChange"]}/>
|
|
58
|
+
<Controls of={SelectStories.Documentation} exclude={["onChange", "onOpenChange"]} />
|
|
58
59
|
|
|
59
60
|
```jsx
|
|
60
61
|
import React, { useState } from "react";
|
|
@@ -62,26 +63,26 @@ import React, { useState } from "react";
|
|
|
62
63
|
import { Select } from "@webiny/admin-ui";
|
|
63
64
|
|
|
64
65
|
const SelectExample = () => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
66
|
+
const [value, setValue] = useState("");
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<Select
|
|
70
|
+
label="Time Zone"
|
|
71
|
+
description="Select your preferred time zone"
|
|
72
|
+
note="This setting will affect how times are displayed throughout the application"
|
|
73
|
+
required={true}
|
|
74
|
+
options={[
|
|
75
|
+
{ value: "EST", label: "Eastern Standard Time (UTC-5)" },
|
|
76
|
+
{ value: "CST", label: "Central Standard Time (UTC-6)" },
|
|
77
|
+
{ value: "PST", label: "Pacific Standard Time (UTC-8)" },
|
|
78
|
+
{ value: "GMT", label: "Greenwich Mean Time (UTC+0)" },
|
|
79
|
+
{ value: "CET", label: "Central European Time (UTC+1)" },
|
|
80
|
+
{ value: "IST", label: "India Standard Time (UTC+5:30)" }
|
|
81
|
+
]}
|
|
82
|
+
value={value}
|
|
83
|
+
onChange={setValue}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
85
86
|
};
|
|
86
87
|
|
|
87
88
|
export default SelectExample;
|
|
@@ -90,27 +91,35 @@ export default SelectExample;
|
|
|
90
91
|
## Anatomy
|
|
91
92
|
|
|
92
93
|
### Select Anatomy
|
|
93
|
-
|
|
94
|
+
|
|
95
|
+
<img src="/images/storybook/select/anatomy.png" alt="Select Anatomy" />
|
|
94
96
|
|
|
95
97
|
### Styles
|
|
96
|
-
|
|
98
|
+
|
|
99
|
+
<img src="/images/storybook/select/styles.png" alt="Styles" />
|
|
97
100
|
|
|
98
101
|
### Options
|
|
99
|
-
|
|
102
|
+
|
|
103
|
+
<img src="/images/storybook/select/options.png" alt="Options" />
|
|
100
104
|
|
|
101
105
|
### States and Styles
|
|
102
|
-
|
|
106
|
+
|
|
107
|
+
<img src="/images/storybook/select/states-and-styles.png" alt="States and Styles" />
|
|
103
108
|
|
|
104
109
|
### Label Anatomy
|
|
105
|
-
|
|
110
|
+
|
|
111
|
+
<img src="/images/storybook/select/label-anatomy.png" alt="Label Anatomy" />
|
|
106
112
|
|
|
107
113
|
### Label Properties
|
|
108
|
-
|
|
114
|
+
|
|
115
|
+
<img src="/images/storybook/select/label-properties.png" alt="Label Properties" />
|
|
109
116
|
|
|
110
117
|
### Label Options
|
|
111
|
-
|
|
118
|
+
|
|
119
|
+
<img src="/images/storybook/select/label-options.png" alt="Label Options" />
|
|
112
120
|
|
|
113
121
|
## Usage
|
|
114
122
|
|
|
115
123
|
### Used in forms
|
|
116
|
-
|
|
124
|
+
|
|
125
|
+
<img src="/images/storybook/select/used-in-forms.png" alt="Used in forms" />
|
|
@@ -5,7 +5,7 @@ declare const selectTriggerVariants: (props?: ({
|
|
|
5
5
|
variant?: "primary" | "secondary" | "ghost" | "ghost-negative" | null | undefined;
|
|
6
6
|
size?: "md" | "lg" | "xl" | null | undefined;
|
|
7
7
|
invalid?: boolean | null | undefined;
|
|
8
|
-
} & import("class-variance-authority/
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
interface SelectTriggerProps extends SelectPrimitives.SelectTriggerProps, VariantProps<typeof selectTriggerVariants> {
|
|
10
10
|
startIcon?: React.ReactElement;
|
|
11
11
|
endIcon?: React.ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ReactComponent","ChevronDown","Select","SelectPrimitives","cn","cva","SelectIcon","selectTriggerVariants","variants","variant","primary","secondary","ghost","size","md","lg","xl","invalid","true","compoundVariants","class","defaultVariants","SelectTrigger","className","children","startIcon","endIcon","createElement","resetButton","disabled","props","Trigger","Object","assign","icon"],"sources":["SelectTrigger.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactComponent as ChevronDown } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { Select as SelectPrimitives } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\nimport { SelectIcon } from \"./SelectIcon.js\";\n\nconst selectTriggerVariants = cva(\n [\n \"w-full flex items-center justify-between gap-sm border-sm text-md relative\",\n \"focus:outline-none\",\n \"disabled:pointer-events-none\"\n ],\n {\n variants: {\n variant: {\n primary: [\n \"bg-neutral-base border-neutral-muted text-neutral-strong placeholder:text-neutral-dimmed fill-neutral-xstrong\",\n \"hover:border-neutral-strong\",\n \"focus:border-neutral-black\",\n \"data-[state=open]:border-neutral-black\",\n \"disabled:bg-neutral-disabled disabled:border-neutral-dimmed disabled:text-neutral-disabled disabled:placeholder:text-neutral-disabled disabled:fill-neutral-disabled\"\n ],\n secondary: [\n \"bg-neutral-light border-neutral-subtle text-neutral-strong placeholder:text-neutral-muted fill-neutral-xstrong\",\n \"hover:bg-neutral-dimmed\",\n \"focus:border-neutral-black focus:bg-neutral-base\",\n \"data-[state=open]:border-neutral-black data-[state=open]:bg-neutral-base\",\n \"disabled:bg-neutral-disabled disabled:border-neutral-dimmed disabled:text-neutral-disabled disabled:placeholder:text-neutral-disabled disabled:fill-neutral-disabled\"\n ],\n ghost: [\n \"bg-neutral-base border-transparent text-neutral-strong placeholder:text-neutral-dimmed\",\n \"hover:bg-neutral-dark/5\",\n \"focus:bg-neutral-dark/5\",\n \"data-[state=open]:bg-neutral-dark/5\",\n \"disabled:bg-neutral-disabled disabled:border-neutral-dimmed disabled:text-neutral-disabled disabled:placeholder:text-neutral-disabled disabled:fill-neutral-disabled\"\n ],\n \"ghost-negative\": [\n \"bg-transparent border-transparent text-neutral-light/50 placeholder:text-neutral-light/50 fill-neutral-base/50\",\n \"hover:bg-neutral-base/20\",\n \"focus:bg-neutral-base/20\",\n \"data-[state=open]:bg-neutral-base data-[state=open]:text-neutral-primary data[state=open]:placeholder:text-neutral-dimmed data[state=open]:!fill-neutral-xstrong\",\n \"disabled:bg-transparent disabled:text-neutral-disabled/50 disabled:placeholder:text-neutral-disabled/50\"\n ]\n },\n size: {\n md: [\n \"rounded-md\",\n \"py-[calc(var(--padding-xs-plus)-(var(--border-width-sm)))] px-[calc(var(--padding-sm-extra)-(var(--border-width-sm)))]\"\n ],\n lg: [\n \"rounded-md\",\n \"py-[calc(var(--padding-sm-plus)-(var(--border-width-sm)))] px-[calc(var(--padding-sm-extra)-(var(--border-width-sm)))]\"\n ],\n xl: [\n \"rounded-lg leading-6\",\n \"py-[calc(var(--padding-md)-(var(--border-width-sm)))] px-[calc(var(--padding-md)-(var(--border-width-sm)))]\"\n ]\n },\n invalid: {\n true: \"\"\n }\n },\n compoundVariants: [\n {\n variant: \"primary\",\n invalid: true,\n class: \"border-destructive-default!\"\n },\n {\n variant: \"secondary\",\n invalid: true,\n class: \"border-destructive-default!\"\n },\n {\n variant: \"ghost\",\n invalid: true,\n class: \"border-destructive-subtle! bg-destructive-subtle!\"\n },\n {\n variant: \"ghost-negative\",\n invalid: true,\n class: \"border-destructive-default! bg-destructive-subtle! text-neutral-primary placeholder:text-neutral-dimmed fill-neutral-xstrong!\"\n }\n ],\n defaultVariants: {\n variant: \"primary\",\n size: \"lg\"\n }\n }\n);\n\ninterface SelectTriggerProps\n extends SelectPrimitives.SelectTriggerProps
|
|
1
|
+
{"version":3,"names":["React","ReactComponent","ChevronDown","Select","SelectPrimitives","cn","cva","SelectIcon","selectTriggerVariants","variants","variant","primary","secondary","ghost","size","md","lg","xl","invalid","true","compoundVariants","class","defaultVariants","SelectTrigger","className","children","startIcon","endIcon","createElement","resetButton","disabled","props","Trigger","Object","assign","icon"],"sources":["SelectTrigger.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactComponent as ChevronDown } from \"@webiny/icons/keyboard_arrow_down.svg\";\nimport { Select as SelectPrimitives } from \"radix-ui\";\nimport { cn, cva, type VariantProps } from \"~/utils.js\";\nimport { SelectIcon } from \"./SelectIcon.js\";\n\nconst selectTriggerVariants = cva(\n [\n \"w-full flex items-center justify-between gap-sm border-sm text-md relative\",\n \"focus:outline-none\",\n \"disabled:pointer-events-none\"\n ],\n {\n variants: {\n variant: {\n primary: [\n \"bg-neutral-base border-neutral-muted text-neutral-strong placeholder:text-neutral-dimmed fill-neutral-xstrong\",\n \"hover:border-neutral-strong\",\n \"focus:border-neutral-black\",\n \"data-[state=open]:border-neutral-black\",\n \"disabled:bg-neutral-disabled disabled:border-neutral-dimmed disabled:text-neutral-disabled disabled:placeholder:text-neutral-disabled disabled:fill-neutral-disabled\"\n ],\n secondary: [\n \"bg-neutral-light border-neutral-subtle text-neutral-strong placeholder:text-neutral-muted fill-neutral-xstrong\",\n \"hover:bg-neutral-dimmed\",\n \"focus:border-neutral-black focus:bg-neutral-base\",\n \"data-[state=open]:border-neutral-black data-[state=open]:bg-neutral-base\",\n \"disabled:bg-neutral-disabled disabled:border-neutral-dimmed disabled:text-neutral-disabled disabled:placeholder:text-neutral-disabled disabled:fill-neutral-disabled\"\n ],\n ghost: [\n \"bg-neutral-base border-transparent text-neutral-strong placeholder:text-neutral-dimmed\",\n \"hover:bg-neutral-dark/5\",\n \"focus:bg-neutral-dark/5\",\n \"data-[state=open]:bg-neutral-dark/5\",\n \"disabled:bg-neutral-disabled disabled:border-neutral-dimmed disabled:text-neutral-disabled disabled:placeholder:text-neutral-disabled disabled:fill-neutral-disabled\"\n ],\n \"ghost-negative\": [\n \"bg-transparent border-transparent text-neutral-light/50 placeholder:text-neutral-light/50 fill-neutral-base/50\",\n \"hover:bg-neutral-base/20\",\n \"focus:bg-neutral-base/20\",\n \"data-[state=open]:bg-neutral-base data-[state=open]:text-neutral-primary data[state=open]:placeholder:text-neutral-dimmed data[state=open]:!fill-neutral-xstrong\",\n \"disabled:bg-transparent disabled:text-neutral-disabled/50 disabled:placeholder:text-neutral-disabled/50\"\n ]\n },\n size: {\n md: [\n \"rounded-md\",\n \"py-[calc(var(--padding-xs-plus)-(var(--border-width-sm)))] px-[calc(var(--padding-sm-extra)-(var(--border-width-sm)))]\"\n ],\n lg: [\n \"rounded-md\",\n \"py-[calc(var(--padding-sm-plus)-(var(--border-width-sm)))] px-[calc(var(--padding-sm-extra)-(var(--border-width-sm)))]\"\n ],\n xl: [\n \"rounded-lg leading-6\",\n \"py-[calc(var(--padding-md)-(var(--border-width-sm)))] px-[calc(var(--padding-md)-(var(--border-width-sm)))]\"\n ]\n },\n invalid: {\n true: \"\"\n }\n },\n compoundVariants: [\n {\n variant: \"primary\",\n invalid: true,\n class: \"border-destructive-default!\"\n },\n {\n variant: \"secondary\",\n invalid: true,\n class: \"border-destructive-default!\"\n },\n {\n variant: \"ghost\",\n invalid: true,\n class: \"border-destructive-subtle! bg-destructive-subtle!\"\n },\n {\n variant: \"ghost-negative\",\n invalid: true,\n class: \"border-destructive-default! bg-destructive-subtle! text-neutral-primary placeholder:text-neutral-dimmed fill-neutral-xstrong!\"\n }\n ],\n defaultVariants: {\n variant: \"primary\",\n size: \"lg\"\n }\n }\n);\n\ninterface SelectTriggerProps\n extends SelectPrimitives.SelectTriggerProps, VariantProps<typeof selectTriggerVariants> {\n startIcon?: React.ReactElement;\n endIcon?: React.ReactElement;\n resetButton?: React.ReactElement;\n}\n\nconst SelectTrigger = ({\n className,\n children,\n size,\n variant,\n startIcon,\n endIcon = <ChevronDown />,\n resetButton,\n disabled,\n invalid,\n ...props\n}: SelectTriggerProps) => (\n <SelectPrimitives.Trigger\n className={cn(selectTriggerVariants({ variant, size, invalid }), className)}\n disabled={disabled}\n {...props}\n >\n {startIcon && <SelectIcon icon={startIcon} />}\n {children}\n {resetButton}\n <SelectIcon icon={endIcon} />\n </SelectPrimitives.Trigger>\n);\n\nexport { SelectTrigger, selectTriggerVariants };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,IAAIC,WAAW,QAAQ,uCAAuC;AACrF,SAASC,MAAM,IAAIC,gBAAgB,QAAQ,UAAU;AACrD,SAASC,EAAE,EAAEC,GAAG;AAChB,SAASC,UAAU;AAEnB,MAAMC,qBAAqB,GAAGF,GAAG,CAC7B,CACI,4EAA4E,EAC5E,oBAAoB,EACpB,8BAA8B,CACjC,EACD;EACIG,QAAQ,EAAE;IACNC,OAAO,EAAE;MACLC,OAAO,EAAE,CACL,+GAA+G,EAC/G,6BAA6B,EAC7B,4BAA4B,EAC5B,wCAAwC,EACxC,sKAAsK,CACzK;MACDC,SAAS,EAAE,CACP,gHAAgH,EAChH,yBAAyB,EACzB,kDAAkD,EAClD,0EAA0E,EAC1E,sKAAsK,CACzK;MACDC,KAAK,EAAE,CACH,wFAAwF,EACxF,yBAAyB,EACzB,yBAAyB,EACzB,qCAAqC,EACrC,sKAAsK,CACzK;MACD,gBAAgB,EAAE,CACd,gHAAgH,EAChH,0BAA0B,EAC1B,0BAA0B,EAC1B,kKAAkK,EAClK,yGAAyG;IAEjH,CAAC;IACDC,IAAI,EAAE;MACFC,EAAE,EAAE,CACA,YAAY,EACZ,wHAAwH,CAC3H;MACDC,EAAE,EAAE,CACA,YAAY,EACZ,wHAAwH,CAC3H;MACDC,EAAE,EAAE,CACA,sBAAsB,EACtB,6GAA6G;IAErH,CAAC;IACDC,OAAO,EAAE;MACLC,IAAI,EAAE;IACV;EACJ,CAAC;EACDC,gBAAgB,EAAE,CACd;IACIV,OAAO,EAAE,SAAS;IAClBQ,OAAO,EAAE,IAAI;IACbG,KAAK,EAAE;EACX,CAAC,EACD;IACIX,OAAO,EAAE,WAAW;IACpBQ,OAAO,EAAE,IAAI;IACbG,KAAK,EAAE;EACX,CAAC,EACD;IACIX,OAAO,EAAE,OAAO;IAChBQ,OAAO,EAAE,IAAI;IACbG,KAAK,EAAE;EACX,CAAC,EACD;IACIX,OAAO,EAAE,gBAAgB;IACzBQ,OAAO,EAAE,IAAI;IACbG,KAAK,EAAE;EACX,CAAC,CACJ;EACDC,eAAe,EAAE;IACbZ,OAAO,EAAE,SAAS;IAClBI,IAAI,EAAE;EACV;AACJ,CACJ,CAAC;AASD,MAAMS,aAAa,GAAGA,CAAC;EACnBC,SAAS;EACTC,QAAQ;EACRX,IAAI;EACJJ,OAAO;EACPgB,SAAS;EACTC,OAAO,gBAAG3B,KAAA,CAAA4B,aAAA,CAAC1B,WAAW,MAAE,CAAC;EACzB2B,WAAW;EACXC,QAAQ;EACRZ,OAAO;EACP,GAAGa;AACa,CAAC,kBACjB/B,KAAA,CAAA4B,aAAA,CAACxB,gBAAgB,CAAC4B,OAAO,EAAAC,MAAA,CAAAC,MAAA;EACrBV,SAAS,EAAEnB,EAAE,CAACG,qBAAqB,CAAC;IAAEE,OAAO;IAAEI,IAAI;IAAEI;EAAQ,CAAC,CAAC,EAAEM,SAAS,CAAE;EAC5EM,QAAQ,EAAEA;AAAS,GACfC,KAAK,GAERL,SAAS,iBAAI1B,KAAA,CAAA4B,aAAA,CAACrB,UAAU;EAAC4B,IAAI,EAAET;AAAU,CAAE,CAAC,EAC5CD,QAAQ,EACRI,WAAW,eACZ7B,KAAA,CAAA4B,aAAA,CAACrB,UAAU;EAAC4B,IAAI,EAAER;AAAQ,CAAE,CACN,CAC7B;AAED,SAASJ,aAAa,EAAEf,qBAAqB","ignoreList":[]}
|
|
@@ -34,7 +34,7 @@ declare class SelectPresenter implements ISelectPresenter {
|
|
|
34
34
|
displayResetAction: boolean;
|
|
35
35
|
};
|
|
36
36
|
selectOptions: {
|
|
37
|
-
options: import("../../
|
|
37
|
+
options: import("../../index.js").SelectOptionFormatted[];
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
changeValue: (value?: string) => void;
|
package/Separator/Separator.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare const separatorVariants: (props?: ({
|
|
|
5
5
|
margin?: "sm" | "md" | "none" | "lg" | "xl" | "xs" | null | undefined;
|
|
6
6
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
7
7
|
variant?: "accent" | "base" | "strong" | "transparent" | "dimmed" | "muted" | null | undefined;
|
|
8
|
-
} & import("class-variance-authority/
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type SeparatorPosition = "start" | "middle" | "end";
|
|
10
10
|
type SeparatorProps = Omit<SeparatorPrimitive.SeparatorProps, "children"> & VariantProps<typeof separatorVariants> & {
|
|
11
11
|
children?: React.ReactNode;
|
package/Separator/Separator.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Meta, Controls } from
|
|
1
|
+
import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
|
|
2
2
|
|
|
3
|
-
import * as SeparatorStories from
|
|
3
|
+
import * as SeparatorStories from "./Separator.stories";
|
|
4
4
|
|
|
5
5
|
<Meta of={SeparatorStories} />
|
|
6
6
|
|
|
@@ -15,41 +15,36 @@ import React from "react";
|
|
|
15
15
|
import { Separator, Heading, Text } from "@webiny/admin-ui";
|
|
16
16
|
|
|
17
17
|
const SeparatorExample = () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<Text>{"This is text 1."}</Text>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
18
|
+
return (
|
|
19
|
+
|
|
20
|
+
<div>
|
|
21
|
+
<div className="space-y-1">
|
|
22
|
+
<Heading level={6}>{"This is a heading."}</Heading>
|
|
23
|
+
<Text size="sm" className={"text-neutral-strong"}>
|
|
24
|
+
{"This is a short description here"}
|
|
25
|
+
</Text>
|
|
26
|
+
</div>
|
|
27
|
+
<Separator margin="lg" variant="subtle" orientation="horizontal" decorative={true} />
|
|
28
|
+
<div className="flex items-center h-6 text-sm">
|
|
29
|
+
<Text>{"This is text 1."}</Text>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
); };
|
|
38
33
|
|
|
39
34
|
export default SeparatorExample;
|
|
40
35
|
|
|
41
36
|
` } }
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
additionalActions={[
|
|
38
|
+
{
|
|
39
|
+
title: 'Open in GitHub',
|
|
40
|
+
onClick: () => {
|
|
41
|
+
window.open(
|
|
42
|
+
'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Separator/Separator.tsx',
|
|
43
|
+
'_blank'
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
]}
|
|
53
48
|
/>
|
|
54
49
|
|
|
55
50
|
<Controls of={SeparatorStories.Documentation} />
|
|
@@ -59,31 +54,25 @@ import React from "react";
|
|
|
59
54
|
import { Separator, Heading, Text } from "@webiny/admin-ui";
|
|
60
55
|
|
|
61
56
|
const SeparatorExample = () => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<div className="flex items-center h-6 text-sm">
|
|
77
|
-
<Text>{"This is text 1."}</Text>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
57
|
+
return (
|
|
58
|
+
<div>
|
|
59
|
+
<div className="space-y-1">
|
|
60
|
+
<Heading level={6}>{"This is a heading."}</Heading>
|
|
61
|
+
<Text size="sm" className={"text-neutral-strong"}>
|
|
62
|
+
{"This is a short description here"}
|
|
63
|
+
</Text>
|
|
64
|
+
</div>
|
|
65
|
+
<Separator margin="lg" variant="subtle" orientation="horizontal" decorative={true} />
|
|
66
|
+
<div className="flex items-center h-6 text-sm">
|
|
67
|
+
<Text>{"This is text 1."}</Text>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
81
71
|
};
|
|
82
72
|
|
|
83
73
|
export default SeparatorExample;
|
|
84
74
|
```
|
|
85
75
|
|
|
86
|
-
|
|
87
76
|
## Examples
|
|
88
77
|
|
|
89
78
|
### Default
|
|
@@ -95,21 +84,21 @@ import React from "react";
|
|
|
95
84
|
import { Separator, Heading, Text } from "@webiny/admin-ui";
|
|
96
85
|
|
|
97
86
|
const DefaultSeparatorExample = () => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
87
|
+
return (
|
|
88
|
+
|
|
89
|
+
<div>
|
|
90
|
+
<div className="space-y-1">
|
|
91
|
+
<Heading level={6}>{"This is a heading."}</Heading>
|
|
92
|
+
<Text size="sm" className={"text-neutral-strong"}>
|
|
93
|
+
{"This is a short description here"}
|
|
94
|
+
</Text>
|
|
95
|
+
</div>
|
|
96
|
+
<Separator margin="lg" variant="subtle" />
|
|
97
|
+
<div className="flex items-center h-6 text-sm">
|
|
98
|
+
<Text>{"This is text 1."}</Text>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
); };
|
|
113
102
|
|
|
114
103
|
export default DefaultSeparatorExample;
|
|
115
104
|
` } } />
|
|
@@ -123,25 +112,25 @@ import React from "react";
|
|
|
123
112
|
import { Separator, Heading, Text } from "@webiny/admin-ui";
|
|
124
113
|
|
|
125
114
|
const VerticalAndHorizontalExample = () => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
115
|
+
return (
|
|
116
|
+
|
|
117
|
+
<div>
|
|
118
|
+
<div className="space-y-1">
|
|
119
|
+
<Heading level={6}>{"This is a heading."}</Heading>
|
|
120
|
+
<Text size="sm" className={"text-neutral-strong"}>
|
|
121
|
+
{"This is a short description here"}
|
|
122
|
+
</Text>
|
|
123
|
+
</div>
|
|
124
|
+
<Separator margin={"lg"} />
|
|
125
|
+
<div className="flex items-center h-6 text-sm">
|
|
126
|
+
<Text>{"This is text 1."}</Text>
|
|
127
|
+
<Separator orientation="vertical" margin={"lg"} />
|
|
128
|
+
<Text>{"This is text 2."}</Text>
|
|
129
|
+
<Separator orientation="vertical" margin={"lg"} />
|
|
130
|
+
<Text>{"This is text 3."}</Text>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
); };
|
|
145
134
|
|
|
146
135
|
export default VerticalAndHorizontalExample;
|
|
147
136
|
` } } />
|
|
@@ -155,21 +144,21 @@ import React from "react";
|
|
|
155
144
|
import { Separator, Heading, Text } from "@webiny/admin-ui";
|
|
156
145
|
|
|
157
146
|
const HorizontalOrientationExample = () => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
};
|
|
147
|
+
return (
|
|
148
|
+
|
|
149
|
+
<div>
|
|
150
|
+
<div className="space-y-1">
|
|
151
|
+
<Heading level={6}>{"This is a heading."}</Heading>
|
|
152
|
+
<Text size="sm" className={"text-neutral-strong"}>
|
|
153
|
+
{"This is a short description here"}
|
|
154
|
+
</Text>
|
|
155
|
+
</div>
|
|
156
|
+
<Separator margin={"lg"} orientation="horizontal" />
|
|
157
|
+
<div className="flex items-center h-6 text-sm">
|
|
158
|
+
<Text>{"This is text 1."}</Text>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
); };
|
|
173
162
|
|
|
174
163
|
export default HorizontalOrientationExample;
|
|
175
164
|
` } } />
|
|
@@ -183,16 +172,16 @@ import React from "react";
|
|
|
183
172
|
import { Separator, Text } from "@webiny/admin-ui";
|
|
184
173
|
|
|
185
174
|
const VerticalOrientationExample = () => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
};
|
|
175
|
+
return (
|
|
176
|
+
|
|
177
|
+
<div className="flex justify-center h-6 text-sm">
|
|
178
|
+
<Text>{"This is text 1."}</Text>
|
|
179
|
+
<Separator orientation="vertical" margin={"lg"} />
|
|
180
|
+
<Text>{"This is text 2."}</Text>
|
|
181
|
+
<Separator orientation="vertical" margin={"lg"} />
|
|
182
|
+
<Text>{"This is text 3."}</Text>
|
|
183
|
+
</div>
|
|
184
|
+
); };
|
|
196
185
|
|
|
197
186
|
export default VerticalOrientationExample;
|
|
198
187
|
` } } />
|
|
@@ -206,25 +195,25 @@ import React from "react";
|
|
|
206
195
|
import { Separator, Heading, Text } from "@webiny/admin-ui";
|
|
207
196
|
|
|
208
197
|
const LessMarginExample = () => {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
};
|
|
198
|
+
return (
|
|
199
|
+
|
|
200
|
+
<div>
|
|
201
|
+
<div className="space-y-1">
|
|
202
|
+
<Heading level={6}>{"This is a heading."}</Heading>
|
|
203
|
+
<Text size="sm" className={"text-neutral-strong"}>
|
|
204
|
+
{"This is a short description here"}
|
|
205
|
+
</Text>
|
|
206
|
+
</div>
|
|
207
|
+
<Separator margin={"md"} />
|
|
208
|
+
<div className="flex items-center h-6 text-sm">
|
|
209
|
+
<Text>{"This is text 1."}</Text>
|
|
210
|
+
<Separator orientation="vertical" margin={"md"} />
|
|
211
|
+
<Text>{"This is text 2."}</Text>
|
|
212
|
+
<Separator orientation="vertical" margin={"md"} />
|
|
213
|
+
<Text>{"This is text 3."}</Text>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
); };
|
|
228
217
|
|
|
229
218
|
export default LessMarginExample;
|
|
230
219
|
` } } />
|
|
@@ -238,25 +227,25 @@ import React from "react";
|
|
|
238
227
|
import { Separator, Heading, Text } from "@webiny/admin-ui";
|
|
239
228
|
|
|
240
229
|
const MoreMarginExample = () => {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
};
|
|
230
|
+
return (
|
|
231
|
+
|
|
232
|
+
<div>
|
|
233
|
+
<div className="space-y-1">
|
|
234
|
+
<Heading level={6}>{"This is a heading."}</Heading>
|
|
235
|
+
<Text size="sm" className={"text-neutral-strong"}>
|
|
236
|
+
{"This is a short description here"}
|
|
237
|
+
</Text>
|
|
238
|
+
</div>
|
|
239
|
+
<Separator margin={"xl"} />
|
|
240
|
+
<div className="flex items-center h-6 text-sm">
|
|
241
|
+
<Text>{"This is text 1."}</Text>
|
|
242
|
+
<Separator orientation="vertical" margin={"xl"} />
|
|
243
|
+
<Text>{"This is text 2."}</Text>
|
|
244
|
+
<Separator orientation="vertical" margin={"xl"} />
|
|
245
|
+
<Text>{"This is text 3."}</Text>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
); };
|
|
260
249
|
|
|
261
250
|
export default MoreMarginExample;
|
|
262
251
|
` } } />
|
package/Sidebar/Sidebar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","makeDecoratable","withStaticProps","SidebarRoot","SidebarHeader","SidebarContent","SidebarIcon","SidebarFooter","SidebarMenuItem","SidebarMenuLink","SidebarMenuRoot","SidebarMenuGroup","SidebarBase","props","headerProps","rootProps","footerProps","contentProps","useMemo","title","icon","side","footer","rest","createElement","showPinnedItems","children","DecoratableSidebar","Sidebar","Item","Link","Group","Icon"],"sources":["Sidebar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { SidebarRoot } from \"./components/SidebarRoot.js\";\nimport { SidebarHeader } from \"./components/SidebarHeader.js\";\nimport { SidebarContent } from \"./components/SidebarContent.js\";\nimport { SidebarIcon } from \"./components/SidebarIcon.js\";\nimport { SidebarFooter } from \"./components/SidebarFooter.js\";\nimport { SidebarMenuItem } from \"./components/items/SidebarMenuItem.js\";\nimport { SidebarMenuLink } from \"./components/items/SidebarMenuLink.js\";\nimport { SidebarMenuRoot } from \"./components/items/SidebarMenuRoot.js\";\nimport { SidebarMenuGroup } from \"~/Sidebar/components/items/SidebarMenuGroup.js\";\n\ninterface SidebarProps\n extends
|
|
1
|
+
{"version":3,"names":["React","makeDecoratable","withStaticProps","SidebarRoot","SidebarHeader","SidebarContent","SidebarIcon","SidebarFooter","SidebarMenuItem","SidebarMenuLink","SidebarMenuRoot","SidebarMenuGroup","SidebarBase","props","headerProps","rootProps","footerProps","contentProps","useMemo","title","icon","side","footer","rest","createElement","showPinnedItems","children","DecoratableSidebar","Sidebar","Item","Link","Group","Icon"],"sources":["Sidebar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { makeDecoratable, withStaticProps } from \"~/utils.js\";\nimport { SidebarRoot } from \"./components/SidebarRoot.js\";\nimport { SidebarHeader } from \"./components/SidebarHeader.js\";\nimport { SidebarContent } from \"./components/SidebarContent.js\";\nimport { SidebarIcon } from \"./components/SidebarIcon.js\";\nimport { SidebarFooter } from \"./components/SidebarFooter.js\";\nimport { SidebarMenuItem } from \"./components/items/SidebarMenuItem.js\";\nimport { SidebarMenuLink } from \"./components/items/SidebarMenuLink.js\";\nimport { SidebarMenuRoot } from \"./components/items/SidebarMenuRoot.js\";\nimport { SidebarMenuGroup } from \"~/Sidebar/components/items/SidebarMenuGroup.js\";\n\ninterface SidebarProps\n extends\n Omit<React.ComponentPropsWithoutRef<typeof SidebarRoot>, \"title\">,\n Omit<React.ComponentPropsWithoutRef<typeof SidebarContent>, \"title\"> {\n title?: React.ReactNode;\n icon?: React.ReactNode;\n children: React.ReactNode;\n footer?: React.ReactNode;\n}\n\nconst SidebarBase = (props: SidebarProps) => {\n const { headerProps, rootProps, footerProps, contentProps } = React.useMemo(() => {\n const {\n // Header props.\n title,\n icon,\n\n // Root props.\n side,\n\n // Footer props.\n footer,\n\n // Content props.\n ...rest\n } = props;\n\n return {\n headerProps: {\n title,\n icon\n },\n rootProps: {\n side\n },\n footerProps: {\n footer\n },\n contentProps: rest\n };\n }, [props]);\n\n return (\n <SidebarRoot {...rootProps}>\n <SidebarHeader {...headerProps} />\n <SidebarContent {...contentProps}>\n <SidebarMenuRoot showPinnedItems={true}>{props.children}</SidebarMenuRoot>\n </SidebarContent>\n <SidebarFooter>\n <SidebarMenuRoot showPinnedItems={false}>{footerProps.footer}</SidebarMenuRoot>\n </SidebarFooter>\n </SidebarRoot>\n );\n};\n\nconst DecoratableSidebar = makeDecoratable(\"Sidebar\", SidebarBase);\n\nconst Sidebar = withStaticProps(DecoratableSidebar, {\n Item: SidebarMenuItem,\n Link: SidebarMenuLink,\n Group: SidebarMenuGroup,\n Icon: SidebarIcon\n});\n\nexport { Sidebar };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,eAAe,EAAEC,eAAe;AACzC,SAASC,WAAW;AACpB,SAASC,aAAa;AACtB,SAASC,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,aAAa;AACtB,SAASC,eAAe;AACxB,SAASC,eAAe;AACxB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AAYzB,MAAMC,WAAW,GAAIC,KAAmB,IAAK;EACzC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC,WAAW;IAAEC;EAAa,CAAC,GAAGjB,KAAK,CAACkB,OAAO,CAAC,MAAM;IAC9E,MAAM;MACF;MACAC,KAAK;MACLC,IAAI;MAEJ;MACAC,IAAI;MAEJ;MACAC,MAAM;MAEN;MACA,GAAGC;IACP,CAAC,GAAGV,KAAK;IAET,OAAO;MACHC,WAAW,EAAE;QACTK,KAAK;QACLC;MACJ,CAAC;MACDL,SAAS,EAAE;QACPM;MACJ,CAAC;MACDL,WAAW,EAAE;QACTM;MACJ,CAAC;MACDL,YAAY,EAAEM;IAClB,CAAC;EACL,CAAC,EAAE,CAACV,KAAK,CAAC,CAAC;EAEX,oBACIb,KAAA,CAAAwB,aAAA,CAACrB,WAAW,EAAKY,SAAS,eACtBf,KAAA,CAAAwB,aAAA,CAACpB,aAAa,EAAKU,WAAc,CAAC,eAClCd,KAAA,CAAAwB,aAAA,CAACnB,cAAc,EAAKY,YAAY,eAC5BjB,KAAA,CAAAwB,aAAA,CAACd,eAAe;IAACe,eAAe,EAAE;EAAK,GAAEZ,KAAK,CAACa,QAA0B,CAC7D,CAAC,eACjB1B,KAAA,CAAAwB,aAAA,CAACjB,aAAa,qBACVP,KAAA,CAAAwB,aAAA,CAACd,eAAe;IAACe,eAAe,EAAE;EAAM,GAAET,WAAW,CAACM,MAAwB,CACnE,CACN,CAAC;AAEtB,CAAC;AAED,MAAMK,kBAAkB,GAAG1B,eAAe,CAAC,SAAS,EAAEW,WAAW,CAAC;AAElE,MAAMgB,OAAO,GAAG1B,eAAe,CAACyB,kBAAkB,EAAE;EAChDE,IAAI,EAAErB,eAAe;EACrBsB,IAAI,EAAErB,eAAe;EACrBsB,KAAK,EAAEpB,gBAAgB;EACvBqB,IAAI,EAAE1B;AACV,CAAC,CAAC;AAEF,SAASsB,OAAO","ignoreList":[]}
|