@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.
Files changed (161) hide show
  1. package/Accordion/Accordion.d.ts +1 -1
  2. package/Accordion/Accordion.mdx +437 -463
  3. package/Accordion/components/AccordionContent.js.map +1 -1
  4. package/Alert/Alert.d.ts +1 -1
  5. package/Alert/Alert.js.map +1 -1
  6. package/Alert/Alert.mdx +80 -83
  7. package/AutoComplete/AutoComplete.mdx +63 -55
  8. package/Avatar/Avatar.d.ts +1 -1
  9. package/Avatar/Avatar.js.map +1 -1
  10. package/Avatar/Avatar.mdx +52 -43
  11. package/Button/Button.d.ts +1 -1
  12. package/Button/Button.js.map +1 -1
  13. package/Button/Button.mdx +50 -42
  14. package/Button/IconButton.d.ts +1 -1
  15. package/Button/IconButton.js.map +1 -1
  16. package/Card/components/CardContent.d.ts +1 -1
  17. package/Card/components/CardTitle.d.ts +1 -1
  18. package/Checkbox/Checkbox.mdx +51 -49
  19. package/Checkbox/primitives/CheckboxPrimitive.d.ts +1 -1
  20. package/CheckboxGroup/CheckboxGroup.mdx +51 -53
  21. package/CodeEditor/CodeEditor.mdx +44 -43
  22. package/ColorPicker/ColorPicker.mdx +41 -40
  23. package/Command/components/Item.d.ts +1 -1
  24. package/Command/components/Item.js.map +1 -1
  25. package/DataTable/DataTable.mdx +537 -542
  26. package/DataTable/components/ColumnSorter.d.ts +1 -1
  27. package/DataTable/components/ColumnSorter.js.map +1 -1
  28. package/Dialog/Dialog.js.map +1 -1
  29. package/Dialog/components/DialogContent.d.ts +1 -1
  30. package/Dialog/components/DialogContent.js +1 -1
  31. package/Dialog/components/DialogContent.js.map +1 -1
  32. package/Dialog/components/DialogFooter.d.ts +1 -1
  33. package/Dialog/components/DialogFooter.js.map +1 -1
  34. package/Dialog/components/DialogTitle.d.ts +1 -1
  35. package/Drawer/Drawer.js.map +1 -1
  36. package/Drawer/Drawer.mdx +73 -64
  37. package/Drawer/components/DrawerContent.d.ts +1 -1
  38. package/Drawer/components/DrawerContent.js.map +1 -1
  39. package/DropdownMenu/DropdownMenu.js.map +1 -1
  40. package/DropdownMenu/DropdownMenu.mdx +155 -256
  41. package/DropdownMenu/components/DropdownMenuCheckboxItem.js.map +1 -1
  42. package/DropdownMenu/components/DropdownMenuLabel.js.map +1 -1
  43. package/FilePicker/FilePicker.mdx +69 -69
  44. package/FilePicker/primitives/FilePickerPrimitive.d.ts +19 -19
  45. package/FilePicker/primitives/FilePickerPrimitive.js.map +1 -1
  46. package/FilePicker/primitives/components/Trigger.d.ts +1 -1
  47. package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +1 -1
  48. package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
  49. package/FilePicker/primitives/components/types.js.map +1 -1
  50. package/FormComponent/Description.d.ts +1 -1
  51. package/FormComponent/ErrorMessage.d.ts +1 -1
  52. package/FormComponent/Note.d.ts +1 -1
  53. package/Grid/Grid.d.ts +2 -2
  54. package/Grid/Grid.js.map +1 -1
  55. package/Grid/Grid.mdx +111 -121
  56. package/HeaderBar/HeaderBar.mdx +98 -99
  57. package/Heading/Heading.d.ts +1 -1
  58. package/Heading/Heading.js.map +1 -1
  59. package/Heading/Heading.mdx +63 -58
  60. package/Icon/Icon.d.ts +1 -1
  61. package/Icon/Icon.js.map +1 -1
  62. package/Icon/Icon.mdx +79 -147
  63. package/IconPicker/IconPicker.mdx +66 -64
  64. package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
  65. package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
  66. package/Image/Image.js.map +1 -1
  67. package/Input/Input.mdx +67 -56
  68. package/Input/InputPrimitive.d.ts +1 -1
  69. package/Label/Label.d.ts +1 -1
  70. package/Label/Label.js.map +1 -1
  71. package/Label/Label.mdx +42 -42
  72. package/Label/components/LabelDescription.d.ts +1 -1
  73. package/Label/components/LabelRequired.d.ts +1 -1
  74. package/Label/components/LabelValue.d.ts +1 -1
  75. package/Link/Link.d.ts +1 -1
  76. package/Link/Link.mdx +129 -116
  77. package/List/List.d.ts +1 -1
  78. package/List/List.js.map +1 -1
  79. package/List/List.mdx +317 -329
  80. package/List/components/ListItem.d.ts +1 -1
  81. package/List/components/ListItem.js.map +1 -1
  82. package/Loader/Loader.d.ts +2 -2
  83. package/Loader/Loader.js.map +1 -1
  84. package/Loader/Loader.mdx +96 -91
  85. package/MultiAutoComplete/MultiAutoComplete.mdx +52 -51
  86. package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.d.ts +1 -1
  87. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenter.js.map +1 -1
  88. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenterWithUniqueValues.js.map +1 -1
  89. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.js.map +1 -1
  90. package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js.map +1 -1
  91. package/MultiFilePicker/MultiFilePicker.mdx +84 -80
  92. package/MultiFilePicker/primitives/MultiFilePickerPrimitive.js.map +1 -1
  93. package/Popover/Popover.mdx +112 -118
  94. package/Popover/primitives/components/PopoverArrow.d.ts +1 -1
  95. package/Popover/primitives/components/PopoverContent.d.ts +1 -1
  96. package/RadioGroup/RadioGroup.mdx +62 -59
  97. package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
  98. package/RangeSlider/RangeSlider.mdx +48 -47
  99. package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
  100. package/RangeSlider/primitives/components/RangeSliderValue.d.ts +1 -1
  101. package/RangeSlider/primitives/components/RangeSliderValue.js.map +1 -1
  102. package/ScrollArea/ScrollArea.js.map +1 -1
  103. package/SegmentedControl/SegmentedControl.mdx +59 -59
  104. package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
  105. package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
  106. package/Select/Select.mdx +52 -43
  107. package/Select/primitives/components/SelectTrigger.d.ts +1 -1
  108. package/Select/primitives/components/SelectTrigger.js.map +1 -1
  109. package/Select/primitives/presenters/SelectPresenter.d.ts +1 -1
  110. package/Separator/Separator.d.ts +1 -1
  111. package/Separator/Separator.mdx +139 -150
  112. package/Sidebar/Sidebar.js.map +1 -1
  113. package/Sidebar/Sidebar.mdx +66 -88
  114. package/Sidebar/components/items/SidebarMenuSubItemIndentation.d.ts +1 -1
  115. package/Sidebar/components/items/SidebarMenuSubItemIndentation.js.map +1 -1
  116. package/Skeleton/Skeleton.d.ts +1 -1
  117. package/Skeleton/Skeleton.js.map +1 -1
  118. package/Skeleton/Skeleton.mdx +37 -37
  119. package/Slider/Slider.mdx +48 -47
  120. package/Slider/primitives/SliderPrimitive.js.map +1 -1
  121. package/Slider/primitives/components/SliderSideValue.d.ts +1 -1
  122. package/Slider/primitives/components/SliderSideValue.js.map +1 -1
  123. package/Slider/primitives/components/SliderTooltip.d.ts +1 -1
  124. package/SteppedProgress/components/SteppedProgressIcon.d.ts +1 -1
  125. package/SteppedProgress/components/SteppedProgressIcon.js.map +1 -1
  126. package/SteppedProgress/components/SteppedProgressIndicator.d.ts +1 -1
  127. package/SteppedProgress/components/SteppedProgressIndicator.js.map +1 -1
  128. package/Switch/Switch.mdx +44 -42
  129. package/Switch/primitives/SwitchPrimitive.d.ts +1 -1
  130. package/Table/Table.d.ts +1 -1
  131. package/Table/Table.js.map +1 -1
  132. package/Table/components/Direction.d.ts +1 -1
  133. package/Table/components/Direction.js.map +1 -1
  134. package/Table/components/Header.d.ts +1 -1
  135. package/Table/components/Header.js.map +1 -1
  136. package/Table/components/Resizer.d.ts +1 -1
  137. package/Table/components/Resizer.js.map +1 -1
  138. package/Table/components/Row.d.ts +1 -1
  139. package/Table/components/Row.js.map +1 -1
  140. package/Tabs/Tabs.mdx +297 -292
  141. package/Tabs/components/Content.d.ts +1 -1
  142. package/Tabs/components/List.d.ts +1 -1
  143. package/Tabs/components/Trigger.d.ts +1 -1
  144. package/Tag/Tag.d.ts +1 -1
  145. package/Tag/Tag.js.map +1 -1
  146. package/Tag/Tag.mdx +68 -64
  147. package/Tags/primitives/TagsPrimitive.js.map +1 -1
  148. package/Text/Text.d.ts +1 -1
  149. package/Text/Text.mdx +54 -48
  150. package/Textarea/Textarea.mdx +49 -39
  151. package/Textarea/TextareaPrimitive.d.ts +1 -1
  152. package/Textarea/TextareaPrimitive.js.map +1 -1
  153. package/Toast/Toast.mdx +63 -53
  154. package/Toast/components/ToastRoot.d.ts +1 -1
  155. package/Tooltip/Tooltip.mdx +197 -198
  156. package/Tooltip/components/TooltipArrow.d.ts +1 -1
  157. package/Tooltip/components/TooltipContent.d.ts +1 -1
  158. package/Tree/components/Item.d.ts +1 -1
  159. package/Tree/useTree.d.ts +1 -1
  160. package/Widget/components/WidgetContent.d.ts +1 -1
  161. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"names":["React","Collapsible","CollapsiblePrimitive","cva","cn","useAccordionItemProps","accordionContentVariants","variants","withIcon","true","false","withHandle","compoundVariants","className","defaultVariants","AccordionContent","children","props","itemProps","icon","handle","createElement","Content","Object","assign"],"sources":["AccordionContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport { cva, cn } from \"~/utils.js\";\nimport { useAccordionItemProps } from \"./AccordionItem.js\";\n\nconst accordionContentVariants = cva(\n [\n \"overflow-hidden text-md pr-xxl\",\n \"transition-all\",\n \"data-[state=closed]:animate-collapsible-up\",\n \"data-[state=open]:animate-collapsible-down\"\n ],\n {\n variants: {\n withIcon: {\n true: \"pl-xxl\",\n false: \"pl-md\"\n },\n withHandle: {\n true: \"pl-5\"\n }\n },\n compoundVariants: [\n {\n withIcon: true,\n withHandle: true,\n className: \"pl-14\"\n }\n ],\n defaultVariants: {\n withIcon: false,\n withHandle: false\n }\n }\n);\n\nexport interface AccordionContentProps\n extends React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content> {}\n\nexport const AccordionContent = ({ children, className, ...props }: AccordionContentProps) => {\n const itemProps = useAccordionItemProps();\n const withIcon = !!itemProps.icon;\n const withHandle = !!itemProps.handle;\n\n return (\n <CollapsiblePrimitive.Content\n {...props}\n className={cn(accordionContentVariants({ withHandle, withIcon }), className)}\n >\n <div data-accordion={\"content\"} className=\"pt-sm pb-lg\">\n {children}\n </div>\n </CollapsiblePrimitive.Content>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,IAAIC,oBAAoB,QAAQ,UAAU;AAC9D,SAASC,GAAG,EAAEC,EAAE;AAChB,SAASC,qBAAqB;AAE9B,MAAMC,wBAAwB,GAAGH,GAAG,CAChC,CACI,gCAAgC,EAChC,gBAAgB,EAChB,4CAA4C,EAC5C,4CAA4C,CAC/C,EACD;EACII,QAAQ,EAAE;IACNC,QAAQ,EAAE;MACNC,IAAI,EAAE,QAAQ;MACdC,KAAK,EAAE;IACX,CAAC;IACDC,UAAU,EAAE;MACRF,IAAI,EAAE;IACV;EACJ,CAAC;EACDG,gBAAgB,EAAE,CACd;IACIJ,QAAQ,EAAE,IAAI;IACdG,UAAU,EAAE,IAAI;IAChBE,SAAS,EAAE;EACf,CAAC,CACJ;EACDC,eAAe,EAAE;IACbN,QAAQ,EAAE,KAAK;IACfG,UAAU,EAAE;EAChB;AACJ,CACJ,CAAC;AAKD,OAAO,MAAMI,gBAAgB,GAAGA,CAAC;EAAEC,QAAQ;EAAEH,SAAS;EAAE,GAAGI;AAA6B,CAAC,KAAK;EAC1F,MAAMC,SAAS,GAAGb,qBAAqB,CAAC,CAAC;EACzC,MAAMG,QAAQ,GAAG,CAAC,CAACU,SAAS,CAACC,IAAI;EACjC,MAAMR,UAAU,GAAG,CAAC,CAACO,SAAS,CAACE,MAAM;EAErC,oBACIpB,KAAA,CAAAqB,aAAA,CAACnB,oBAAoB,CAACoB,OAAO,EAAAC,MAAA,CAAAC,MAAA,KACrBP,KAAK;IACTJ,SAAS,EAAET,EAAE,CAACE,wBAAwB,CAAC;MAAEK,UAAU;MAAEH;IAAS,CAAC,CAAC,EAAEK,SAAS;EAAE,iBAE7Eb,KAAA,CAAAqB,aAAA;IAAK,kBAAgB,SAAU;IAACR,SAAS,EAAC;EAAa,GAClDG,QACA,CACqB,CAAC;AAEvC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Collapsible","CollapsiblePrimitive","cva","cn","useAccordionItemProps","accordionContentVariants","variants","withIcon","true","false","withHandle","compoundVariants","className","defaultVariants","AccordionContent","children","props","itemProps","icon","handle","createElement","Content","Object","assign"],"sources":["AccordionContent.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport { cva, cn } from \"~/utils.js\";\nimport { useAccordionItemProps } from \"./AccordionItem.js\";\n\nconst accordionContentVariants = cva(\n [\n \"overflow-hidden text-md pr-xxl\",\n \"transition-all\",\n \"data-[state=closed]:animate-collapsible-up\",\n \"data-[state=open]:animate-collapsible-down\"\n ],\n {\n variants: {\n withIcon: {\n true: \"pl-xxl\",\n false: \"pl-md\"\n },\n withHandle: {\n true: \"pl-5\"\n }\n },\n compoundVariants: [\n {\n withIcon: true,\n withHandle: true,\n className: \"pl-14\"\n }\n ],\n defaultVariants: {\n withIcon: false,\n withHandle: false\n }\n }\n);\n\nexport interface AccordionContentProps extends React.ComponentPropsWithoutRef<\n typeof CollapsiblePrimitive.Content\n> {}\n\nexport const AccordionContent = ({ children, className, ...props }: AccordionContentProps) => {\n const itemProps = useAccordionItemProps();\n const withIcon = !!itemProps.icon;\n const withHandle = !!itemProps.handle;\n\n return (\n <CollapsiblePrimitive.Content\n {...props}\n className={cn(accordionContentVariants({ withHandle, withIcon }), className)}\n >\n <div data-accordion={\"content\"} className=\"pt-sm pb-lg\">\n {children}\n </div>\n </CollapsiblePrimitive.Content>\n );\n};\n"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 @@ import { type ButtonProps } from "../Button/index.js";
4
4
  declare const alertVariants: (props?: ({
5
5
  type?: "info" | "success" | "warning" | "danger" | null | undefined;
6
6
  variant?: "strong" | "subtle" | null | undefined;
7
- } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
9
9
  showCloseButton?: boolean;
10
10
  icon?: React.ReactElement | null;
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","cn","cva","makeDecoratable","withStaticProps","Button","AlertIcon","AlertSwatchBox","AlertPropsProvider","useAlertProps","AlertCloseButton","defaultVariants","useAdminUi","alertVariants","variants","type","info","success","warning","danger","variant","strong","subtle","compoundVariants","className","AlertActionBase","props","alertVariant","createElement","Object","assign","text","size","AlertAction","AlertBase","swatchColor","actions","children","rootRestProps","compileMarkdown","backgroundColor","role","style","Alert","Action"],"sources":["Alert.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useMemo } from \"react\";\nimport { cn, cva, makeDecoratable, type VariantProps, withStaticProps } from \"~/utils.js\";\nimport { Button, type ButtonProps } from \"~/Button/index.js\";\nimport { AlertIcon } from \"./AlertIcon.js\";\nimport { AlertSwatchBox } from \"./AlertSwatchBox.js\";\nimport { AlertPropsProvider, useAlertProps } from \"./AlertPropsProvider.js\";\nimport { AlertCloseButton } from \"./AlertCloseButton.js\";\nimport { defaultVariants } from \"./constants.js\";\nimport { useAdminUi } from \"~/AdminUiProvider/index.js\";\n\nconst alertVariants = cva(\n \"flex gap-sm-plus items-start w-full rounded-lg text-md py-sm-extra pl-md pr-sm-plus [&_a]:font-semibold [&_a]:underline\",\n {\n variants: {\n type: { info: \"\", success: \"\", warning: \"\", danger: \"\" },\n variant: { strong: \"\", subtle: \"\" }\n },\n defaultVariants,\n compoundVariants: [\n {\n type: \"info\",\n variant: \"strong\",\n className: \"bg-neutral-dark text-neutral-light [&_a]:text-neutral-light!\"\n },\n {\n type: \"info\",\n variant: \"subtle\",\n className: \"bg-neutral-dimmed text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"success\",\n variant: \"strong\",\n className: \"bg-secondary text-neutral-light [&_a]:text-neutral-light!\"\n },\n {\n type: \"success\",\n variant: \"subtle\",\n className: \"bg-success-subtle text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"warning\",\n variant: \"strong\",\n className: \"bg-warning text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"warning\",\n variant: \"subtle\",\n className: \"bg-warning-subtle text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"danger\",\n variant: \"strong\",\n className: \"bg-destructive text-neutral-light [&_a]:text-neutral-light!\"\n },\n {\n type: \"danger\",\n variant: \"subtle\",\n className: \"bg-destructive-subtle text-neutral-primary [&_a]:text-neutral-primary!\"\n }\n ]\n }\n);\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {\n showCloseButton?: boolean;\n icon?: React.ReactElement | null;\n onClose?: () => void;\n actions?: React.ReactElement<typeof AlertAction>;\n swatchColor?: string;\n swatchColorIcon?: boolean;\n}\n\nconst AlertActionBase = (props: ButtonProps) => {\n const { variant: alertVariant } = useAlertProps();\n return (\n <Button\n text={\"Button\"}\n variant={alertVariant === \"strong\" ? \"secondary\" : \"tertiary\"}\n size={\"sm\"}\n {...props}\n />\n );\n};\n\nconst AlertAction = makeDecoratable(\"AlertAction\", AlertActionBase);\n\nconst AlertBase = (props: AlertProps) => {\n const { className, type, variant, swatchColor, actions, children, ...rootRestProps } = props;\n const { compileMarkdown } = useAdminUi();\n\n const backgroundColor = useMemo(() => {\n if (!swatchColor) {\n return;\n }\n\n return swatchColor + \"66\";\n }, [swatchColor]);\n\n return (\n <AlertPropsProvider props={props}>\n <div\n role=\"alert\"\n className={cn(alertVariants({ type, variant }), className)}\n style={{ backgroundColor }}\n {...rootRestProps}\n >\n <AlertSwatchBox />\n <AlertIcon />\n <div className={\"grow py-xxs\"}>{compileMarkdown(children)}</div>\n {actions && <div className={\"flex gap-sm\"}>{actions}</div>}\n <AlertCloseButton />\n </div>\n </AlertPropsProvider>\n );\n};\n\nconst Alert = withStaticProps(makeDecoratable(\"AlertBase\", AlertBase), {\n Action: AlertAction\n});\n\nexport { Alert };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,OAAO,QAAQ,OAAO;AAC/B,SAASC,EAAE,EAAEC,GAAG,EAAEC,eAAe,EAAqBC,eAAe;AACrE,SAASC,MAAM;AACf,SAASC,SAAS;AAClB,SAASC,cAAc;AACvB,SAASC,kBAAkB,EAAEC,aAAa;AAC1C,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,UAAU;AAEnB,MAAMC,aAAa,GAAGX,GAAG,CACrB,yHAAyH,EACzH;EACIY,QAAQ,EAAE;IACNC,IAAI,EAAE;MAAEC,IAAI,EAAE,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,MAAM,EAAE;IAAG,CAAC;IACxDC,OAAO,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEC,MAAM,EAAE;IAAG;EACtC,CAAC;EACDX,eAAe;EACfY,gBAAgB,EAAE,CACd;IACIR,IAAI,EAAE,MAAM;IACZK,OAAO,EAAE,QAAQ;IACjBI,SAAS,EAAE;EACf,CAAC,EACD;IACIT,IAAI,EAAE,MAAM;IACZK,OAAO,EAAE,QAAQ;IACjBI,SAAS,EAAE;EACf,CAAC,EACD;IACIT,IAAI,EAAE,SAAS;IACfK,OAAO,EAAE,QAAQ;IACjBI,SAAS,EAAE;EACf,CAAC,EACD;IACIT,IAAI,EAAE,SAAS;IACfK,OAAO,EAAE,QAAQ;IACjBI,SAAS,EAAE;EACf,CAAC,EACD;IACIT,IAAI,EAAE,SAAS;IACfK,OAAO,EAAE,QAAQ;I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;IACIW,IAAI,EAAC,OAAO;IACZjB,SAAS,EAAEvB,EAAE,CAACY,aAAa,CAAC;MAAEE,IAAI;MAAEK;IAAQ,CAAC,CAAC,EAAEI,SAAS,CAAE;IAC3DkB,KAAK,EAAE;MAAEF;IAAgB;EAAE,GACvBF,aAAa,gBAEjBvC,KAAA,CAAA6B,aAAA,CAACrB,cAAc,MAAE,CAAC,eAClBR,KAAA,CAAA6B,aAAA,CAACtB,SAAS,MAAE,CAAC,eACbP,KAAA,CAAA6B,aAAA;IAAKJ,SAAS,EAAE;EAAc,GAAEe,eAAe,CAACF,QAAQ,CAAO,CAAC,EAC/DD,OAAO,iBAAIrC,KAAA,CAAA6B,aAAA;IAAKJ,SAAS,EAAE;EAAc,GAAEY,OAAa,CAAC,eAC1DrC,KAAA,CAAA6B,aAAA,CAAClB,gBAAgB,MAAE,CAClB,CACW,CAAC;AAE7B,CAAC;AAED,MAAMiC,KAAK,GAAGvC,eAAe,CAACD,eAAe,CAAC,WAAW,EAAE+B,SAAS,CAAC,EAAE;EACnEU,MAAM,EAAEX;AACZ,CAAC,CAAC;AAEF,SAASU,KAAK","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","cn","cva","makeDecoratable","withStaticProps","Button","AlertIcon","AlertSwatchBox","AlertPropsProvider","useAlertProps","AlertCloseButton","defaultVariants","useAdminUi","alertVariants","variants","type","info","success","warning","danger","variant","strong","subtle","compoundVariants","className","AlertActionBase","props","alertVariant","createElement","Object","assign","text","size","AlertAction","AlertBase","swatchColor","actions","children","rootRestProps","compileMarkdown","backgroundColor","role","style","Alert","Action"],"sources":["Alert.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useMemo } from \"react\";\nimport { cn, cva, makeDecoratable, type VariantProps, withStaticProps } from \"~/utils.js\";\nimport { Button, type ButtonProps } from \"~/Button/index.js\";\nimport { AlertIcon } from \"./AlertIcon.js\";\nimport { AlertSwatchBox } from \"./AlertSwatchBox.js\";\nimport { AlertPropsProvider, useAlertProps } from \"./AlertPropsProvider.js\";\nimport { AlertCloseButton } from \"./AlertCloseButton.js\";\nimport { defaultVariants } from \"./constants.js\";\nimport { useAdminUi } from \"~/AdminUiProvider/index.js\";\n\nconst alertVariants = cva(\n \"flex gap-sm-plus items-start w-full rounded-lg text-md py-sm-extra pl-md pr-sm-plus [&_a]:font-semibold [&_a]:underline\",\n {\n variants: {\n type: { info: \"\", success: \"\", warning: \"\", danger: \"\" },\n variant: { strong: \"\", subtle: \"\" }\n },\n defaultVariants,\n compoundVariants: [\n {\n type: \"info\",\n variant: \"strong\",\n className: \"bg-neutral-dark text-neutral-light [&_a]:text-neutral-light!\"\n },\n {\n type: \"info\",\n variant: \"subtle\",\n className: \"bg-neutral-dimmed text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"success\",\n variant: \"strong\",\n className: \"bg-secondary text-neutral-light [&_a]:text-neutral-light!\"\n },\n {\n type: \"success\",\n variant: \"subtle\",\n className: \"bg-success-subtle text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"warning\",\n variant: \"strong\",\n className: \"bg-warning text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"warning\",\n variant: \"subtle\",\n className: \"bg-warning-subtle text-neutral-primary [&_a]:text-neutral-primary!\"\n },\n {\n type: \"danger\",\n variant: \"strong\",\n className: \"bg-destructive text-neutral-light [&_a]:text-neutral-light!\"\n },\n {\n type: \"danger\",\n variant: \"subtle\",\n className: \"bg-destructive-subtle text-neutral-primary [&_a]:text-neutral-primary!\"\n }\n ]\n }\n);\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {\n showCloseButton?: boolean;\n icon?: React.ReactElement | null;\n onClose?: () => void;\n actions?: React.ReactElement<typeof AlertAction>;\n swatchColor?: string;\n swatchColorIcon?: boolean;\n}\n\nconst AlertActionBase = (props: ButtonProps) => {\n const { variant: alertVariant } = useAlertProps();\n return (\n <Button\n text={\"Button\"}\n variant={alertVariant === \"strong\" ? \"secondary\" : \"tertiary\"}\n size={\"sm\"}\n {...props}\n />\n );\n};\n\nconst AlertAction = makeDecoratable(\"AlertAction\", AlertActionBase);\n\nconst AlertBase = (props: AlertProps) => {\n const { className, type, variant, swatchColor, actions, children, ...rootRestProps } = props;\n const { compileMarkdown } = useAdminUi();\n\n const backgroundColor = useMemo(() => {\n if (!swatchColor) {\n return;\n }\n\n return swatchColor + \"66\";\n }, [swatchColor]);\n\n return (\n <AlertPropsProvider props={props}>\n <div\n role=\"alert\"\n className={cn(alertVariants({ type, variant }), className)}\n style={{ backgroundColor }}\n {...rootRestProps}\n >\n <AlertSwatchBox />\n <AlertIcon />\n <div className={\"grow py-xxs\"}>{compileMarkdown(children)}</div>\n {actions && <div className={\"flex gap-sm\"}>{actions}</div>}\n <AlertCloseButton />\n </div>\n </AlertPropsProvider>\n );\n};\n\nconst Alert = withStaticProps(makeDecoratable(\"AlertBase\", AlertBase), {\n Action: AlertAction\n});\n\nexport { Alert };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,OAAO,QAAQ,OAAO;AAC/B,SAASC,EAAE,EAAEC,GAAG,EAAEC,eAAe,EAAqBC,eAAe;AACrE,SAASC,MAAM;AACf,SAASC,SAAS;AAClB,SAASC,cAAc;AACvB,SAASC,kBAAkB,EAAEC,aAAa;AAC1C,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,UAAU;AAEnB,MAAMC,aAAa,GAAGX,GAAG,CACrB,yHAAyH,EACzH;EACIY,QAAQ,EAAE;IACNC,IAAI,EAAE;MAAEC,IAAI,EAAE,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,OAAO,EAAE,EAAE;MAAEC,MAAM,EAAE;IAAG,CAAC;IACxDC,OAAO,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEC,MAAM,EAAE;IAAG;EACtC,CAAC;EACDX,eAAe;EACfY,gBAAgB,EAAE,CACd;IACIR,IAAI,E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,GAAGZ,KAAK;EAC5F,MAAM;IAAEa;EAAgB,CAAC,GAAG3B,UAAU,CAAC,CAAC;EAExC,MAAM4B,eAAe,GAAGxC,OAAO,CAAC,MAAM;IAClC,IAAI,CAACmC,WAAW,EAAE;MACd;IACJ;IAEA,OAAOA,WAAW,GAAG,IAAI;EAC7B,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAEjB,oBACIpC,KAAA,CAAA6B,aAAA,CAACpB,kBAAkB;IAACkB,KAAK,EAAEA;EAAM,gBAC7B3B,KAAA,CAAA6B,aAAA,QAAAC,MAAA,CAAAC,MAAA;IACIW,IAAI,EAAC,OAAO;IACZjB,SAAS,EAAEvB,EAAE,CAACY,aAAa,CAAC;MAAEE,IAAI;MAAEK;IAAQ,CAAC,CAAC,EAAEI,SAAS,CAAE;IAC3DkB,KAAK,EAAE;MAAEF;IAAgB;EAAE,GACvBF,aAAa,gBAEjBvC,KAAA,CAAA6B,aAAA,CAACrB,cAAc,MAAE,CAAC,eAClBR,KAAA,CAAA6B,aAAA,CAACtB,SAAS,MAAE,CAAC,eACbP,KAAA,CAAA6B,aAAA;IAAKJ,SAAS,EAAE;EAAc,GAAEe,eAAe,CAACF,QAAQ,CAAO,CAAC,EAC/DD,OAAO,iBAAIrC,KAAA,CAAA6B,aAAA;IAAKJ,SAAS,EAAE;EAAc,GAAEY,OAAa,CAAC,eAC1DrC,KAAA,CAAA6B,aAAA,CAAClB,gBAAgB,MAAE,CAClB,CACW,CAAC;AAE7B,CAAC;AAED,MAAMiC,KAAK,GAAGvC,eAAe,CAACD,eAAe,CAAC,WAAW,EAAE+B,SAAS,CAAC,EAAE;EACnEU,MAAM,EAAEX;AACZ,CAAC,CAAC;AAEF,SAASU,KAAK","ignoreList":[]}
package/Alert/Alert.mdx CHANGED
@@ -1,6 +1,6 @@
1
- import { Canvas, Meta, Controls } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
2
2
 
3
- import * as AlertStories from './Alert.stories';
3
+ import * as AlertStories from "./Alert.stories";
4
4
 
5
5
  <Meta of={AlertStories} />
6
6
 
@@ -18,33 +18,33 @@ import React from "react";
18
18
  import { Alert } from "@webiny/admin-ui";
19
19
 
20
20
  const AlertExample = () => {
21
- return (
22
- <Alert type={"info"}>
23
- <>
24
- This type of notification is suitable for general usage where there’s no need for
25
- accent. And <a href={"#"}>this thing here</a> is a short link.
26
- </>
27
- </Alert>
28
- );
29
- };
21
+ return (
22
+
23
+ <Alert type={"info"}>
24
+ <>
25
+ This type of notification is suitable for general usage where there’s no need for accent. And{" "}
26
+ <a href={"#"}>this thing here</a> is a short link.
27
+ </>
28
+ </Alert>
29
+ ); };
30
30
 
31
31
  export default AlertExample;
32
32
 
33
33
  ` } }
34
- additionalActions={[
35
- {
36
- title: 'Open in GitHub',
37
- onClick: () => {
38
- window.open(
39
- 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Alert/Alert.tsx',
40
- '_blank'
41
- );
42
- },
43
- }
44
- ]}
34
+ additionalActions={[
35
+ {
36
+ title: 'Open in GitHub',
37
+ onClick: () => {
38
+ window.open(
39
+ 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Alert/Alert.tsx',
40
+ '_blank'
41
+ );
42
+ },
43
+ }
44
+ ]}
45
45
  />
46
46
 
47
- <Controls of={AlertStories.Documentation} exclude={"children"}/>
47
+ <Controls of={AlertStories.Documentation} exclude={"children"} />
48
48
 
49
49
  ```tsx
50
50
  import React from "react";
@@ -52,14 +52,14 @@ import React from "react";
52
52
  import { Alert } from "@webiny/admin-ui";
53
53
 
54
54
  const AlertExample = () => {
55
- return (
56
- <Alert type={"info"}>
57
- <>
58
- This type of notification is suitable for general usage where there’s no need for
59
- accent. And <a href={"#"}>this thing here</a> is a short link.
60
- </>
61
- </Alert>
62
- );
55
+ return (
56
+ <Alert type={"info"}>
57
+ <>
58
+ This type of notification is suitable for general usage where there’s no need for accent.
59
+ And <a href={"#"}>this thing here</a> is a short link.
60
+ </>
61
+ </Alert>
62
+ );
63
63
  };
64
64
 
65
65
  export default AlertExample;
@@ -72,121 +72,118 @@ export default AlertExample;
72
72
  <Canvas of={AlertStories.Info} source={ { code: `
73
73
  // Code for an Info banner
74
74
 
75
- import { Alert } from '@webiny/admin-ui';
75
+ import { Alert } from "@webiny/admin-ui";
76
76
 
77
77
  <Alert type={"info"}>
78
- <>
79
- This type of notification is suitable for general usage where there’s no need for
80
- accent. And <a href={"#"}>this thing here</a> is a short link.
81
- </>
78
+ <>
79
+ This type of notification is suitable for general usage where there’s no need for accent. And{" "}
80
+ <a href={"#"}>this thing here</a> is a short link.
81
+ </>
82
82
  </Alert>
83
- ` } }
84
- />
83
+ ` } } />
85
84
 
86
85
  ### Success
87
86
 
88
87
  <Canvas of={AlertStories.Success} source={ { code: `
89
88
  // Code for a Success banner
90
89
 
91
- import { Alert } from '@webiny/admin-ui';
90
+ import { Alert } from "@webiny/admin-ui";
92
91
 
93
92
  <Alert type={"success"}>
94
- <>
95
- This is a success alert, used when something occurred successfully. And{" "}
96
- <a href={"#"}>this thing here</a> is a short link.
97
- </>
93
+ <>
94
+ This is a success alert, used when something occurred successfully. And{" "}
95
+ <a href={"#"}>this thing here</a> is a short link.
96
+ </>
98
97
  </Alert>
99
- ` } }
100
- />
101
-
98
+ ` } } />
102
99
 
103
100
  ### Warning
104
101
 
105
102
  <Canvas of={AlertStories.Warning} source={ { code: `
106
103
  // Code for a Warning banner
107
104
 
108
- import { Alert } from '@webiny/admin-ui';
105
+ import { Alert } from "@webiny/admin-ui";
109
106
 
110
107
  <Alert type={"warning"}>
111
- <>
112
- This is a warning alert, used when something of strong relevance needs to be
113
- communicated. And <a href={"#"}>this thing here</a> is a short link.
114
- </>
108
+ <>
109
+ This is a warning alert, used when something of strong relevance needs to be communicated. And{" "}
110
+ <a href={"#"}>this thing here</a> is a short link.
111
+ </>
115
112
  </Alert>
116
- ` } }
117
- />
113
+ ` } } />
118
114
 
119
115
  ### Danger
120
116
 
121
117
  <Canvas of={AlertStories.Danger} source={ { code: `
122
118
  // Code for a Danger banner
123
119
 
124
- import { Alert } from '@webiny/admin-ui';
120
+ import { Alert } from "@webiny/admin-ui";
125
121
 
126
122
  <Alert type={"danger"}>
127
- <>
128
- This is a danger alert, used when something critical needs to be communicated. And{" "}
129
- <a href={"#"}>this thing here</a> is a short link.
130
- </>
123
+ <>
124
+ This is a danger alert, used when something critical needs to be communicated. And{" "}
125
+ <a href={"#"}>this thing here</a> is a short link.
126
+ </>
131
127
  </Alert>
132
- ` } }
133
- />
128
+ ` } } />
134
129
 
135
130
  ### With Close Button
136
131
 
137
132
  <Canvas of={AlertStories.WithCloseButton} source={ { code: `
138
133
  // Code for a banner with a Close Button and an onClose action
139
134
 
140
- import { Alert } from '@webiny/admin-ui';
135
+ import { Alert } from "@webiny/admin-ui";
141
136
 
142
137
  <Alert type={"info"} showCloseButton={true} onClose={() => alert("Close button clicked.")}>
143
- <>
144
- An alert that can be closed.
145
- </>
138
+ <>An alert that can be closed.</>
146
139
  </Alert>
147
- ` } }
148
- />
140
+ ` } } />
149
141
 
150
142
  ### With Action
151
143
 
152
144
  <Canvas of={AlertStories.WithAction} source={ { code: `
153
145
  // Code for a banner with a close button and a action button
154
146
 
155
- import { Alert } from '@webiny/admin-ui';
147
+ import { Alert } from "@webiny/admin-ui";
156
148
 
157
- <Alert type={"info"} showCloseButton={true} onClose={() => alert("Close button clicked.")}
158
- actions={(
159
- <Alert.Action text={"Button"} onClick={() => alert("Custom action button clicked.")} />
160
- )}>
161
- <>
162
- An alert that can be closed and also has action button.
163
- </>
149
+ <Alert
150
+ type={"info"}
151
+ showCloseButton={true}
152
+ onClose={() => alert("Close button clicked.")}
153
+ actions={<Alert.Action text={"Button"} onClick={() => alert("Custom action button clicked.")} />}
154
+ >
155
+ <>An alert that can be closed and also has action button.</>
164
156
  </Alert>
165
- ` } }
166
- />
157
+ ` } } />
167
158
 
168
159
  ## Anatomy
169
160
 
170
161
  ### Options
171
- <img src="/images/storybook/alert/options.png" alt="Options"/>
162
+
163
+ <img src="/images/storybook/alert/options.png" alt="Options" />
172
164
 
173
165
  ### Style
174
- <img src="/images/storybook/alert/style.png" alt="Style"/>
166
+
167
+ <img src="/images/storybook/alert/style.png" alt="Style" />
175
168
 
176
169
  ### Type
177
- <img src="/images/storybook/alert/type.png" alt="Type"/>
170
+
171
+ <img src="/images/storybook/alert/type.png" alt="Type" />
178
172
 
179
173
  ### Examples
180
- <img src="/images/storybook/alert/examples.png" alt="Examples"/>
174
+
175
+ <img src="/images/storybook/alert/examples.png" alt="Examples" />
181
176
 
182
177
  ## Usage
183
178
 
184
179
  ### Full width banner
185
- <img src="/images/storybook/alert/full-width-banner.png" alt="Full width banner"/>
186
180
 
181
+ <img src="/images/storybook/alert/full-width-banner.png" alt="Full width banner" />
187
182
 
188
183
  ### Floating element
189
- <img src="/images/storybook/alert/floating-element.png" alt="Floating element"/>
184
+
185
+ <img src="/images/storybook/alert/floating-element.png" alt="Floating element" />
190
186
 
191
187
  ### Nested element
192
- <img src="/images/storybook/alert/nested-element.png" alt="Nested element"/>
188
+
189
+ <img src="/images/storybook/alert/nested-element.png" alt="Nested element" />
@@ -1,6 +1,6 @@
1
- import { Canvas, Meta, Controls } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
2
2
 
3
- import * as AutoCompleteStories from './AutoComplete.stories';
3
+ import * as AutoCompleteStories from "./AutoComplete.stories";
4
4
 
5
5
  <Meta of={AutoCompleteStories} />
6
6
 
@@ -15,8 +15,8 @@ import React, { useState } from "react";
15
15
  import { AutoComplete } from "@webiny/admin-ui";
16
16
 
17
17
  const TimezoneSelector = () => {
18
- const [value, setValue] = useState("");
19
- const [validation, setValidation] = useState({ isValid: true, message: "" });
18
+ const [value, setValue] = useState("");
19
+ const [validation, setValidation] = useState({ isValid: true, message: "" });
20
20
 
21
21
  const handleValueChange = (newValue: string) => {
22
22
  setValue(newValue);
@@ -47,63 +47,64 @@ const TimezoneSelector = () => {
47
47
  validation={validation}
48
48
  />
49
49
  );
50
+
50
51
  };
51
52
 
52
53
  export default TimezoneSelector;
53
54
 
54
55
  ` } }
55
- additionalActions={[
56
- {
57
- title: 'Open in GitHub',
58
- onClick: () => {
59
- window.open(
60
- 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/AutoComplete/AutoComplete.tsx',
61
- '_blank'
62
- );
63
- },
64
- }
65
- ]}
56
+ additionalActions={[
57
+ {
58
+ title: 'Open in GitHub',
59
+ onClick: () => {
60
+ window.open(
61
+ 'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/AutoComplete/AutoComplete.tsx',
62
+ '_blank'
63
+ );
64
+ },
65
+ }
66
+ ]}
66
67
  />
67
68
 
68
- <Controls of={AutoCompleteStories.Documentation}/>
69
+ <Controls of={AutoCompleteStories.Documentation} />
69
70
 
70
71
  ```tsx
71
72
  import React, { useState } from "react";
72
73
  import { AutoComplete } from "@webiny/admin-ui";
73
74
 
74
75
  const TimezoneSelector = () => {
75
- const [value, setValue] = useState("");
76
- const [validation, setValidation] = useState({ isValid: true, message: "" });
77
-
78
- const handleValueChange = (newValue: string) => {
79
- setValue(newValue);
80
-
81
- if (!newValue) {
82
- setValidation({ isValid: false, message: "This field is required" });
83
- } else {
84
- setValidation({ isValid: true, message: "" });
85
- }
86
- };
87
-
88
- const timezones = [
89
- "Eastern Standard Time (EST)",
90
- "Central Standard Time (CST)",
91
- "Pacific Standard Time (PST)",
92
- "Greenwich Mean Time (GMT)"
93
- ];
94
-
95
- return (
96
- <AutoComplete
97
- label="Time Zone"
98
- required={true}
99
- description="Select your timezone from the list"
100
- placeholder="Select timezone..."
101
- options={timezones}
102
- value={value}
103
- onValueChange={handleValueChange}
104
- validation={validation}
105
- />
106
- );
76
+ const [value, setValue] = useState("");
77
+ const [validation, setValidation] = useState({ isValid: true, message: "" });
78
+
79
+ const handleValueChange = (newValue: string) => {
80
+ setValue(newValue);
81
+
82
+ if (!newValue) {
83
+ setValidation({ isValid: false, message: "This field is required" });
84
+ } else {
85
+ setValidation({ isValid: true, message: "" });
86
+ }
87
+ };
88
+
89
+ const timezones = [
90
+ "Eastern Standard Time (EST)",
91
+ "Central Standard Time (CST)",
92
+ "Pacific Standard Time (PST)",
93
+ "Greenwich Mean Time (GMT)"
94
+ ];
95
+
96
+ return (
97
+ <AutoComplete
98
+ label="Time Zone"
99
+ required={true}
100
+ description="Select your timezone from the list"
101
+ placeholder="Select timezone..."
102
+ options={timezones}
103
+ value={value}
104
+ onValueChange={handleValueChange}
105
+ validation={validation}
106
+ />
107
+ );
107
108
  };
108
109
 
109
110
  export default TimezoneSelector;
@@ -112,24 +113,31 @@ export default TimezoneSelector;
112
113
  ## Anatomy
113
114
 
114
115
  ### Input Anatomy
115
- <img src="/images/storybook/autocomplete/input-anatomy.png" alt="Input Anatomy"/>
116
+
117
+ <img src="/images/storybook/autocomplete/input-anatomy.png" alt="Input Anatomy" />
116
118
 
117
119
  ### Style
118
- <img src="/images/storybook/autocomplete/style.png" alt="Style"/>
120
+
121
+ <img src="/images/storybook/autocomplete/style.png" alt="Style" />
119
122
 
120
123
  ### Option
121
- <img src="/images/storybook/autocomplete/option.png" alt="Option"/>
124
+
125
+ <img src="/images/storybook/autocomplete/option.png" alt="Option" />
122
126
 
123
127
  ### States and Styles
124
- <img src="/images/storybook/autocomplete/states-and-styles.png" alt="States and Styles"/>
128
+
129
+ <img src="/images/storybook/autocomplete/states-and-styles.png" alt="States and Styles" />
125
130
 
126
131
  ### Label Anatomy
127
- <img src="/images/storybook/autocomplete/label-anatomy.png" alt="Label Anatomy"/>
132
+
133
+ <img src="/images/storybook/autocomplete/label-anatomy.png" alt="Label Anatomy" />
128
134
 
129
135
  ### Label Properties
130
- <img src="/images/storybook/autocomplete/label-properties.png" alt="Label Properties"/>
136
+
137
+ <img src="/images/storybook/autocomplete/label-properties.png" alt="Label Properties" />
131
138
 
132
139
  ## Usage
133
140
 
134
141
  ### Used in forms
135
- <img src="/images/storybook/autocomplete/used-in-forms.png" alt="Used in forms"/>
142
+
143
+ <img src="/images/storybook/autocomplete/used-in-forms.png" alt="Used in forms" />
@@ -9,7 +9,7 @@ interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimit
9
9
  declare const avatarVariants: (props?: ({
10
10
  size?: "sm" | "md" | "lg" | "xl" | null | undefined;
11
11
  variant?: "strong" | "light" | "subtle" | "quiet" | "outlined" | null | undefined;
12
- } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
13
  declare const Avatar: (({ image, fallback, className, size, variant, ...props }: AvatarProps) => React.JSX.Element) & {
14
14
  original: ({ image, fallback, className, size, variant, ...props }: AvatarProps) => React.JSX.Element;
15
15
  originalName: string;
@@ -1 +1 @@
1
- {"version":3,"names":["React","Avatar","AvatarPrimitive","withStaticProps","cn","makeDecoratable","cva","AvatarFallback","AvatarImage","avatarVariants","variants","size","sm","md","lg","xl","variant","strong","subtle","light","quiet","outlined","defaultVariants","AvatarBase","image","fallback","className","props","createElement","Root","Object","assign","Fallback","Image"],"sources":["Avatar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { withStaticProps, cn, makeDecoratable, cva, type VariantProps } from \"~/utils.js\";\nimport {\n AvatarFallback,\n AvatarImage,\n type AvatarFallbackProps,\n type AvatarImageProps\n} from \"./components/index.js\";\n\ninterface AvatarProps\n extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n image?: React.ReactElement<AvatarImageProps>;\n fallback?: React.ReactElement<AvatarFallbackProps>;\n}\n\nconst avatarVariants = cva(\"relative flex shrink-0 overflow-hidden\", {\n variants: {\n size: {\n sm: \"text-h6 rounded-sm size-lg [&_svg]:size-md\",\n md: \"text-h6 rounded-md size-xl [&_svg]:size-lg\",\n lg: \"text-h6 rounded-md size-[40px] [&_svg]:size-lg\",\n xl: \"text-h4 rounded-lg size-xxl [&_svg]:size-lg\"\n },\n variant: {\n strong: \"bg-primary text-neutral-light [&_svg]:fill-neutral-base\",\n subtle: \"bg-neutral-light text-neutral-primary [&_svg]:fill-neutral-xstrong\",\n light: \"bg-neutral-dimmed text-neutral-primary [&_svg]:fill-neutral-xstrong\",\n quiet: \"bg-transparent text-neutral-primary [&_svg]:fill-neutral-xstrong\",\n outlined:\n \"bg-neutral-base border-neutral-muted! border-sm text-accent-primary [&_svg]:fill-neutral-xstrong\"\n }\n },\n defaultVariants: {\n size: \"md\",\n variant: \"strong\"\n }\n});\n\nconst AvatarBase = ({ image, fallback, className, size, variant, ...props }: AvatarProps) => {\n return (\n <AvatarPrimitive.Root\n className={cn(avatarVariants({ variant, size }), className)}\n {...props}\n >\n {image}\n {fallback}\n </AvatarPrimitive.Root>\n );\n};\n\nconst Avatar = withStaticProps(makeDecoratable(\"Avatar\", AvatarBase), {\n Fallback: AvatarFallback,\n Image: AvatarImage\n});\n\nexport { Avatar, type AvatarProps, type AvatarImageProps, type AvatarFallbackProps };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,IAAIC,eAAe,QAAQ,UAAU;AACpD,SAASC,eAAe,EAAEC,EAAE,EAAEC,eAAe,EAAEC,GAAG;AAClD,SACIC,cAAc,EACdC,WAAW;AAYf,MAAMC,cAAc,GAAGH,GAAG,CAAC,wCAAwC,EAAE;EACjEI,QAAQ,EAAE;IACNC,IAAI,EAAE;MACFC,EAAE,EAAE,4CAA4C;MAChDC,EAAE,EAAE,4CAA4C;MAChDC,EAAE,EAAE,gDAAgD;MACpDC,EAAE,EAAE;IACR,CAAC;IACDC,OAAO,EAAE;MACLC,MAAM,EAAE,yDAAyD;MACjEC,MAAM,EAAE,oEAAoE;MAC5EC,KAAK,EAAE,qEAAqE;MAC5EC,KAAK,EAAE,kEAAkE;MACzEC,QAAQ,EACJ;IACR;EACJ,CAAC;EACDC,eAAe,EAAE;IACbX,IAAI,EAAE,IAAI;IACVK,OAAO,EAAE;EACb;AACJ,CAAC,CAAC;AAEF,MAAMO,UAAU,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,SAAS;EAAEf,IAAI;EAAEK,OAAO;EAAE,GAAGW;AAAmB,CAAC,KAAK;EACzF,oBACI3B,KAAA,CAAA4B,aAAA,CAAC1B,eAAe,CAAC2B,IAAI,EAAAC,MAAA,CAAAC,MAAA;IACjBL,SAAS,EAAEtB,EAAE,CAACK,cAAc,CAAC;MAAEO,OAAO;MAAEL;IAAK,CAAC,CAAC,EAAEe,SAAS;EAAE,GACxDC,KAAK,GAERH,KAAK,EACLC,QACiB,CAAC;AAE/B,CAAC;AAED,MAAMxB,MAAM,GAAGE,eAAe,CAACE,eAAe,CAAC,QAAQ,EAAEkB,UAAU,CAAC,EAAE;EAClES,QAAQ,EAAEzB,cAAc;EACxB0B,KAAK,EAAEzB;AACX,CAAC,CAAC;AAEF,SAASP,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["React","Avatar","AvatarPrimitive","withStaticProps","cn","makeDecoratable","cva","AvatarFallback","AvatarImage","avatarVariants","variants","size","sm","md","lg","xl","variant","strong","subtle","light","quiet","outlined","defaultVariants","AvatarBase","image","fallback","className","props","createElement","Root","Object","assign","Fallback","Image"],"sources":["Avatar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { withStaticProps, cn, makeDecoratable, cva, type VariantProps } from \"~/utils.js\";\nimport {\n AvatarFallback,\n AvatarImage,\n type AvatarFallbackProps,\n type AvatarImageProps\n} from \"./components/index.js\";\n\ninterface AvatarProps\n extends\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n image?: React.ReactElement<AvatarImageProps>;\n fallback?: React.ReactElement<AvatarFallbackProps>;\n}\n\nconst avatarVariants = cva(\"relative flex shrink-0 overflow-hidden\", {\n variants: {\n size: {\n sm: \"text-h6 rounded-sm size-lg [&_svg]:size-md\",\n md: \"text-h6 rounded-md size-xl [&_svg]:size-lg\",\n lg: \"text-h6 rounded-md size-[40px] [&_svg]:size-lg\",\n xl: \"text-h4 rounded-lg size-xxl [&_svg]:size-lg\"\n },\n variant: {\n strong: \"bg-primary text-neutral-light [&_svg]:fill-neutral-base\",\n subtle: \"bg-neutral-light text-neutral-primary [&_svg]:fill-neutral-xstrong\",\n light: \"bg-neutral-dimmed text-neutral-primary [&_svg]:fill-neutral-xstrong\",\n quiet: \"bg-transparent text-neutral-primary [&_svg]:fill-neutral-xstrong\",\n outlined:\n \"bg-neutral-base border-neutral-muted! border-sm text-accent-primary [&_svg]:fill-neutral-xstrong\"\n }\n },\n defaultVariants: {\n size: \"md\",\n variant: \"strong\"\n }\n});\n\nconst AvatarBase = ({ image, fallback, className, size, variant, ...props }: AvatarProps) => {\n return (\n <AvatarPrimitive.Root\n className={cn(avatarVariants({ variant, size }), className)}\n {...props}\n >\n {image}\n {fallback}\n </AvatarPrimitive.Root>\n );\n};\n\nconst Avatar = withStaticProps(makeDecoratable(\"Avatar\", AvatarBase), {\n Fallback: AvatarFallback,\n Image: AvatarImage\n});\n\nexport { Avatar, type AvatarProps, type AvatarImageProps, type AvatarFallbackProps };\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,IAAIC,eAAe,QAAQ,UAAU;AACpD,SAASC,eAAe,EAAEC,EAAE,EAAEC,eAAe,EAAEC,GAAG;AAClD,SACIC,cAAc,EACdC,WAAW;AAaf,MAAMC,cAAc,GAAGH,GAAG,CAAC,wCAAwC,EAAE;EACjEI,QAAQ,EAAE;IACNC,IAAI,EAAE;MACFC,EAAE,EAAE,4CAA4C;MAChDC,EAAE,EAAE,4CAA4C;MAChDC,EAAE,EAAE,gDAAgD;MACpDC,EAAE,EAAE;IACR,CA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