@webiny/ui 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.f6dc066313
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 +2 -2
- package/Accordion/Accordion.js.map +1 -1
- package/Accordion/AccordionItem.d.ts +24 -24
- package/Accordion/AccordionItem.js +1 -1
- package/Accordion/AccordionItem.js.map +1 -1
- package/Accordion/AccordionItemActions.js +2 -2
- package/Accordion/AccordionItemActions.js.map +1 -1
- package/Accordion/index.d.ts +2 -2
- package/Accordion/index.js +2 -2
- package/Accordion/index.js.map +1 -1
- package/Alert/index.d.ts +1 -1
- package/Alert/index.js +1 -1
- package/Alert/index.js.map +1 -1
- package/AutoComplete/AutoComplete.d.ts +1 -1
- package/AutoComplete/AutoComplete.js.map +1 -1
- package/AutoComplete/MultiAutoComplete.d.ts +1 -1
- package/AutoComplete/MultiAutoComplete.js.map +1 -1
- package/AutoComplete/index.d.ts +2 -2
- package/AutoComplete/index.js +2 -2
- package/AutoComplete/index.js.map +1 -1
- package/AutoComplete/types.d.ts +6 -2
- package/AutoComplete/types.js.map +1 -1
- package/Avatar/index.d.ts +1 -1
- package/Avatar/index.js +1 -1
- package/Avatar/index.js.map +1 -1
- package/Button/Button.d.ts +4 -0
- package/Button/Button.js +2 -2
- package/Button/Button.js.map +1 -1
- package/Button/ButtonDefault.d.ts +1 -1
- package/Button/ButtonDefault.js +1 -1
- package/Button/ButtonDefault.js.map +1 -1
- package/Button/ButtonFloating.d.ts +1 -1
- package/Button/ButtonFloating.js +1 -1
- package/Button/ButtonFloating.js.map +1 -1
- package/Button/ButtonIcon.js +1 -1
- package/Button/ButtonIcon.js.map +1 -1
- package/Button/ButtonPrimary.d.ts +1 -1
- package/Button/ButtonPrimary.js +1 -1
- package/Button/ButtonPrimary.js.map +1 -1
- package/Button/ButtonSecondary.d.ts +1 -1
- package/Button/ButtonSecondary.js +1 -1
- package/Button/ButtonSecondary.js.map +1 -1
- package/Button/IconButton.d.ts +1 -1
- package/Button/IconButton.js +1 -1
- package/Button/IconButton.js.map +1 -1
- package/Button/index.d.ts +8 -8
- package/Button/index.js +8 -8
- package/Button/index.js.map +1 -1
- package/Button/useMappedButtonProps.d.ts +4 -4
- package/Button/useMappedButtonProps.js +1 -1
- package/Button/useMappedButtonProps.js.map +1 -1
- package/Carousel/index.d.ts +1 -1
- package/Carousel/index.js +1 -1
- package/Carousel/index.js.map +1 -1
- package/Checkbox/Checkbox.d.ts +1 -1
- package/Checkbox/Checkbox.js.map +1 -1
- package/Checkbox/CheckboxGroup.d.ts +1 -1
- package/Checkbox/CheckboxGroup.js.map +1 -1
- package/Checkbox/index.d.ts +2 -2
- package/Checkbox/index.js +2 -2
- package/Checkbox/index.js.map +1 -1
- package/Chips/Chip.js +1 -1
- package/Chips/Chip.js.map +1 -1
- package/Chips/Chips.d.ts +1 -1
- package/Chips/Chips.js +1 -1
- package/Chips/Chips.js.map +1 -1
- package/Chips/index.d.ts +2 -2
- package/Chips/index.js +2 -2
- package/Chips/index.js.map +1 -1
- package/CodeEditor/CodeEditor.d.ts +1 -1
- package/CodeEditor/CodeEditor.js.map +1 -1
- package/CodeEditor/index.d.ts +1 -1
- package/CodeEditor/index.js +1 -1
- package/CodeEditor/index.js.map +1 -1
- package/ColorPicker/ColorPicker.d.ts +1 -1
- package/ColorPicker/ColorPicker.js.map +1 -1
- package/ColorPicker/index.d.ts +1 -1
- package/ColorPicker/index.js +1 -1
- package/ColorPicker/index.js.map +1 -1
- package/ConfirmationDialog/ConfirmationDialog.js +3 -3
- package/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/ConfirmationDialog/index.d.ts +2 -2
- package/ConfirmationDialog/index.js +2 -2
- package/ConfirmationDialog/index.js.map +1 -1
- package/ConfirmationDialog/withConfirmation.js +1 -1
- package/ConfirmationDialog/withConfirmation.js.map +1 -1
- package/DataTable/index.d.ts +1 -1
- package/DataTable/index.js +1 -1
- package/DataTable/index.js.map +1 -1
- package/DateTime/index.d.ts +1 -1
- package/DateTime/index.js +1 -1
- package/DateTime/index.js.map +1 -1
- package/Dialog/Dialog.js +4 -4
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/index.d.ts +1 -1
- package/Dialog/index.js +1 -1
- package/Dialog/index.js.map +1 -1
- package/Drawer/Drawer.js +1 -1
- package/Drawer/Drawer.js.map +1 -1
- package/Drawer/index.d.ts +1 -1
- package/Drawer/index.js +1 -1
- package/Drawer/index.js.map +1 -1
- package/Elevation/Elevation.js +1 -1
- package/Elevation/Elevation.js.map +1 -1
- package/Elevation/index.d.ts +1 -1
- package/Elevation/index.js +1 -1
- package/Elevation/index.js.map +1 -1
- package/FormElementMessage/index.d.ts +1 -1
- package/FormElementMessage/index.js +1 -1
- package/FormElementMessage/index.js.map +1 -1
- package/FullName/index.d.ts +1 -1
- package/FullName/index.js +1 -1
- package/FullName/index.js.map +1 -1
- package/Grid/Grid.js +1 -1
- package/Grid/Grid.js.map +1 -1
- package/Grid/index.d.ts +1 -1
- package/Grid/index.js +1 -1
- package/Grid/index.js.map +1 -1
- package/Helpers/index.d.ts +1 -1
- package/Helpers/index.js +1 -1
- package/Helpers/index.js.map +1 -1
- package/Icon/Icon.js +1 -1
- package/Icon/Icon.js.map +1 -1
- package/Icon/index.d.ts +1 -1
- package/Icon/index.js +1 -1
- package/Icon/index.js.map +1 -1
- package/ImageEditor/index.d.ts +1 -1
- package/ImageEditor/index.js +1 -1
- package/ImageEditor/index.js.map +1 -1
- package/ImageUpload/ImageEditorDialog.d.ts +1 -1
- package/ImageUpload/ImageEditorDialog.js.map +1 -1
- package/ImageUpload/MultiImageUpload.d.ts +1 -1
- package/ImageUpload/MultiImageUpload.js.map +1 -1
- package/ImageUpload/SingleImageUpload.d.ts +1 -1
- package/ImageUpload/SingleImageUpload.js.map +1 -1
- package/ImageUpload/index.d.ts +4 -4
- package/ImageUpload/index.js +4 -4
- package/ImageUpload/index.js.map +1 -1
- package/Input/Input.d.ts +1 -1
- package/Input/Input.js +1 -1
- package/Input/Input.js.map +1 -1
- package/Input/index.d.ts +1 -1
- package/Input/index.js +1 -1
- package/Input/index.js.map +1 -1
- package/List/DataList/DataList.d.ts +2 -2
- package/List/DataList/DataList.js.map +1 -1
- package/List/DataList/DataListModalOverlay/index.d.ts +2 -3
- package/List/DataList/DataListWithSections.d.ts +3 -3
- package/List/DataList/DataListWithSections.js.map +1 -1
- package/List/DataList/icons/index.d.ts +1 -1
- package/List/DataList/icons/index.js +1 -1
- package/List/DataList/icons/index.js.map +1 -1
- package/List/DataList/index.d.ts +3 -3
- package/List/DataList/index.js +3 -3
- package/List/DataList/index.js.map +1 -1
- package/List/DataList/types.d.ts +1 -1
- package/List/DataList/types.js +1 -1
- package/List/DataList/types.js.map +1 -1
- package/List/List/ListItemAction.js +1 -1
- package/List/List/ListItemAction.js.map +1 -1
- package/List/List/ListItemGraphic.js +1 -1
- package/List/List/ListItemGraphic.js.map +1 -1
- package/List/List/ListItemText.js +1 -1
- package/List/List/ListItemText.js.map +1 -1
- package/List/List/index.d.ts +6 -6
- package/List/List/index.js +6 -6
- package/List/List/index.js.map +1 -1
- package/List/index.d.ts +4 -4
- package/List/index.js +4 -4
- package/List/index.js.map +1 -1
- package/Menu/Menu.js +8 -5
- package/Menu/Menu.js.map +1 -1
- package/Menu/index.d.ts +1 -1
- package/Menu/index.js +1 -1
- package/Menu/index.js.map +1 -1
- package/Mosaic/index.d.ts +1 -1
- package/Mosaic/index.js +1 -1
- package/Mosaic/index.js.map +1 -1
- package/Progress/index.d.ts +1 -1
- package/Progress/index.js +1 -1
- package/Progress/index.js.map +1 -1
- package/README.md +6 -21
- package/Radio/Radio.d.ts +1 -1
- package/Radio/Radio.js +1 -1
- package/Radio/Radio.js.map +1 -1
- package/Radio/RadioGroup.d.ts +1 -1
- package/Radio/RadioGroup.js.map +1 -1
- package/Radio/index.d.ts +2 -2
- package/Radio/index.js +2 -2
- package/Radio/index.js.map +1 -1
- package/Ripple/index.d.ts +1 -1
- package/Ripple/index.js +1 -1
- package/Ripple/index.js.map +1 -1
- package/Scrollbar/index.d.ts +1 -1
- package/Scrollbar/index.js +1 -1
- package/Scrollbar/index.js.map +1 -1
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js.map +1 -1
- package/Select/index.d.ts +1 -1
- package/Select/index.js +1 -1
- package/Select/index.js.map +1 -1
- package/Skeleton/index.d.ts +1 -1
- package/Skeleton/index.js +1 -1
- package/Skeleton/index.js.map +1 -1
- package/Slider/Slider.d.ts +1 -1
- package/Slider/Slider.js +1 -1
- package/Slider/Slider.js.map +1 -1
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +1 -1
- package/Slider/index.js.map +1 -1
- package/Snackbar/index.d.ts +1 -1
- package/Snackbar/index.js +1 -1
- package/Snackbar/index.js.map +1 -1
- package/Switch/Switch.d.ts +1 -1
- package/Switch/Switch.js.map +1 -1
- package/Switch/index.d.ts +1 -1
- package/Switch/index.js +1 -1
- package/Switch/index.js.map +1 -1
- package/Tabs/Tab.js +2 -2
- package/Tabs/Tab.js.map +1 -1
- package/Tabs/Tabs.d.ts +1 -1
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/index.d.ts +2 -2
- package/Tabs/index.js +2 -2
- package/Tabs/index.js.map +1 -1
- package/Tags/Tags.d.ts +1 -1
- package/Tags/Tags.js.map +1 -1
- package/Tags/index.d.ts +1 -1
- package/Tags/index.js +1 -1
- package/Tags/index.js.map +1 -1
- package/Tooltip/index.d.ts +1 -1
- package/Tooltip/index.js +1 -1
- package/Tooltip/index.js.map +1 -1
- package/TopAppBar/TopAppBar.js +6 -2
- package/TopAppBar/TopAppBar.js.map +1 -1
- package/TopAppBar/TopAppBarPrimary.d.ts +1 -1
- package/TopAppBar/TopAppBarPrimary.js +1 -1
- package/TopAppBar/TopAppBarPrimary.js.map +1 -1
- package/TopAppBar/TopAppBarSecondary.d.ts +1 -1
- package/TopAppBar/TopAppBarSecondary.js +1 -1
- package/TopAppBar/TopAppBarSecondary.js.map +1 -1
- package/TopAppBar/index.d.ts +7 -7
- package/TopAppBar/index.js +7 -7
- package/TopAppBar/index.js.map +1 -1
- package/Typography/index.d.ts +1 -1
- package/Typography/index.js +1 -1
- package/Typography/index.js.map +1 -1
- package/package.json +13 -23
- package/RichTextEditor/RichTextEditor.d.ts +0 -12
- package/RichTextEditor/RichTextEditor.js +0 -17
- package/RichTextEditor/RichTextEditor.js.map +0 -1
- package/RichTextEditor/index.d.ts +0 -4
- package/RichTextEditor/index.js +0 -4
- package/RichTextEditor/index.js.map +0 -1
- package/Tabs/README.md +0 -19
package/List/List/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./List\";\nexport * from \"./ListItem\";\nexport * from \"./ListItemAction\";\nexport * from \"./ListItemGraphic\";\nexport * from \"./ListItemMeta\";\nexport * from \"./ListItemText\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./List.js\";\nexport * from \"./ListItem.js\";\nexport * from \"./ListItemAction.js\";\nexport * from \"./ListItemGraphic.js\";\nexport * from \"./ListItemMeta.js\";\nexport * from \"./ListItemText.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/List/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./List";
|
|
2
|
-
export { DataList, ScrollList, DataListModalOverlay, DataListModalOverlayAction, DataListWithSections, ScrollListWithSections } from "./DataList";
|
|
3
|
-
export * from "./DataList/icons";
|
|
4
|
-
export { CollapsibleList } from "./CollapsibleList";
|
|
1
|
+
export * from "./List/index.js";
|
|
2
|
+
export { DataList, ScrollList, DataListModalOverlay, DataListModalOverlayAction, DataListWithSections, ScrollListWithSections } from "./DataList/index.js";
|
|
3
|
+
export * from "./DataList/icons/index.js";
|
|
4
|
+
export { CollapsibleList } from "./CollapsibleList/index.js";
|
package/List/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./List";
|
|
2
|
-
export { DataList, ScrollList, DataListModalOverlay, DataListModalOverlayAction, DataListWithSections, ScrollListWithSections } from "./DataList";
|
|
3
|
-
export * from "./DataList/icons";
|
|
4
|
-
export { CollapsibleList } from "./CollapsibleList";
|
|
1
|
+
export * from "./List/index.js";
|
|
2
|
+
export { DataList, ScrollList, DataListModalOverlay, DataListModalOverlayAction, DataListWithSections, ScrollListWithSections } from "./DataList/index.js";
|
|
3
|
+
export * from "./DataList/icons/index.js";
|
|
4
|
+
export { CollapsibleList } from "./CollapsibleList/index.js";
|
|
5
5
|
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/List/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DataList","ScrollList","DataListModalOverlay","DataListModalOverlayAction","DataListWithSections","ScrollListWithSections","CollapsibleList"],"sources":["index.ts"],"sourcesContent":["export * from \"./List\";\n\nexport {\n DataList,\n ScrollList,\n DataListModalOverlay,\n DataListModalOverlayAction,\n DataListWithSections,\n ScrollListWithSections\n} from \"./DataList\";\nexport * from \"./DataList/icons\";\nexport { CollapsibleList } from \"./CollapsibleList\";\n"],"mappings":"AAAA;AAEA,SACIA,QAAQ,EACRC,UAAU,EACVC,oBAAoB,EACpBC,0BAA0B,EAC1BC,oBAAoB,EACpBC,sBAAsB;AAE1B;AACA,SAASC,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["DataList","ScrollList","DataListModalOverlay","DataListModalOverlayAction","DataListWithSections","ScrollListWithSections","CollapsibleList"],"sources":["index.ts"],"sourcesContent":["export * from \"./List/index.js\";\n\nexport {\n DataList,\n ScrollList,\n DataListModalOverlay,\n DataListModalOverlayAction,\n DataListWithSections,\n ScrollListWithSections\n} from \"./DataList/index.js\";\nexport * from \"./DataList/icons/index.js\";\nexport { CollapsibleList } from \"./CollapsibleList/index.js\";\n"],"mappings":"AAAA;AAEA,SACIA,QAAQ,EACRC,UAAU,EACVC,oBAAoB,EACpBC,0BAA0B,EAC1BC,oBAAoB,EACpBC,sBAAsB;AAE1B;AACA,SAASC,eAAe","ignoreList":[]}
|
package/Menu/Menu.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
|
-
import { DropdownMenu as AdminUiDropdownMenu } from "@webiny/admin-ui/DropdownMenu";
|
|
3
|
-
import { ListItemGraphic } from "../List";
|
|
2
|
+
import { DropdownMenu as AdminUiDropdownMenu } from "@webiny/admin-ui/DropdownMenu/index.js";
|
|
3
|
+
import { ListItemGraphic } from "../List/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This component is deprecated and will be removed in future releases.
|
|
6
6
|
* Please use the `DropdownMenu` component from the `@webiny/admin-ui` package instead.
|
|
@@ -28,9 +28,12 @@ const Menu = props => {
|
|
|
28
28
|
className: className,
|
|
29
29
|
onOpenChange: open => {
|
|
30
30
|
if (open) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
if (!onOpen) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
onOpen();
|
|
35
|
+
} else if (onClose) {
|
|
36
|
+
onClose();
|
|
34
37
|
}
|
|
35
38
|
},
|
|
36
39
|
"data-testid": props["data-testid"]
|
package/Menu/Menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","DropdownMenu","AdminUiDropdownMenu","ListItemGraphic","Menu","props","children","handle","className","onOpen","open","onClose","createElement","trigger","onOpenChange","closeMenu","console","log","MenuDivider","Separator","isIconElement","element","isValidElement","type","MenuItem","rest","icon","foundIcon","Children","toArray","find","content","filter","child","Item","Object","assign","text"],"sources":["Menu.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { DropdownMenu as AdminUiDropdownMenu } from \"@webiny/admin-ui/DropdownMenu\";\nimport { ListItemGraphic } from \"~/List\";\n\nexport type MenuChildrenFunctionProps = {\n closeMenu: () => void;\n};\n\nexport interface RenderableMenuChildren {\n (props: MenuChildrenFunctionProps): React.ReactNode;\n}\n\nexport interface BaseMenuItemProps {\n /** Adds a ripple effect to the component */\n ripple?: any;\n /** A modifier for a selected state. */\n selected?: boolean;\n /** A modifier for an active state. */\n activated?: boolean;\n /** A modifier for a disabled state. */\n disabled?: boolean;\n}\n\nexport type MenuProps = {\n /** Opens the menu. */\n open?: boolean;\n /** Make the menu position fixed. */\n fixed?: boolean;\n /** Renders the menu to a portal. Useful for situations where the content might be cutoff by an overflow: hidden container. You can pass \"true\" to render to the default RMWC portal. */\n renderToPortal?: any;\n /** Manually position the menu to one of the corners. */\n anchorCorner?: any;\n /** Children to render. */\n children?: React.ReactNode;\n /** An internal api for cross component communication. */\n apiRef?: (api: any | null) => void;\n /** Advanced: A reference to the MDCFoundation. */\n foundationRef?: any;\n /** Callback that fires when a Menu item is selected. evt.detail = { index: number; item: HTMLElement; } */\n onSelect?: (evt: any) => void;\n /** Whether or not to focus the first list item on open. Defaults to true. */\n focusOnOpen?: boolean;\n\n // A handler which triggers the menu, e.g. button or link.\n handle?: React.ReactElement;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // Position the menu to one of anchor corners.\n // 'bottomEnd' | 'bottomLeft' | 'bottomRight' | 'bottomStart' | 'topEnd' | 'topLeft' | 'topRight' | 'topStart'\n anchor?:\n | \"bottomEnd\"\n | \"bottomLeft\"\n | \"bottomRight\"\n | \"bottomStart\"\n | \"topEnd\"\n | \"topLeft\"\n | \"topRight\"\n | \"topStart\";\n\n // Class that will be added to the Menu element.\n className?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If true, prevents menu from opening when clicked.\n disabled?: boolean;\n\n onOpen?: () => void;\n onClose?: () => void;\n\n // For testing purposes.\n \"data-testid\"?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If rendering to portal, you can specify an exact zIndex.\n portalZIndex?: number;\n} & ( // You can use either `children` or `render`, but not both.\n | {\n // One or more MenuItem components.\n children: React.ReactNode | RenderableMenuChildren;\n render?: never;\n }\n | {\n render: RenderableMenuChildren;\n children?: never;\n }\n);\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu` component from the `@webiny/admin-ui` package instead.\n */\nconst Menu = (props: MenuProps) => {\n const {\n children,\n handle,\n\n className,\n onOpen,\n open,\n onClose\n\n // Deprecated properties.\n // disabled,\n // onSelect,\n // anchor = \"topStart\",\n // render,\n // renderToPortal,\n // portalZIndex = 99\n } = props;\n\n return (\n <AdminUiDropdownMenu\n open={open}\n trigger={handle}\n className={className}\n onOpenChange={open => {\n if (open) {\n onOpen
|
|
1
|
+
{"version":3,"names":["React","useMemo","DropdownMenu","AdminUiDropdownMenu","ListItemGraphic","Menu","props","children","handle","className","onOpen","open","onClose","createElement","trigger","onOpenChange","closeMenu","console","log","MenuDivider","Separator","isIconElement","element","isValidElement","type","MenuItem","rest","icon","foundIcon","Children","toArray","find","content","filter","child","Item","Object","assign","text"],"sources":["Menu.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { DropdownMenu as AdminUiDropdownMenu } from \"@webiny/admin-ui/DropdownMenu/index.js\";\nimport { ListItemGraphic } from \"~/List/index.js\";\n\nexport type MenuChildrenFunctionProps = {\n closeMenu: () => void;\n};\n\nexport interface RenderableMenuChildren {\n (props: MenuChildrenFunctionProps): React.ReactNode;\n}\n\nexport interface BaseMenuItemProps {\n /** Adds a ripple effect to the component */\n ripple?: any;\n /** A modifier for a selected state. */\n selected?: boolean;\n /** A modifier for an active state. */\n activated?: boolean;\n /** A modifier for a disabled state. */\n disabled?: boolean;\n}\n\nexport type MenuProps = {\n /** Opens the menu. */\n open?: boolean;\n /** Make the menu position fixed. */\n fixed?: boolean;\n /** Renders the menu to a portal. Useful for situations where the content might be cutoff by an overflow: hidden container. You can pass \"true\" to render to the default RMWC portal. */\n renderToPortal?: any;\n /** Manually position the menu to one of the corners. */\n anchorCorner?: any;\n /** Children to render. */\n children?: React.ReactNode;\n /** An internal api for cross component communication. */\n apiRef?: (api: any | null) => void;\n /** Advanced: A reference to the MDCFoundation. */\n foundationRef?: any;\n /** Callback that fires when a Menu item is selected. evt.detail = { index: number; item: HTMLElement; } */\n onSelect?: (evt: any) => void;\n /** Whether or not to focus the first list item on open. Defaults to true. */\n focusOnOpen?: boolean;\n\n // A handler which triggers the menu, e.g. button or link.\n handle?: React.ReactElement;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // Position the menu to one of anchor corners.\n // 'bottomEnd' | 'bottomLeft' | 'bottomRight' | 'bottomStart' | 'topEnd' | 'topLeft' | 'topRight' | 'topStart'\n anchor?:\n | \"bottomEnd\"\n | \"bottomLeft\"\n | \"bottomRight\"\n | \"bottomStart\"\n | \"topEnd\"\n | \"topLeft\"\n | \"topRight\"\n | \"topStart\";\n\n // Class that will be added to the Menu element.\n className?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If true, prevents menu from opening when clicked.\n disabled?: boolean;\n\n onOpen?: () => void;\n onClose?: () => void;\n\n // For testing purposes.\n \"data-testid\"?: string;\n\n // @deprecated With the introduction of the new Admin UI, this prop is no longer supported, and it will be removed in future releases.\n // If rendering to portal, you can specify an exact zIndex.\n portalZIndex?: number;\n} & ( // You can use either `children` or `render`, but not both.\n | {\n // One or more MenuItem components.\n children: React.ReactNode | RenderableMenuChildren;\n render?: never;\n }\n | {\n render: RenderableMenuChildren;\n children?: never;\n }\n);\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu` component from the `@webiny/admin-ui` package instead.\n */\nconst Menu = (props: MenuProps) => {\n const {\n children,\n handle,\n\n className,\n onOpen,\n open,\n onClose\n\n // Deprecated properties.\n // disabled,\n // onSelect,\n // anchor = \"topStart\",\n // render,\n // renderToPortal,\n // portalZIndex = 99\n } = props;\n\n return (\n <AdminUiDropdownMenu\n open={open}\n trigger={handle}\n className={className}\n onOpenChange={open => {\n if (open) {\n if (!onOpen) {\n return;\n }\n onOpen();\n } else if (onClose) {\n onClose();\n }\n }}\n data-testid={props[\"data-testid\"]}\n >\n {typeof children === \"function\"\n ? children({\n closeMenu: () => {\n console.log(\n \"Deprecated: This function is deprecated and will be removed in future releases.\"\n );\n }\n })\n : children}\n </AdminUiDropdownMenu>\n );\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu.Separator` component from the `@webiny/admin-ui` package instead.\n */\nconst MenuDivider = () => {\n return <AdminUiDropdownMenu.Separator />;\n};\n\ninterface MenuItemProps extends BaseMenuItemProps {\n children: React.ReactNode;\n className?: string;\n onClick?: (event: React.MouseEvent) => void;\n \"data-testid\"?: string;\n}\n\nconst isIconElement = (element: React.ReactNode) => {\n return React.isValidElement(element) && element.type === ListItemGraphic;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `DropdownMenu/Item` component from the `@webiny/admin-ui` package instead.\n */\nconst MenuItem = ({ children, ...rest }: MenuItemProps) => {\n const icon = useMemo(() => {\n const foundIcon = React.Children.toArray(children).find(isIconElement);\n // Handles this usage: packages/app-admin/src/components/OptionsMenu/OptionsMenuItem.tsx\n if (React.isValidElement(foundIcon) && foundIcon.type === ListItemGraphic) {\n return foundIcon.props.children;\n }\n return foundIcon;\n }, [children]);\n\n const content = useMemo(() => {\n return React.Children.toArray(children).filter(child => {\n return !isIconElement(child);\n });\n }, [children]);\n\n return <AdminUiDropdownMenu.Item icon={icon} text={content} {...rest} />;\n};\n\nexport { Menu, MenuItem, MenuDivider };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,YAAY,IAAIC,mBAAmB,QAAQ,wCAAw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GAAG5B,KAAK,CAAC6B,QAAQ,CAACC,OAAO,CAACvB,QAAQ,CAAC,CAACwB,IAAI,CAACV,aAAa,CAAC;IACtE;IACA,IAAI,aAAArB,KAAK,CAACuB,cAAc,CAACK,SAAS,CAAC,IAAIA,SAAS,CAACJ,IAAI,KAAKpB,eAAe,EAAE;MACvE,OAAOwB,SAAS,CAACtB,KAAK,CAACC,QAAQ;IACnC;IACA,OAAOqB,SAAS;EACpB,CAAC,EAAE,CAACrB,QAAQ,CAAC,CAAC;EAEd,MAAMyB,OAAO,GAAG/B,OAAO,CAAC,MAAM;IAC1B,OAAOD,KAAK,CAAC6B,QAAQ,CAACC,OAAO,CAACvB,QAAQ,CAAC,CAAC0B,MAAM,CAACC,KAAK,IAAI;MACpD,OAAO,CAACb,aAAa,CAACa,KAAK,CAAC;IAChC,CAAC,CAAC;EACN,CAAC,EAAE,CAAC3B,QAAQ,CAAC,CAAC;EAEd,oBAAOP,KAAA,CAAAa,aAAA,CAACV,mBAAmB,CAACgC,IAAI,EAAAC,MAAA,CAAAC,MAAA;IAACV,IAAI,EAAEA,IAAK;IAACW,IAAI,EAAEN;EAAQ,GAAKN,IAAI,CAAG,CAAC;AAC5E,CAAC;AAED,SAASrB,IAAI,EAAEoB,QAAQ,EAAEN,WAAW","ignoreList":[]}
|
package/Menu/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Menu";
|
|
1
|
+
export * from "./Menu.js";
|
package/Menu/index.js
CHANGED
package/Menu/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Menu\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Menu.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/Mosaic/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Mosaic";
|
|
1
|
+
export * from "./Mosaic.js";
|
package/Mosaic/index.js
CHANGED
package/Mosaic/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Mosaic\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Mosaic.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/Progress/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./CircularProgress";
|
|
1
|
+
export * from "./CircularProgress.js";
|
package/Progress/index.js
CHANGED
package/Progress/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CircularProgress\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CircularProgress.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/README.md
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
# @webiny/ui
|
|
2
|
-
[](https://www.npmjs.com/package/@webiny/ui)
|
|
3
|
-
[](https://www.npmjs.com/package/@webiny/ui)
|
|
4
|
-
[](https://github.com/prettier/prettier)
|
|
5
|
-
[](http://makeapullrequest.com)
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
already well-known [RMWC](https://rmwc.io/) library. With that,
|
|
12
|
-
there are a few additional components that weren't included in it.
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
## Install
|
|
16
|
-
```
|
|
17
|
-
npm install --save @webiny/ui
|
|
18
|
-
```
|
|
9
|
+
---
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
yarn add @webiny/ui
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Note on @rmwc/textfield
|
|
26
|
-
The package `@rmwc/textfield` is being pulled directly from our github due to its typings being broken on typescript versions that are greater than `3.7.4`.
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/Radio/Radio.d.ts
CHANGED
package/Radio/Radio.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FormComponentErrorMessage, FormComponentNote, Radio as AdminRadio } from "@webiny/admin-ui";
|
|
3
|
-
import { generateId } from "@webiny/admin-ui/utils";
|
|
3
|
+
import { generateId } from "@webiny/admin-ui/utils.js";
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This component is deprecated and will be removed in future releases.
|
|
6
6
|
* Please find out the new `Radio` component props from the `@webiny/admin-ui` package instead.
|
package/Radio/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","FormComponentErrorMessage","FormComponentNote","Radio","AdminRadio","generateId","Component","onChange","e","props","target","checked","render","value","label","disabled","description","validation","isValid","validationIsValid","message","validationMessage","createElement","Fragment","id","invalid","Boolean","text"],"sources":["Radio.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n FormComponentErrorMessage,\n FormComponentNote,\n Radio as AdminRadio\n} from \"@webiny/admin-ui\";\nimport type { FormComponentProps } from \"~/types\";\nimport { generateId } from \"@webiny/admin-ui/utils\";\n\ntype Props = FormComponentProps & {\n // Component label.\n label?: string;\n\n // Is radio disabled?\n disabled?: boolean;\n\n // Description beneath the radio.\n description?: string;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please find out the new `Radio` component props from the `@webiny/admin-ui` package instead.\n */\nclass Radio extends React.Component<Props> {\n onChange = (e: React.SyntheticEvent<HTMLInputElement> | any) => {\n this.props.onChange && this.props.onChange((e.target as HTMLInputElement).checked);\n };\n\n public override render() {\n const { value, label, disabled, description, validation } = this.props;\n\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n\n return (\n <React.Fragment>\n <AdminRadio id={generateId()} disabled={disabled} value={value} label={label} />\n <FormComponentErrorMessage\n invalid={Boolean(validationIsValid === false)}\n text={validationMessage}\n />\n <FormComponentNote text={description} />\n </React.Fragment>\n );\n }\n}\n\nexport default Radio;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACIC,yBAAyB,EACzBC,iBAAiB,EACjBC,KAAK,IAAIC,UAAU,QAChB,kBAAkB;AAEzB,SAASC,UAAU,QAAQ,
|
|
1
|
+
{"version":3,"names":["React","FormComponentErrorMessage","FormComponentNote","Radio","AdminRadio","generateId","Component","onChange","e","props","target","checked","render","value","label","disabled","description","validation","isValid","validationIsValid","message","validationMessage","createElement","Fragment","id","invalid","Boolean","text"],"sources":["Radio.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n FormComponentErrorMessage,\n FormComponentNote,\n Radio as AdminRadio\n} from \"@webiny/admin-ui\";\nimport type { FormComponentProps } from \"~/types.js\";\nimport { generateId } from \"@webiny/admin-ui/utils.js\";\n\ntype Props = FormComponentProps & {\n // Component label.\n label?: string;\n\n // Is radio disabled?\n disabled?: boolean;\n\n // Description beneath the radio.\n description?: string;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please find out the new `Radio` component props from the `@webiny/admin-ui` package instead.\n */\nclass Radio extends React.Component<Props> {\n onChange = (e: React.SyntheticEvent<HTMLInputElement> | any) => {\n this.props.onChange && this.props.onChange((e.target as HTMLInputElement).checked);\n };\n\n public override render() {\n const { value, label, disabled, description, validation } = this.props;\n\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n\n return (\n <React.Fragment>\n <AdminRadio id={generateId()} disabled={disabled} value={value} label={label} />\n <FormComponentErrorMessage\n invalid={Boolean(validationIsValid === false)}\n text={validationMessage}\n />\n <FormComponentNote text={description} />\n </React.Fragment>\n );\n }\n}\n\nexport default Radio;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACIC,yBAAyB,EACzBC,iBAAiB,EACjBC,KAAK,IAAIC,UAAU,QAChB,kBAAkB;AAEzB,SAASC,UAAU,QAAQ,2BAA2B;AAatD;AACA;AACA;AACA;AACA,MAAMF,KAAK,SAASH,KAAK,CAACM,SAAS,CAAQ;EACvCC,QAAQ,GAAIC,CAA+C,IAAK;IAC5D,IAAI,CAACC,KAAK,CAACF,QAAQ,IAAI,IAAI,CAACE,KAAK,CAACF,QAAQ,CAAEC,CAAC,CAACE,MAAM,CAAsBC,OAAO,CAAC;EACtF,CAAC;EAEeC,MAAMA,CAAA,EAAG;IACrB,MAAM;MAAEC,KAAK;MAAEC,KAAK;MAAEC,QAAQ;MAAEC,WAAW;MAAEC;IAAW,CAAC,GAAG,IAAI,CAACR,KAAK;IAEtE,MAAM;MAAES,OAAO,EAAEC,iBAAiB;MAAEC,OAAO,EAAEC;IAAkB,CAAC,GAAGJ,UAAU,IAAI,CAAC,CAAC;IAEnF,oBACIjB,KAAA,CAAAsB,aAAA,CAACtB,KAAK,CAACuB,QAAQ,qBACXvB,KAAA,CAAAsB,aAAA,CAAClB,UAAU;MAACoB,EAAE,EAAEnB,UAAU,CAAC,CAAE;MAACU,QAAQ,EAAEA,QAAS;MAACF,KAAK,EAAEA,KAAM;MAACC,KAAK,EAAEA;IAAM,CAAE,CAAC,eAChFd,KAAA,CAAAsB,aAAA,CAACrB,yBAAyB;MACtBwB,OAAO,EAAEC,OAAO,CAACP,iBAAiB,KAAK,KAAK,CAAE;MAC9CQ,IAAI,EAAEN;IAAkB,CAC3B,CAAC,eACFrB,KAAA,CAAAsB,aAAA,CAACpB,iBAAiB;MAACyB,IAAI,EAAEX;IAAY,CAAE,CAC3B,CAAC;EAEzB;AACJ;AAEA,eAAeb,KAAK","ignoreList":[]}
|
package/Radio/RadioGroup.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { FormComponentProps } from "../types";
|
|
2
|
+
import type { FormComponentProps } from "../types.js";
|
|
3
3
|
interface RadioGroupRenderParams {
|
|
4
4
|
onChange: (value: string | number) => () => void;
|
|
5
5
|
getValue: (value: string | number) => string | number;
|
package/Radio/RadioGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DeprecatedRadioGroup","DeprecatedAdminRadioGroup","FormComponentDescription","FormComponentErrorMessage","FormComponentLabel","RadioGroup","Component","render","description","label","validation","value","onChange","props","isValid","validationIsValid","message","validationMessage","createElement","className","text","onValueChange","children","getValue","invalid"],"sources":["RadioGroup.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FormComponentProps } from \"~/types\";\nimport {\n DeprecatedRadioGroup as DeprecatedAdminRadioGroup,\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel\n} from \"@webiny/admin-ui\";\n\ninterface RadioGroupRenderParams {\n onChange: (value: string | number) => () => void;\n getValue: (value: string | number) => string | number;\n}\n\ntype Props = FormComponentProps & {\n // Form element's label.\n label?: string;\n\n // Form element's description.\n description?: string;\n\n // An array of Radio components.\n children: (props: RadioGroupRenderParams) => React.ReactNode;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please find out the new `RadioGroup` component props from the `@webiny/admin-ui` package instead.\n */\nclass RadioGroup extends React.Component<Props> {\n public override render() {\n const { description, label, validation, value, onChange } = this.props;\n\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n\n return (\n <div className={\"w-full\"}>\n <FormComponentLabel text={label} />\n <FormComponentDescription text={description} />\n <DeprecatedAdminRadioGroup value={value} onValueChange={onChange}>\n {this.props.children({\n onChange: value => () => this.props.onChange && this.props.onChange(value),\n getValue: value => value\n })}\n </DeprecatedAdminRadioGroup>\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={validationIsValid === false}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"version":3,"names":["React","DeprecatedRadioGroup","DeprecatedAdminRadioGroup","FormComponentDescription","FormComponentErrorMessage","FormComponentLabel","RadioGroup","Component","render","description","label","validation","value","onChange","props","isValid","validationIsValid","message","validationMessage","createElement","className","text","onValueChange","children","getValue","invalid"],"sources":["RadioGroup.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FormComponentProps } from \"~/types.js\";\nimport {\n DeprecatedRadioGroup as DeprecatedAdminRadioGroup,\n FormComponentDescription,\n FormComponentErrorMessage,\n FormComponentLabel\n} from \"@webiny/admin-ui\";\n\ninterface RadioGroupRenderParams {\n onChange: (value: string | number) => () => void;\n getValue: (value: string | number) => string | number;\n}\n\ntype Props = FormComponentProps & {\n // Form element's label.\n label?: string;\n\n // Form element's description.\n description?: string;\n\n // An array of Radio components.\n children: (props: RadioGroupRenderParams) => React.ReactNode;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please find out the new `RadioGroup` component props from the `@webiny/admin-ui` package instead.\n */\nclass RadioGroup extends React.Component<Props> {\n public override render() {\n const { description, label, validation, value, onChange } = this.props;\n\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n\n return (\n <div className={\"w-full\"}>\n <FormComponentLabel text={label} />\n <FormComponentDescription text={description} />\n <DeprecatedAdminRadioGroup value={value} onValueChange={onChange}>\n {this.props.children({\n onChange: value => () => this.props.onChange && this.props.onChange(value),\n getValue: value => value\n })}\n </DeprecatedAdminRadioGroup>\n <FormComponentErrorMessage\n text={validationMessage}\n invalid={validationIsValid === false}\n />\n </div>\n );\n }\n}\n\nexport default RadioGroup;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SACIC,oBAAoB,IAAIC,yBAAyB,EACjDC,wBAAwB,EACxBC,yBAAyB,EACzBC,kBAAkB,QACf,kBAAkB;AAkBzB;AACA;AACA;AACA;AACA,MAAMC,UAAU,SAASN,KAAK,CAACO,SAAS,CAAQ;EAC5BC,MAAMA,CAAA,EAAG;IACrB,MAAM;MAAEC,WAAW;MAAEC,KAAK;MAAEC,UAAU;MAAEC,KAAK;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,KAAK;IAEtE,MAAM;MAAEC,OAAO,EAAEC,iBAAiB;MAAEC,OAAO,EAAEC;IAAkB,CAAC,GAAGP,UAAU,IAAI,CAAC,CAAC;IAEnF,oBACIX,KAAA,CAAAmB,aAAA;MAAKC,SAAS,EAAE;IAAS,gBACrBpB,KAAA,CAAAmB,aAAA,CAACd,kBAAkB;MAACgB,IAAI,EAAEX;IAAM,CAAE,CAAC,eACnCV,KAAA,CAAAmB,aAAA,CAAChB,wBAAwB;MAACkB,IAAI,EAAEZ;IAAY,CAAE,CAAC,eAC/CT,KAAA,CAAAmB,aAAA,CAACjB,yBAAyB;MAACU,KAAK,EAAEA,KAAM;MAACU,aAAa,EAAET;IAAS,GAC5D,IAAI,CAACC,KAAK,CAACS,QAAQ,CAAC;MACjBV,QAAQ,EAAED,KAAK,IAAI,MAAM,IAAI,CAACE,KAAK,CAACD,QAAQ,IAAI,IAAI,CAACC,KAAK,CAACD,QAAQ,CAACD,KAAK,CAAC;MAC1EY,QAAQ,EAAEZ,KAAK,IAAIA;IACvB,CAAC,CACsB,CAAC,eAC5BZ,KAAA,CAAAmB,aAAA,CAACf,yBAAyB;MACtBiB,IAAI,EAAEH,iBAAkB;MACxBO,OAAO,EAAET,iBAAiB,KAAK;IAAM,CACxC,CACA,CAAC;EAEd;AACJ;AAEA,eAAeV,UAAU","ignoreList":[]}
|
package/Radio/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Radio } from "./Radio";
|
|
2
|
-
export { default as RadioGroup } from "./RadioGroup";
|
|
1
|
+
export { default as Radio } from "./Radio.js";
|
|
2
|
+
export { default as RadioGroup } from "./RadioGroup.js";
|
package/Radio/index.js
CHANGED
package/Radio/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Radio","RadioGroup"],"sources":["index.ts"],"sourcesContent":["export { default as Radio } from \"./Radio\";\nexport { default as RadioGroup } from \"./RadioGroup\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,KAAK;AACzB,SAASD,OAAO,IAAIE,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","Radio","RadioGroup"],"sources":["index.ts"],"sourcesContent":["export { default as Radio } from \"./Radio.js\";\nexport { default as RadioGroup } from \"./RadioGroup.js\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,KAAK;AACzB,SAASD,OAAO,IAAIE,UAAU","ignoreList":[]}
|
package/Ripple/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Ripple";
|
|
1
|
+
export * from "./Ripple.js";
|
package/Ripple/index.js
CHANGED
package/Ripple/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Ripple\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Ripple.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/Scrollbar/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Scrollbar";
|
|
1
|
+
export * from "./Scrollbar.js";
|
package/Scrollbar/index.js
CHANGED
package/Scrollbar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Scrollbar\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Scrollbar.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/Select/Select.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { FormComponentProps } from "../types";
|
|
2
|
+
import type { FormComponentProps } from "../types.js";
|
|
3
3
|
export interface FormattedOption extends Omit<React.AllHTMLAttributes<any>, "label"> {
|
|
4
4
|
label: React.ReactNode;
|
|
5
5
|
value?: string;
|
package/Select/Select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Select","AdminSelect","getOptions","initialOptions","Array","isArray","options","option","push","label","value","String","Object","keys","map","key","getChildrenOptions","children","Children","toArray","filter","child","isValidElement","type","element","props","toString","Boolean","skipProps","getRmwcProps","newProps","name","includes","forEach","initialValue","other","undefined","childrenOptions","placeholder","size","placeholderText","trim","createElement","assign","onChange","displayResetAction"],"sources":["Select.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport type { FormComponentProps } from \"~/types\";\nimport { Select as AdminSelect } from \"@webiny/admin-ui\";\nimport type { SelectOptionDto } from \"@webiny/admin-ui\";\n\nexport interface FormattedOption extends Omit<React.AllHTMLAttributes<any>, \"label\"> {\n label: React.ReactNode;\n value?: string;\n options?: FormattedOption[];\n}\n\nexport interface RmwcSelectProps {\n /** The value for a controlled select. */\n value?: string;\n /** Adds help text to the field */\n helpText?: React.ReactNode;\n /** Options accepts flat arrays, value => label maps, and more. See examples for details. */\n options?:\n | FormattedOption[]\n | string[]\n | {\n [value: string]: string;\n };\n /** A label for the form control. */\n label?: string;\n /** Placeholder text for the form control. Set to a blank string to create a non-floating placeholder label. */\n placeholder?: string;\n /** Makes the select outlined. */\n outlined?: boolean;\n /** Makes the Select visually invalid. This is sometimes automatically my material-components-web. */\n invalid?: boolean;\n /** Makes the Select disabled. */\n disabled?: boolean;\n /** Makes the Select required. */\n required?: boolean;\n /** Props for the root element. By default, additional props spread to the native select element. */\n // rootProps?: Object;\n /** A reference to the native select element. Not applicable when `enhanced` is true. */\n inputRef?: (ref: HTMLSelectElement | null) => void;\n /** Add a leading icon. */\n icon?: React.ReactNode;\n /** Advanced: A reference to the MDCFoundation. */\n foundationRef?: any;\n}\n\nexport type SelectProps = FormComponentProps &\n RmwcSelectProps & {\n // Component label.\n label?: string;\n\n // Is checkbox disabled?\n disabled?: boolean;\n\n // Description beneath the select.\n description?: string;\n\n // Placeholder text for the form control. Set to a blank string to create a non-floating placeholder label.\n placeholder?: string;\n\n // Makes the Select have a visual box.\n box?: string;\n\n // One or more <option> or <optgroup> elements.\n children?: (React.ReactElement<\"option\"> | React.ReactElement<\"optgroup\">)[];\n\n // IconProps for the root element. By default, additional props spread to the native select element.\n rootProps?: {\n [key: string]: any;\n };\n\n // A className for the root element.\n className?: string;\n\n // Size - small, medium or large\n size?: \"small\" | \"medium\" | \"large\";\n };\n\n/**\n * TODO verify that this is correct method get all options.\n */\nconst getOptions = (initialOptions: SelectProps[\"options\"]): SelectOptionDto[] => {\n if (!initialOptions) {\n return [];\n } else if (Array.isArray(initialOptions)) {\n const options: SelectOptionDto[] = [];\n for (const option of initialOptions) {\n if (typeof option === \"string\") {\n options.push({\n label: option,\n value: option\n });\n continue;\n }\n options.push({\n label: String(option.label),\n value: option.value,\n options: getOptions(option.options)\n });\n }\n return options;\n }\n return Object.keys(initialOptions).map(key => {\n return {\n label: initialOptions[key],\n value: key\n };\n });\n};\n\n/**\n * Select component lets users to manually build the option list.\n */\nfunction getChildrenOptions(children: React.ReactNode): SelectOptionDto[] {\n return React.Children.toArray(children)\n .filter(\n child =>\n React.isValidElement(child) &&\n (child.type === \"option\" || child.type === \"optgroup\")\n )\n .map(child => {\n const element = child as React.ReactElement<{\n value?: string;\n label?: string;\n children?: React.ReactNode;\n }>;\n\n if (React.isValidElement(child) && child.type === \"option\") {\n return {\n value: element.props.value || \"\",\n label: element.props.children?.toString() || \"\"\n };\n }\n\n if (React.isValidElement(child) && child.type === \"optgroup\") {\n return {\n label: element.props.label || \"\",\n options: getChildrenOptions(element.props.children)\n };\n }\n\n return null; // This shouldn't be reached\n })\n .filter(Boolean) as SelectOptionDto[];\n}\n\n/**\n * Select component lets users choose a value from given set of options.\n */\nconst skipProps = [\"validate\", \"form\"];\n\nconst getRmwcProps = (props: SelectProps): FormComponentProps & RmwcSelectProps => {\n const newProps: FormComponentProps & RmwcSelectProps = {};\n Object.keys(props)\n .filter(name => !skipProps.includes(name))\n // @ts-expect-error\n .forEach((name: any) => (newProps[name] = props[name]));\n\n return newProps;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Select` component from the `@webiny/admin-ui` package instead.\n */\nexport const Select = (props: SelectProps) => {\n const { value: initialValue, ...other } = props;\n const value = initialValue === null || initialValue === undefined ? \"\" : initialValue;\n\n const options = getOptions(other.options);\n const childrenOptions = getChildrenOptions(props.children);\n\n // Memoize the label and placeholder values based on the component size.\n const { label, placeholder } = useMemo(() => {\n const { size, label, placeholder: placeholderText } = props;\n\n // If `placeholderText` is null, undefined, or an empty string after trimming, `placeholder` will be set to `undefined`.\n const placeholder = placeholderText?.trim() || undefined;\n\n // For small or medium size, we set only the placeholder, using label as fallback.\n if (size === \"small\" || size === \"medium\") {\n return {\n label: undefined,\n placeholder: placeholder || label\n };\n }\n\n // For other sizes, use the provided label and placeholder.\n return {\n label,\n placeholder\n };\n }, [props.label, props.placeholder, props.size]);\n\n const size = useMemo(() => {\n if (props.size === \"medium\") {\n return \"md\";\n }\n\n if (props.size === \"large\") {\n return \"lg\";\n }\n\n return \"lg\";\n }, [props.size]);\n\n return (\n <AdminSelect\n {...getRmwcProps(other)}\n options={[...options, ...childrenOptions]}\n value={value}\n label={label}\n placeholder={placeholder}\n size={size}\n onChange={value => props?.onChange?.(value)}\n displayResetAction={false}\n />\n );\n};\n\nexport default Select;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,MAAM,IAAIC,WAAW,QAAQ,kBAAkB;AA2ExD;AACA;AACA;AACA,MAAMC,UAAU,GAAIC,cAAsC,IAAwB;EAC9E,IAAI,CAACA,cAAc,EAAE;IACjB,OAAO,EAAE;EACb,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACF,cAAc,CAAC,EAAE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"version":3,"names":["React","useMemo","Select","AdminSelect","getOptions","initialOptions","Array","isArray","options","option","push","label","value","String","Object","keys","map","key","getChildrenOptions","children","Children","toArray","filter","child","isValidElement","type","element","props","toString","Boolean","skipProps","getRmwcProps","newProps","name","includes","forEach","initialValue","other","undefined","childrenOptions","placeholder","size","placeholderText","trim","createElement","assign","onChange","displayResetAction"],"sources":["Select.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport type { FormComponentProps } from \"~/types.js\";\nimport { Select as AdminSelect } from \"@webiny/admin-ui\";\nimport type { SelectOptionDto } from \"@webiny/admin-ui\";\n\nexport interface FormattedOption extends Omit<React.AllHTMLAttributes<any>, \"label\"> {\n label: React.ReactNode;\n value?: string;\n options?: FormattedOption[];\n}\n\nexport interface RmwcSelectProps {\n /** The value for a controlled select. */\n value?: string;\n /** Adds help text to the field */\n helpText?: React.ReactNode;\n /** Options accepts flat arrays, value => label maps, and more. See examples for details. */\n options?:\n | FormattedOption[]\n | string[]\n | {\n [value: string]: string;\n };\n /** A label for the form control. */\n label?: string;\n /** Placeholder text for the form control. Set to a blank string to create a non-floating placeholder label. */\n placeholder?: string;\n /** Makes the select outlined. */\n outlined?: boolean;\n /** Makes the Select visually invalid. This is sometimes automatically my material-components-web. */\n invalid?: boolean;\n /** Makes the Select disabled. */\n disabled?: boolean;\n /** Makes the Select required. */\n required?: boolean;\n /** Props for the root element. By default, additional props spread to the native select element. */\n // rootProps?: Object;\n /** A reference to the native select element. Not applicable when `enhanced` is true. */\n inputRef?: (ref: HTMLSelectElement | null) => void;\n /** Add a leading icon. */\n icon?: React.ReactNode;\n /** Advanced: A reference to the MDCFoundation. */\n foundationRef?: any;\n}\n\nexport type SelectProps = FormComponentProps &\n RmwcSelectProps & {\n // Component label.\n label?: string;\n\n // Is checkbox disabled?\n disabled?: boolean;\n\n // Description beneath the select.\n description?: string;\n\n // Placeholder text for the form control. Set to a blank string to create a non-floating placeholder label.\n placeholder?: string;\n\n // Makes the Select have a visual box.\n box?: string;\n\n // One or more <option> or <optgroup> elements.\n children?: (React.ReactElement<\"option\"> | React.ReactElement<\"optgroup\">)[];\n\n // IconProps for the root element. By default, additional props spread to the native select element.\n rootProps?: {\n [key: string]: any;\n };\n\n // A className for the root element.\n className?: string;\n\n // Size - small, medium or large\n size?: \"small\" | \"medium\" | \"large\";\n };\n\n/**\n * TODO verify that this is correct method get all options.\n */\nconst getOptions = (initialOptions: SelectProps[\"options\"]): SelectOptionDto[] => {\n if (!initialOptions) {\n return [];\n } else if (Array.isArray(initialOptions)) {\n const options: SelectOptionDto[] = [];\n for (const option of initialOptions) {\n if (typeof option === \"string\") {\n options.push({\n label: option,\n value: option\n });\n continue;\n }\n options.push({\n label: String(option.label),\n value: option.value,\n options: getOptions(option.options)\n });\n }\n return options;\n }\n return Object.keys(initialOptions).map(key => {\n return {\n label: initialOptions[key],\n value: key\n };\n });\n};\n\n/**\n * Select component lets users to manually build the option list.\n */\nfunction getChildrenOptions(children: React.ReactNode): SelectOptionDto[] {\n return React.Children.toArray(children)\n .filter(\n child =>\n React.isValidElement(child) &&\n (child.type === \"option\" || child.type === \"optgroup\")\n )\n .map(child => {\n const element = child as React.ReactElement<{\n value?: string;\n label?: string;\n children?: React.ReactNode;\n }>;\n\n if (React.isValidElement(child) && child.type === \"option\") {\n return {\n value: element.props.value || \"\",\n label: element.props.children?.toString() || \"\"\n };\n }\n\n if (React.isValidElement(child) && child.type === \"optgroup\") {\n return {\n label: element.props.label || \"\",\n options: getChildrenOptions(element.props.children)\n };\n }\n\n return null; // This shouldn't be reached\n })\n .filter(Boolean) as SelectOptionDto[];\n}\n\n/**\n * Select component lets users choose a value from given set of options.\n */\nconst skipProps = [\"validate\", \"form\"];\n\nconst getRmwcProps = (props: SelectProps): FormComponentProps & RmwcSelectProps => {\n const newProps: FormComponentProps & RmwcSelectProps = {};\n Object.keys(props)\n .filter(name => !skipProps.includes(name))\n // @ts-expect-error\n .forEach((name: any) => (newProps[name] = props[name]));\n\n return newProps;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Select` component from the `@webiny/admin-ui` package instead.\n */\nexport const Select = (props: SelectProps) => {\n const { value: initialValue, ...other } = props;\n const value = initialValue === null || initialValue === undefined ? \"\" : initialValue;\n\n const options = getOptions(other.options);\n const childrenOptions = getChildrenOptions(props.children);\n\n // Memoize the label and placeholder values based on the component size.\n const { label, placeholder } = useMemo(() => {\n const { size, label, placeholder: placeholderText } = props;\n\n // If `placeholderText` is null, undefined, or an empty string after trimming, `placeholder` will be set to `undefined`.\n const placeholder = placeholderText?.trim() || undefined;\n\n // For small or medium size, we set only the placeholder, using label as fallback.\n if (size === \"small\" || size === \"medium\") {\n return {\n label: undefined,\n placeholder: placeholder || label\n };\n }\n\n // For other sizes, use the provided label and placeholder.\n return {\n label,\n placeholder\n };\n }, [props.label, props.placeholder, props.size]);\n\n const size = useMemo(() => {\n if (props.size === \"medium\") {\n return \"md\";\n }\n\n if (props.size === \"large\") {\n return \"lg\";\n }\n\n return \"lg\";\n }, [props.size]);\n\n return (\n <AdminSelect\n {...getRmwcProps(other)}\n options={[...options, ...childrenOptions]}\n value={value}\n label={label}\n placeholder={placeholder}\n size={size}\n onChange={value => props?.onChange?.(value)}\n displayResetAction={false}\n />\n );\n};\n\nexport default Select;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,MAAM,IAAIC,WAAW,QAAQ,kBAAkB;AA2ExD;AACA;AACA;AACA,MAAMC,UAAU,GAAIC,cAAsC,IAAwB;EAC9E,IAAI,CAACA,cAAc,EAAE;IACjB,OAAO,EAAE;EACb,CAAC,MAAM,IAAIC,KAAK,CAACC,OAAO,CAACF,cAAc,CAAC,EAAE;IACtC,MAAMG,OAA0B,GAAG,EAAE;IACrC,KAAK,MAAMC,MAAM,IAAIJ,cAAc,EAAE;MACjC,IAAI,OAAOI,MAAM,KAAK,QAAQ,EAAE;QAC5BD,OAAO,CAACE,IAAI,CAAC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e,EAAEC,IAAI,CAAC,CAAC,IAAIL,SAAS;;IAExD;IACA,IAAIG,IAAI,KAAK,OAAO,IAAIA,IAAI,KAAK,QAAQ,EAAE;MACvC,OAAO;QACH9B,KAAK,EAAE2B,SAAS;QAChBE,WAAW,EAAEA,WAAW,IAAI7B;MAChC,CAAC;IACL;;IAEA;IACA,OAAO;MACHA,KAAK;MACL6B;IACJ,CAAC;EACL,CAAC,EAAE,CAACb,KAAK,CAAChB,KAAK,EAAEgB,KAAK,CAACa,WAAW,EAAEb,KAAK,CAACc,IAAI,CAAC,CAAC;EAEhD,MAAMA,IAAI,GAAGxC,OAAO,CAAC,MAAM;IACvB,IAAI0B,KAAK,CAACc,IAAI,KAAK,QAAQ,EAAE;MACzB,OAAO,IAAI;IACf;IAEA,IAAId,KAAK,CAACc,IAAI,KAAK,OAAO,EAAE;MACxB,OAAO,IAAI;IACf;IAEA,OAAO,IAAI;EACf,CAAC,EAAE,CAACd,KAAK,CAACc,IAAI,CAAC,CAAC;EAEhB,oBACIzC,KAAA,CAAA4C,aAAA,CAACzC,WAAW,EAAAW,MAAA,CAAA+B,MAAA,KACJd,YAAY,CAACM,KAAK,CAAC;IACvB7B,OAAO,EAAE,CAAC,GAAGA,OAAO,EAAE,GAAG+B,eAAe,CAAE;IAC1C3B,KAAK,EAAEA,KAAM;IACbD,KAAK,EAAEA,KAAM;IACb6B,WAAW,EAAEA,WAAY;IACzBC,IAAI,EAAEA,IAAK;IACXK,QAAQ,EAAElC,KAAK,IAAIe,KAAK,EAAEmB,QAAQ,GAAGlC,KAAK,CAAE;IAC5CmC,kBAAkB,EAAE;EAAM,EAC7B,CAAC;AAEV,CAAC;AAED,eAAe7C,MAAM","ignoreList":[]}
|
package/Select/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Select";
|
|
1
|
+
export * from "./Select.js";
|
package/Select/index.js
CHANGED
package/Select/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Select\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Select.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/Skeleton/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Skeleton";
|
|
1
|
+
export * from "./Skeleton.js";
|
package/Skeleton/index.js
CHANGED
package/Skeleton/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Skeleton\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Skeleton.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/Slider/Slider.d.ts
CHANGED
package/Slider/Slider.js
CHANGED
package/Slider/Slider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","omit","Slider","AdminSlider","Component","onValueCommit","value","props","onChange","onValueChange","onInput","toFloat","defaultValue","result","parseFloat","toString","isNaN","render","label","description","validation","sliderValue","min","createElement","Object","assign","max","step","showTooltip","discrete","note"],"sources":["Slider.tsx"],"sourcesContent":["import React from \"react\";\nimport omit from \"lodash/omit\";\nimport { Slider as AdminSlider } from \"@webiny/admin-ui\";\nimport type { FormComponentProps } from \"~/types\";\n\ntype Props = FormComponentProps & {\n // Component label.\n label?: string;\n\n // Is checkbox disabled?\n disabled?: boolean;\n\n // Description beneath the slider.\n description?: string;\n\n // The minimum value of the Slider.\n min?: number | string;\n\n // The maximum value of the Slider.\n max?: number | string;\n\n // A step to quantize values by.\n step?: number | string;\n\n // Displays the exact value of the Slider on the knob.\n discrete?: boolean;\n\n // Displays the individual step markers on the Slider track.\n displayMarkers?: boolean;\n\n // Function that gets triggered on each input.\n onInput?: (value: any) => void;\n\n readOnly?: boolean;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Slider` component from the `@webiny/admin-ui` package instead.\n */\nclass Slider extends React.Component<Props> {\n onValueCommit = (value: number) => {\n this.props.onChange && this.props.onChange(value);\n };\n\n onValueChange = (value: number) => {\n this.props.onInput && this.props.onInput(value);\n };\n\n toFloat = (value: number | string | undefined, defaultValue = 0): number => {\n if (!value) {\n return defaultValue;\n }\n\n // Convert the value to a string before passing it to parseFloat\n const result = parseFloat(value.toString());\n\n // Check if the result is a valid number\n return isNaN(result) ? defaultValue : result;\n };\n\n public override render() {\n const { value, label, description, validation } = this.props;\n\n let sliderValue = value;\n if (value === null || typeof value === \"undefined\") {\n sliderValue = this.props.min || 0;\n }\n\n return (\n <AdminSlider\n {...omit(this.props, [\"displayMarkers\", \"discrete\", \"onInput\", \"onChange\"])}\n label={label}\n min={this.toFloat(this.props.min)}\n max={this.toFloat(this.props.max, 100)}\n step={this.toFloat(this.props.step, 1)}\n value={sliderValue}\n onValueCommit={this.onValueCommit}\n onValueChange={this.onValueChange}\n showTooltip={this.props.discrete}\n validation={validation}\n note={description}\n />\n );\n }\n}\n\nexport default Slider;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,
|
|
1
|
+
{"version":3,"names":["React","omit","Slider","AdminSlider","Component","onValueCommit","value","props","onChange","onValueChange","onInput","toFloat","defaultValue","result","parseFloat","toString","isNaN","render","label","description","validation","sliderValue","min","createElement","Object","assign","max","step","showTooltip","discrete","note"],"sources":["Slider.tsx"],"sourcesContent":["import React from \"react\";\nimport omit from \"lodash/omit.js\";\nimport { Slider as AdminSlider } from \"@webiny/admin-ui\";\nimport type { FormComponentProps } from \"~/types.js\";\n\ntype Props = FormComponentProps & {\n // Component label.\n label?: string;\n\n // Is checkbox disabled?\n disabled?: boolean;\n\n // Description beneath the slider.\n description?: string;\n\n // The minimum value of the Slider.\n min?: number | string;\n\n // The maximum value of the Slider.\n max?: number | string;\n\n // A step to quantize values by.\n step?: number | string;\n\n // Displays the exact value of the Slider on the knob.\n discrete?: boolean;\n\n // Displays the individual step markers on the Slider track.\n displayMarkers?: boolean;\n\n // Function that gets triggered on each input.\n onInput?: (value: any) => void;\n\n readOnly?: boolean;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Slider` component from the `@webiny/admin-ui` package instead.\n */\nclass Slider extends React.Component<Props> {\n onValueCommit = (value: number): void => {\n this.props.onChange && this.props.onChange(value);\n };\n\n onValueChange = (value: number): void => {\n this.props.onInput && this.props.onInput(value);\n };\n\n toFloat = (value: number | string | undefined, defaultValue = 0): number => {\n if (!value) {\n return defaultValue;\n }\n\n // Convert the value to a string before passing it to parseFloat\n const result = parseFloat(value.toString());\n\n // Check if the result is a valid number\n return isNaN(result) ? defaultValue : result;\n };\n\n public override render() {\n const { value, label, description, validation } = this.props;\n\n let sliderValue = value;\n if (value === null || typeof value === \"undefined\") {\n sliderValue = this.props.min || 0;\n }\n\n return (\n <AdminSlider\n {...omit(this.props, [\"displayMarkers\", \"discrete\", \"onInput\", \"onChange\"])}\n label={label}\n min={this.toFloat(this.props.min)}\n max={this.toFloat(this.props.max, 100)}\n step={this.toFloat(this.props.step, 1)}\n value={sliderValue}\n onValueCommit={this.onValueCommit}\n onValueChange={this.onValueChange}\n showTooltip={this.props.discrete}\n validation={validation}\n note={description}\n />\n );\n }\n}\n\nexport default Slider;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,gBAAgB;AACjC,SAASC,MAAM,IAAIC,WAAW,QAAQ,kBAAkB;AAkCxD;AACA;AACA;AACA;AACA,MAAMD,MAAM,SAASF,KAAK,CAACI,SAAS,CAAQ;EACxCC,aAAa,GAAIC,KAAa,IAAW;IACrC,IAAI,CAACC,KAAK,CAACC,QAAQ,IAAI,IAAI,CAACD,KAAK,CAACC,QAAQ,CAACF,KAAK,CAAC;EACrD,CAAC;EAEDG,aAAa,GA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aAAc;MAClCI,aAAa,EAAE,IAAI,CAACA,aAAc;MAClCmB,WAAW,EAAE,IAAI,CAACrB,KAAK,CAACsB,QAAS;MACjCT,UAAU,EAAEA,UAAW;MACvBU,IAAI,EAAEX;IAAY,EACrB,CAAC;EAEV;AACJ;AAEA,eAAejB,MAAM","ignoreList":[]}
|
package/Slider/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Slider } from "./Slider";
|
|
1
|
+
export { default as Slider } from "./Slider.js";
|
package/Slider/index.js
CHANGED
package/Slider/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Slider"],"sources":["index.ts"],"sourcesContent":["export { default as Slider } from \"./Slider\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","Slider"],"sources":["index.ts"],"sourcesContent":["export { default as Slider } from \"./Slider.js\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,MAAM","ignoreList":[]}
|
package/Snackbar/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Snackbar, SnackbarAction } from "./Snackbar";
|
|
1
|
+
export { Snackbar, SnackbarAction } from "./Snackbar.js";
|
package/Snackbar/index.js
CHANGED
package/Snackbar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Snackbar","SnackbarAction"],"sources":["index.ts"],"sourcesContent":["export { Snackbar, SnackbarAction } from \"./Snackbar\";\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Snackbar","SnackbarAction"],"sources":["index.ts"],"sourcesContent":["export { Snackbar, SnackbarAction } from \"./Snackbar.js\";\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc","ignoreList":[]}
|
package/Switch/Switch.d.ts
CHANGED
package/Switch/Switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Switch","AdminSwitch","Component","render","value","description","validation","label","disabled","props","createElement","note","className","checked","Boolean","String","onChange"],"sources":["Switch.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FormComponentProps } from \"~/types\";\nimport { Switch as AdminSwitch } from \"@webiny/admin-ui\";\n\ntype SwitchProps = {\n /** A DOM ID for the toggle. */\n id?: string;\n /** Disables the control. */\n disabled?: boolean;\n /** Toggle the control on and off. */\n checked?: boolean;\n /** The value of the control. */\n value?: string | number | string[];\n /** A label for the control. */\n label?: React.ReactNode;\n /** By default, all props except className and style spread to the input. These are additional props for the root of the checkbox. */\n rootProps?: React.HTMLProps<any>;\n /** A reference to the native input. */\n inputRef?: React.Ref<HTMLInputElement>;\n};\n\ntype Props = Omit<SwitchProps, \"value\"> &\n FormComponentProps<boolean> & {\n // Description beneath the switch.\n description?: string;\n\n // Optional class name.\n className?: string;\n };\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Switch` component from the `@webiny/admin-ui` package instead.\n */\nclass Switch extends React.Component<Props> {\n public override render() {\n const { value, description, validation, label, disabled } = this.props;\n\n return (\n <AdminSwitch\n label={label}\n note={description}\n validation={validation}\n className={\"webiny-ui-switch\"}\n checked={Boolean(value)}\n value={String(value)}\n onChange={() => this.props.onChange && this.props.onChange(!value)}\n disabled={disabled}\n />\n );\n }\n}\n\nexport { Switch };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,IAAIC,WAAW,QAAQ,kBAAkB;AA4BxD;AACA;AACA;AACA;AACA,MAAMD,MAAM,SAASD,KAAK,CAACG,SAAS,CAAQ;EACxBC,MAAMA,CAAA,EAAG;IACrB,MAAM;MAAEC,KAAK;MAAEC,WAAW;MAAEC,UAAU;MAAEC,KAAK;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,KAAK;IAEtE,oBACIV,KAAA,CAAAW,aAAA,CAACT,WAAW;MACRM,KAAK,EAAEA,KAAM;MACbI,IAAI,EAAEN,WAAY;MAClBC,UAAU,EAAEA,UAAW;MACvBM,SAAS,EAAE,kBAAmB;MAC9BC,OAAO,EAAEC,OAAO,CAACV,KAAK,CAAE;MACxBA,KAAK,EAAEW,MAAM,CAACX,KAAK,CAAE;MACrBY,QAAQ,EAAEA,CAAA,KAAM,IAAI,CAACP,KAAK,CAACO,QAAQ,IAAI,IAAI,CAACP,KAAK,CAACO,QAAQ,CAAC,CAACZ,KAAK,CAAE;MACnEI,QAAQ,EAAEA;IAAS,CACtB,CAAC;EAEV;AACJ;AAEA,SAASR,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Switch","AdminSwitch","Component","render","value","description","validation","label","disabled","props","createElement","note","className","checked","Boolean","String","onChange"],"sources":["Switch.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FormComponentProps } from \"~/types.js\";\nimport { Switch as AdminSwitch } from \"@webiny/admin-ui\";\n\ntype SwitchProps = {\n /** A DOM ID for the toggle. */\n id?: string;\n /** Disables the control. */\n disabled?: boolean;\n /** Toggle the control on and off. */\n checked?: boolean;\n /** The value of the control. */\n value?: string | number | string[];\n /** A label for the control. */\n label?: React.ReactNode;\n /** By default, all props except className and style spread to the input. These are additional props for the root of the checkbox. */\n rootProps?: React.HTMLProps<any>;\n /** A reference to the native input. */\n inputRef?: React.Ref<HTMLInputElement>;\n};\n\ntype Props = Omit<SwitchProps, \"value\"> &\n FormComponentProps<boolean> & {\n // Description beneath the switch.\n description?: string;\n\n // Optional class name.\n className?: string;\n };\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please use the `Switch` component from the `@webiny/admin-ui` package instead.\n */\nclass Switch extends React.Component<Props> {\n public override render() {\n const { value, description, validation, label, disabled } = this.props;\n\n return (\n <AdminSwitch\n label={label}\n note={description}\n validation={validation}\n className={\"webiny-ui-switch\"}\n checked={Boolean(value)}\n value={String(value)}\n onChange={() => this.props.onChange && this.props.onChange(!value)}\n disabled={disabled}\n />\n );\n }\n}\n\nexport { Switch };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,IAAIC,WAAW,QAAQ,kBAAkB;AA4BxD;AACA;AACA;AACA;AACA,MAAMD,MAAM,SAASD,KAAK,CAACG,SAAS,CAAQ;EACxBC,MAAMA,CAAA,EAAG;IACrB,MAAM;MAAEC,KAAK;MAAEC,WAAW;MAAEC,UAAU;MAAEC,KAAK;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,KAAK;IAEtE,oBACIV,KAAA,CAAAW,aAAA,CAACT,WAAW;MACRM,KAAK,EAAEA,KAAM;MACbI,IAAI,EAAEN,WAAY;MAClBC,UAAU,EAAEA,UAAW;MACvBM,SAAS,EAAE,kBAAmB;MAC9BC,OAAO,EAAEC,OAAO,CAACV,KAAK,CAAE;MACxBA,KAAK,EAAEW,MAAM,CAACX,KAAK,CAAE;MACrBY,QAAQ,EAAEA,CAAA,KAAM,IAAI,CAACP,KAAK,CAACO,QAAQ,IAAI,IAAI,CAACP,KAAK,CAACO,QAAQ,CAAC,CAACZ,KAAK,CAAE;MACnEI,QAAQ,EAAEA;IAAS,CACtB,CAAC;EAEV;AACJ;AAEA,SAASR,MAAM","ignoreList":[]}
|
package/Switch/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Switch";
|
|
1
|
+
export * from "./Switch.js";
|
package/Switch/index.js
CHANGED
package/Switch/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Switch\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Switch.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
package/Tabs/Tab.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useRef } from "react";
|
|
2
|
-
import { generateAlphaNumericId } from "@webiny/utils/generateId";
|
|
3
|
-
import { DeprecatedTabsContext } from "./Tabs";
|
|
2
|
+
import { generateAlphaNumericId } from "@webiny/utils/generateId.js";
|
|
3
|
+
import { DeprecatedTabsContext } from "./Tabs.js";
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This component is deprecated and will be removed in future releases.
|
|
6
6
|
* Please find out the new `Tabs` component props from the `@webiny/admin-ui` package instead.
|
package/Tabs/Tab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","useEffect","useRef","generateAlphaNumericId","DeprecatedTabsContext","Tab","memo","props","tabsContext","idRef","addTab","id","current","visible","removeTab","displayName"],"sources":["Tab.tsx"],"sourcesContent":["import React, { useContext, useEffect, useRef } from \"react\";\nimport { generateAlphaNumericId } from \"@webiny/utils/generateId\";\nimport { DeprecatedTabsContext } from \"./Tabs\";\n\nexport type TabProps = {\n /**\n * A label for the tab.\n */\n label?: any;\n /**\n * The label for the tab, passed as children.\n */\n children?: React.ReactNode;\n /**\n * The icon to use for the tab.\n */\n icon?: React.ReactElement;\n /**\n * Is tab visible?\n */\n visible?: boolean;\n /**\n * @deprecated\n */\n tag?: string;\n /**\n * Is tab disabled?\n */\n disabled?: boolean;\n /**\n * Style object\n */\n style?: React.CSSProperties;\n /**\n * Tab ID for the testing.\n */\n \"data-testid\"?: string;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please find out the new `Tabs` component props from the `@webiny/admin-ui` package instead.\n */\nexport const Tab = React.memo((props: TabProps) => {\n const tabsContext = useContext(DeprecatedTabsContext);\n const idRef = useRef(generateAlphaNumericId(12));\n\n useEffect(() => {\n tabsContext!.addTab({ ...props, id: idRef.current, visible: props.visible ?? true });\n }, [props]);\n\n useEffect(() => {\n return () => {\n return tabsContext!.removeTab(idRef.current);\n };\n }, []);\n\n return null;\n});\n\nTab.displayName = \"Tab\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC5D,SAASC,sBAAsB,QAAQ,
|
|
1
|
+
{"version":3,"names":["React","useContext","useEffect","useRef","generateAlphaNumericId","DeprecatedTabsContext","Tab","memo","props","tabsContext","idRef","addTab","id","current","visible","removeTab","displayName"],"sources":["Tab.tsx"],"sourcesContent":["import React, { useContext, useEffect, useRef } from \"react\";\nimport { generateAlphaNumericId } from \"@webiny/utils/generateId.js\";\nimport { DeprecatedTabsContext } from \"./Tabs.js\";\n\nexport type TabProps = {\n /**\n * A label for the tab.\n */\n label?: any;\n /**\n * The label for the tab, passed as children.\n */\n children?: React.ReactNode;\n /**\n * The icon to use for the tab.\n */\n icon?: React.ReactElement;\n /**\n * Is tab visible?\n */\n visible?: boolean;\n /**\n * @deprecated\n */\n tag?: string;\n /**\n * Is tab disabled?\n */\n disabled?: boolean;\n /**\n * Style object\n */\n style?: React.CSSProperties;\n /**\n * Tab ID for the testing.\n */\n \"data-testid\"?: string;\n};\n\n/**\n * @deprecated This component is deprecated and will be removed in future releases.\n * Please find out the new `Tabs` component props from the `@webiny/admin-ui` package instead.\n */\nexport const Tab = React.memo((props: TabProps) => {\n const tabsContext = useContext(DeprecatedTabsContext);\n const idRef = useRef(generateAlphaNumericId(12));\n\n useEffect(() => {\n tabsContext!.addTab({ ...props, id: idRef.current, visible: props.visible ?? true });\n }, [props]);\n\n useEffect(() => {\n return () => {\n return tabsContext!.removeTab(idRef.current);\n };\n }, []);\n\n return null;\n});\n\nTab.displayName = \"Tab\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC5D,SAASC,sBAAsB,QAAQ,6BAA6B;AACpE,SAASC,qBAAqB;AAqC9B;AACA;AACA;AACA;AACA,OAAO,MAAMC,GAAG,gBAAGN,KAAK,CAACO,IAAI,CAAEC,KAAe,IAAK;EAC/C,MAAMC,WAAW,GAAGR,UAAU,CAACI,qBAAqB,CAAC;EACrD,MAAMK,KAAK,GAAGP,MAAM,CAACC,sBAAsB,CAAC,EAAE,CAAC,CAAC;EAEhDF,SAAS,CAAC,MAAM;IACZO,WAAW,CAAEE,MAAM,CAAC;MAAE,GAAGH,KAAK;MAAEI,EAAE,EAAEF,KAAK,CAACG,OAAO;MAAEC,OAAO,EAAEN,KAAK,CAACM,OAAO,IAAI;IAAK,CAAC,CAAC;EACxF,CAAC,EAAE,CAACN,KAAK,CAAC,CAAC;EAEXN,SAAS,CAAC,MAAM;IACZ,OAAO,MAAM;MACT,OAAOO,WAAW,CAAEM,SAAS,CAACL,KAAK,CAACG,OAAO,CAAC;IAChD,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,IAAI;AACf,CAAC,CAAC;AAEFP,GAAG,CAACU,WAAW,GAAG,KAAK","ignoreList":[]}
|