@pingux/astro 2.9.2 → 2.13.0-alpha.3
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/README.md +6 -2
- package/lib/README.md +6 -2
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.mdx +40 -0
- package/lib/cjs/components/AccordionGroup/Accordion.styles.js +1 -2
- package/lib/cjs/components/AccordionGroup/AccordionGroup.mdx +41 -0
- package/lib/cjs/components/ArrayField/ArrayField.mdx +34 -0
- package/lib/cjs/components/AstroWrapper/AstroWrapper.mdx +16 -0
- package/lib/cjs/components/Avatar/Avatar.mdx +14 -0
- package/lib/cjs/components/Badge/Badge.mdx +24 -0
- package/lib/cjs/components/Box/Box.d.ts +4 -0
- package/lib/cjs/components/Box/Box.js +4 -19
- package/lib/cjs/components/Box/Box.mdx +23 -0
- package/lib/cjs/components/Box/Box.styles.d.ts +6 -0
- package/lib/cjs/components/Box/Box.test.d.ts +1 -0
- package/lib/cjs/components/Box/Box.test.js +2 -6
- package/lib/cjs/components/Box/index.d.ts +1 -0
- package/lib/cjs/components/Bracket/Bracket.mdx +17 -0
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.mdx +40 -0
- package/lib/cjs/components/Button/Button.mdx +40 -0
- package/lib/cjs/components/Button/Button.stories.js +30 -5
- package/lib/cjs/components/Button/Buttons.styles.js +25 -7
- package/lib/cjs/components/Calendar/Calendar.mdx +39 -0
- package/lib/cjs/components/Callout/Callout.mdx +28 -0
- package/lib/cjs/components/Card/Card.mdx +32 -0
- package/lib/cjs/components/CheckboxField/CheckboxField.mdx +42 -0
- package/lib/cjs/components/CodeView/CodeView.mdx +23 -0
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.mdx +29 -0
- package/lib/cjs/components/ColorField/ColorField.mdx +38 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.mdx +66 -0
- package/lib/cjs/components/CopyText/CopyText.mdx +23 -0
- package/lib/cjs/components/DataTable/DataTable.mdx +54 -0
- package/lib/cjs/components/DatePicker/DatePicker.mdx +49 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +2 -1
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +36 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +29 -45
- package/lib/cjs/components/FileInputField/FileInputField.mdx +33 -0
- package/lib/cjs/components/HelpHint/HelpHint.mdx +32 -0
- package/lib/cjs/components/Icon/Icon.d.ts +4 -0
- package/lib/cjs/components/Icon/Icon.js +4 -27
- package/lib/cjs/components/Icon/Icon.mdx +49 -0
- package/lib/cjs/components/Icon/Icon.stories.d.ts +8 -0
- package/lib/cjs/components/Icon/Icon.test.d.ts +1 -0
- package/lib/cjs/components/Icon/index.d.ts +1 -0
- package/lib/cjs/components/IconBadge/IconBadge.mdx +14 -0
- package/lib/cjs/components/IconButton/IconButton.mdx +33 -0
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.mdx +31 -0
- package/lib/cjs/components/Image/Image.mdx +28 -0
- package/lib/cjs/components/ImageUploadField/ImageUploadField.mdx +38 -0
- package/lib/cjs/components/Link/Link.mdx +27 -0
- package/lib/cjs/components/LinkSelectField/LinkSelectField.mdx +47 -0
- package/lib/cjs/components/ListItem/ListItem.mdx +21 -0
- package/lib/cjs/components/ListView/ListView.mdx +44 -0
- package/lib/cjs/components/ListView/ListView.stories.js +93 -47
- package/lib/cjs/components/Loader/Loader.d.ts +4 -0
- package/lib/cjs/components/Loader/Loader.js +0 -14
- package/lib/cjs/components/Loader/Loader.mdx +29 -0
- package/lib/cjs/components/Loader/Loader.styles.d.ts +53 -0
- package/lib/cjs/components/Loader/Loader.test.d.ts +1 -0
- package/lib/cjs/components/Loader/index.d.ts +1 -0
- package/lib/cjs/components/Menu/Menu.mdx +43 -0
- package/lib/cjs/components/Messages/Messages.mdx +35 -0
- package/lib/cjs/components/Modal/Modal.mdx +59 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.mdx +44 -0
- package/lib/cjs/components/NavBar/NavBar.mdx +42 -0
- package/lib/cjs/components/NumberField/NumberField.mdx +39 -0
- package/lib/cjs/components/OverlayPanel/OverlayPanel.mdx +39 -0
- package/lib/cjs/components/PasswordField/PasswordField.mdx +33 -0
- package/lib/cjs/components/PopoverContainer/PopoverContainer.d.ts +9 -0
- package/lib/cjs/components/PopoverContainer/PopoverContainer.js +7 -38
- package/lib/cjs/components/PopoverContainer/index.d.ts +2 -0
- package/lib/cjs/components/PopoverMenu/PopoverMenu.mdx +53 -0
- package/lib/cjs/components/RadioGroupField/RadioGroupField.mdx +41 -0
- package/lib/cjs/components/RequirementsList/RequirementsList.mdx +17 -0
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.mdx +36 -0
- package/lib/cjs/components/ScrollBox/ScrollBox.mdx +17 -0
- package/lib/cjs/components/SearchField/SearchField.mdx +33 -0
- package/lib/cjs/components/SelectField/SelectField.mdx +46 -0
- package/lib/cjs/components/Separator/Separator.mdx +19 -0
- package/lib/cjs/components/Stepper/Stepper.mdx +41 -0
- package/lib/cjs/components/SwitchField/SwitchField.mdx +36 -0
- package/lib/cjs/components/Table/Table.mdx +30 -0
- package/lib/cjs/components/TableCell/TableCell.d.ts +12 -0
- package/lib/cjs/components/TableCell/TableCell.js +0 -5
- package/lib/cjs/components/TableCell/TableCell.test.d.ts +1 -0
- package/lib/cjs/components/TableCell/index.d.ts +1 -0
- package/lib/cjs/components/Tabs/Tabs.mdx +40 -0
- package/lib/cjs/components/Text/Text.d.ts +4 -0
- package/lib/cjs/components/Text/Text.js +3 -7
- package/lib/cjs/components/Text/Text.mdx +13 -0
- package/lib/cjs/components/Text/Text.stories.d.ts +6 -0
- package/lib/cjs/components/Text/Text.styles.d.ts +286 -0
- package/lib/cjs/components/Text/Text.test.d.ts +1 -0
- package/lib/cjs/components/Text/index.d.ts +1 -0
- package/lib/cjs/components/TextAreaField/TextAreaField.mdx +34 -0
- package/lib/cjs/components/TextField/TextField.mdx +34 -0
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.mdx +18 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.mdx +21 -0
- package/lib/cjs/docs/Props.stories.mdx +35 -0
- package/lib/cjs/docs/Welcome.stories.mdx +149 -0
- package/lib/cjs/docs/hooks/useDebounce.stories.mdx +59 -0
- package/lib/cjs/docs/hooks/useModalState.stories.mdx +83 -0
- package/lib/cjs/docs/hooks/useOverlayPanelState.stories.mdx +84 -0
- package/lib/cjs/docs/theme/AstroNanoTheme.stories.mdx +174 -0
- package/lib/cjs/docs/theme/AstroTheme.stories.mdx +20 -0
- package/lib/cjs/docs/theme/CustomThemes.stories.mdx +70 -0
- package/lib/cjs/docs/theme/StylingGuideline.stories.mdx +116 -0
- package/lib/cjs/docs/utils/messagesReducer.stories.mdx +64 -0
- package/lib/cjs/experimental/EditButton/EditButton.js +63 -0
- package/lib/cjs/experimental/EditButton/EditButton.mdx +9 -0
- package/lib/cjs/experimental/EditButton/EditButton.stories.js +91 -0
- package/lib/cjs/experimental/EditButton/EditButton.test.js +71 -0
- package/lib/cjs/experimental/EditButton/index.js +14 -0
- package/lib/cjs/experimental/ListView/ListView.mdx +47 -0
- package/lib/cjs/experimental/ListView/ListView.stories.js +742 -0
- package/lib/cjs/experimental/ListViewItem/ListViewItem.js +23 -5
- package/lib/cjs/experimental/ListViewItem/ListViewItem.mdx +36 -0
- package/lib/cjs/experimental/ListViewItem/ListViewItem.stories.js +31 -7
- package/lib/cjs/experimental/ListViewItem/ListViewItem.test.js +51 -7
- package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.js +1 -4
- package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +4 -1
- package/lib/cjs/experimental/ListViewItem/controls/ListViewItemSwitchField.js +1 -0
- package/lib/cjs/experimental/ListViewItem/listViewItemAttributes.js +28 -13
- package/lib/cjs/experimental/PanelHeader/PanelHeader.js +88 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.mdx +19 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.stories.js +71 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.styles.js +38 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.test.js +46 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.js +34 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.stories.js +31 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.test.js +25 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.js +27 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.stories.js +36 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +58 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.js +27 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.stories.js +41 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.test.js +25 -0
- package/lib/cjs/experimental/PanelHeader/index.js +14 -0
- package/lib/cjs/experimental/README.stories.mdx +7 -0
- package/lib/cjs/experimental/SaveBar/SaveBar.mdx +13 -0
- package/lib/cjs/experimental/recipes/ListAndPanel.stories.js +1 -1
- package/lib/cjs/hooks/usePropWarning/usePropWarning.js +1 -1
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.js +2 -2
- package/lib/cjs/hooks/useTShirtSize/useTShirtSize.js +1 -1
- package/lib/cjs/index.d.ts +173 -0
- package/lib/cjs/index.js +53 -1
- package/lib/cjs/recipes/{AttributesAndPingOneMapping.stories.js → AttributeMapping.stories.js} +392 -132
- package/lib/cjs/styles/colors.js +1 -1
- package/lib/cjs/styles/variants/README.md +98 -0
- package/lib/cjs/styles/variants/variants.js +2 -0
- package/lib/cjs/types/box.d.ts +10 -0
- package/lib/cjs/types/box.js +6 -0
- package/lib/cjs/types/icon.d.ts +34 -0
- package/lib/cjs/types/icon.js +6 -0
- package/lib/cjs/types/index.d.ts +7 -0
- package/lib/cjs/types/index.js +86 -0
- package/lib/cjs/types/loader.d.ts +14 -0
- package/lib/cjs/types/loader.js +6 -0
- package/lib/cjs/types/mdx.d.js +1 -0
- package/lib/cjs/types/popoverContainer.d.ts +23 -0
- package/lib/cjs/types/popoverContainer.js +6 -0
- package/lib/cjs/types/shared/dom.d.ts +9 -0
- package/lib/cjs/types/shared/dom.js +6 -0
- package/lib/cjs/types/shared/index.d.ts +3 -0
- package/lib/cjs/types/shared/index.js +42 -0
- package/lib/cjs/types/shared/style.d.ts +11 -0
- package/lib/cjs/types/shared/style.js +6 -0
- package/lib/cjs/types/shared/test.d.ts +3 -0
- package/lib/cjs/types/shared/test.js +6 -0
- package/lib/cjs/types/shared/utils.d.ts +1 -0
- package/lib/cjs/types/shared/utils.js +6 -0
- package/lib/cjs/types/tableCell.d.ts +5 -0
- package/lib/cjs/types/tableCell.js +6 -0
- package/lib/cjs/types/text.d.ts +3 -0
- package/lib/cjs/types/text.js +6 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.mdx +40 -0
- package/lib/components/AccordionGroup/Accordion.styles.js +1 -2
- package/lib/components/AccordionGroup/AccordionGroup.mdx +41 -0
- package/lib/components/ArrayField/ArrayField.mdx +34 -0
- package/lib/components/AstroWrapper/AstroWrapper.mdx +16 -0
- package/lib/components/Avatar/Avatar.mdx +14 -0
- package/lib/components/Badge/Badge.mdx +24 -0
- package/lib/components/Box/Box.js +4 -19
- package/lib/components/Box/Box.mdx +23 -0
- package/lib/components/Box/Box.test.js +2 -6
- package/lib/components/Bracket/Bracket.mdx +17 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.mdx +40 -0
- package/lib/components/Button/Button.mdx +40 -0
- package/lib/components/Button/Button.stories.js +30 -5
- package/lib/components/Button/Buttons.styles.js +25 -7
- package/lib/components/Calendar/Calendar.mdx +39 -0
- package/lib/components/Callout/Callout.mdx +28 -0
- package/lib/components/Card/Card.mdx +32 -0
- package/lib/components/CheckboxField/CheckboxField.mdx +42 -0
- package/lib/components/CodeView/CodeView.mdx +23 -0
- package/lib/components/CollapsiblePanel/CollapsiblePanel.mdx +29 -0
- package/lib/components/ColorField/ColorField.mdx +38 -0
- package/lib/components/ComboBoxField/ComboBoxField.mdx +66 -0
- package/lib/components/CopyText/CopyText.mdx +23 -0
- package/lib/components/DataTable/DataTable.mdx +54 -0
- package/lib/components/DatePicker/DatePicker.mdx +49 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +2 -1
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +36 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +29 -45
- package/lib/components/FileInputField/FileInputField.mdx +33 -0
- package/lib/components/HelpHint/HelpHint.mdx +32 -0
- package/lib/components/Icon/Icon.js +2 -25
- package/lib/components/Icon/Icon.mdx +49 -0
- package/lib/components/IconBadge/IconBadge.mdx +14 -0
- package/lib/components/IconButton/IconButton.mdx +33 -0
- package/lib/components/IconButtonToggle/IconButtonToggle.mdx +31 -0
- package/lib/components/Image/Image.mdx +28 -0
- package/lib/components/ImageUploadField/ImageUploadField.mdx +38 -0
- package/lib/components/Link/Link.mdx +27 -0
- package/lib/components/LinkSelectField/LinkSelectField.mdx +47 -0
- package/lib/components/ListItem/ListItem.mdx +21 -0
- package/lib/components/ListView/ListView.mdx +44 -0
- package/lib/components/ListView/ListView.stories.js +94 -48
- package/lib/components/Loader/Loader.js +0 -14
- package/lib/components/Loader/Loader.mdx +29 -0
- package/lib/components/Menu/Menu.mdx +43 -0
- package/lib/components/Messages/Messages.mdx +35 -0
- package/lib/components/Modal/Modal.mdx +59 -0
- package/lib/components/MultivaluesField/MultivaluesField.mdx +44 -0
- package/lib/components/NavBar/NavBar.mdx +42 -0
- package/lib/components/NumberField/NumberField.mdx +39 -0
- package/lib/components/OverlayPanel/OverlayPanel.mdx +39 -0
- package/lib/components/PasswordField/PasswordField.mdx +33 -0
- package/lib/components/PopoverContainer/PopoverContainer.js +7 -38
- package/lib/components/PopoverMenu/PopoverMenu.mdx +53 -0
- package/lib/components/RadioGroupField/RadioGroupField.mdx +41 -0
- package/lib/components/RequirementsList/RequirementsList.mdx +17 -0
- package/lib/components/RockerButtonGroup/RockerButtonGroup.mdx +36 -0
- package/lib/components/ScrollBox/ScrollBox.mdx +17 -0
- package/lib/components/SearchField/SearchField.mdx +33 -0
- package/lib/components/SelectField/SelectField.mdx +46 -0
- package/lib/components/Separator/Separator.mdx +19 -0
- package/lib/components/Stepper/Stepper.mdx +41 -0
- package/lib/components/SwitchField/SwitchField.mdx +36 -0
- package/lib/components/Table/Table.mdx +30 -0
- package/lib/components/TableCell/TableCell.js +0 -5
- package/lib/components/Tabs/Tabs.mdx +40 -0
- package/lib/components/Text/Text.js +3 -7
- package/lib/components/Text/Text.mdx +13 -0
- package/lib/components/TextAreaField/TextAreaField.mdx +34 -0
- package/lib/components/TextField/TextField.mdx +34 -0
- package/lib/components/TimeZonePicker/TimeZonePicker.mdx +18 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.mdx +21 -0
- package/lib/docs/Props.stories.mdx +35 -0
- package/lib/docs/Welcome.stories.mdx +149 -0
- package/lib/docs/hooks/useDebounce.stories.mdx +59 -0
- package/lib/docs/hooks/useModalState.stories.mdx +83 -0
- package/lib/docs/hooks/useOverlayPanelState.stories.mdx +84 -0
- package/lib/docs/theme/AstroNanoTheme.stories.mdx +174 -0
- package/lib/docs/theme/AstroTheme.stories.mdx +20 -0
- package/lib/docs/theme/CustomThemes.stories.mdx +70 -0
- package/lib/docs/theme/StylingGuideline.stories.mdx +116 -0
- package/lib/docs/utils/messagesReducer.stories.mdx +64 -0
- package/lib/experimental/EditButton/EditButton.js +50 -0
- package/lib/experimental/EditButton/EditButton.mdx +9 -0
- package/lib/experimental/EditButton/EditButton.stories.js +75 -0
- package/lib/experimental/EditButton/EditButton.test.js +68 -0
- package/lib/experimental/EditButton/index.js +1 -0
- package/lib/experimental/ListView/ListView.mdx +47 -0
- package/lib/experimental/ListView/ListView.stories.js +729 -0
- package/lib/experimental/ListViewItem/ListViewItem.js +24 -6
- package/lib/experimental/ListViewItem/ListViewItem.mdx +36 -0
- package/lib/experimental/ListViewItem/ListViewItem.stories.js +28 -5
- package/lib/experimental/ListViewItem/ListViewItem.test.js +45 -1
- package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.js +1 -4
- package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +4 -1
- package/lib/experimental/ListViewItem/controls/ListViewItemSwitchField.js +1 -0
- package/lib/experimental/ListViewItem/listViewItemAttributes.js +25 -12
- package/lib/experimental/PanelHeader/PanelHeader.js +75 -0
- package/lib/experimental/PanelHeader/PanelHeader.mdx +19 -0
- package/lib/experimental/PanelHeader/PanelHeader.stories.js +59 -0
- package/lib/experimental/PanelHeader/PanelHeader.styles.js +30 -0
- package/lib/experimental/PanelHeader/PanelHeader.test.js +43 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.js +25 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.stories.js +21 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.test.js +22 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.js +18 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.stories.js +26 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +55 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.js +18 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.stories.js +32 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.test.js +22 -0
- package/lib/experimental/PanelHeader/index.js +1 -0
- package/lib/experimental/README.stories.mdx +7 -0
- package/lib/experimental/SaveBar/SaveBar.mdx +13 -0
- package/lib/experimental/recipes/ListAndPanel.stories.js +1 -1
- package/lib/hooks/usePropWarning/usePropWarning.js +1 -1
- package/lib/hooks/useStatusClasses/useStatusClasses.js +2 -2
- package/lib/hooks/useTShirtSize/useTShirtSize.js +1 -1
- package/lib/index.js +6 -0
- package/lib/recipes/AttributeMapping.stories.js +540 -0
- package/lib/styles/colors.js +1 -1
- package/lib/styles/variants/README.md +98 -0
- package/lib/styles/variants/variants.js +2 -0
- package/lib/types/box.js +1 -0
- package/lib/types/icon.js +1 -0
- package/lib/types/index.js +7 -0
- package/lib/types/loader.js +1 -0
- package/lib/types/mdx.d.js +0 -0
- package/lib/types/popoverContainer.js +1 -0
- package/lib/types/shared/dom.js +1 -0
- package/lib/types/shared/index.js +3 -0
- package/lib/types/shared/style.js +1 -0
- package/lib/types/shared/test.js +1 -0
- package/lib/types/shared/utils.js +1 -0
- package/lib/types/tableCell.js +1 -0
- package/lib/types/text.js +1 -0
- package/package.json +19 -5
- package/CHANGELOG.md +0 -2565
- package/NOTICE +0 -2481
- package/NOTICE.html +0 -9174
- package/lib/cjs/recipes/AttributeMappingReadOnlyField.stories.js +0 -254
- package/lib/recipes/AttributeMappingReadOnlyField.stories.js +0 -243
- package/lib/recipes/AttributesAndPingOneMapping.stories.js +0 -282
@@ -0,0 +1,540 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
4
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
5
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
6
|
+
import React, { memo, useEffect, useRef, useState } from 'react';
|
7
|
+
import AddIcon from '@pingux/mdi-react/AddIcon';
|
8
|
+
import AlertCircleIcon from '@pingux/mdi-react/AlertCircleIcon';
|
9
|
+
import CogsIcon from '@pingux/mdi-react/CogsIcon';
|
10
|
+
import CreateIcon from '@pingux/mdi-react/CreateIcon';
|
11
|
+
import DeleteIcon from '@pingux/mdi-react/DeleteIcon';
|
12
|
+
import { v4 as uuid } from 'uuid';
|
13
|
+
import { Badge, Box, Button, ComboBoxField, HelpHint, Icon, IconButton, Item, ScrollBox, Separator, Text, TextField } from '../index';
|
14
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
15
|
+
export default {
|
16
|
+
title: 'Recipes/Attribute Mappings'
|
17
|
+
};
|
18
|
+
var sx = {
|
19
|
+
alertCircleIcon: {
|
20
|
+
position: 'absolute',
|
21
|
+
right: '4px',
|
22
|
+
top: '4px',
|
23
|
+
fill: '#A31300'
|
24
|
+
},
|
25
|
+
attributeMappingTitle: {
|
26
|
+
fontSize: 'lg',
|
27
|
+
lineHeight: '21px',
|
28
|
+
fontWeight: 3,
|
29
|
+
color: 'text.primary'
|
30
|
+
},
|
31
|
+
attributeMappingTitleWrapper: {
|
32
|
+
marginBottom: 'md',
|
33
|
+
alignItems: 'center'
|
34
|
+
},
|
35
|
+
badge: {
|
36
|
+
width: 'xx',
|
37
|
+
height: '22px',
|
38
|
+
alignSelf: 'center',
|
39
|
+
minWidth: 'fit-content',
|
40
|
+
border: '1px solid',
|
41
|
+
borderColor: 'neutral.80',
|
42
|
+
backgroundColor: 'white !important',
|
43
|
+
marginLeft: 8,
|
44
|
+
'& span': {
|
45
|
+
fontSize: 'sm',
|
46
|
+
lineHeight: 1,
|
47
|
+
color: '#253746'
|
48
|
+
}
|
49
|
+
},
|
50
|
+
createIconButton: {
|
51
|
+
marginLeft: 'xs'
|
52
|
+
},
|
53
|
+
defaultFieldsWrapperBox: {
|
54
|
+
padding: '10px 10px 24px 10px',
|
55
|
+
width: '450px',
|
56
|
+
backgroundColor: 'accent.99'
|
57
|
+
},
|
58
|
+
fieldColumnTitle: {
|
59
|
+
fontWeight: 3,
|
60
|
+
fontSize: 'md',
|
61
|
+
lineHeight: '18px',
|
62
|
+
marginBottom: 'xs'
|
63
|
+
},
|
64
|
+
fieldColumnTitleWrapper: {
|
65
|
+
width: 'calc(50% - 22px)'
|
66
|
+
},
|
67
|
+
fieldRowWrapper: {
|
68
|
+
alignItems: 'center',
|
69
|
+
marginTop: 'sm'
|
70
|
+
},
|
71
|
+
separator: {
|
72
|
+
width: '21px',
|
73
|
+
margin: '0 2px'
|
74
|
+
},
|
75
|
+
tooltipBox: {
|
76
|
+
marginLeft: 'xs',
|
77
|
+
height: 'md',
|
78
|
+
width: 'md'
|
79
|
+
}
|
80
|
+
};
|
81
|
+
var editSx = {
|
82
|
+
rowBox: {
|
83
|
+
mb: '24.95px'
|
84
|
+
},
|
85
|
+
textField: {
|
86
|
+
height: '40px !important'
|
87
|
+
},
|
88
|
+
comboBoxField: {
|
89
|
+
height: '40px !important',
|
90
|
+
pt: '5px !important'
|
91
|
+
},
|
92
|
+
headingText: {
|
93
|
+
fontSize: 'sm',
|
94
|
+
fontWeight: 0,
|
95
|
+
color: 'neutral.40'
|
96
|
+
},
|
97
|
+
firstRowTitle: {
|
98
|
+
fontWeight: 3,
|
99
|
+
fontSize: 'md',
|
100
|
+
maxWidth: '310px',
|
101
|
+
width: 'calc(50% - 26px)',
|
102
|
+
minWidth: '153px'
|
103
|
+
},
|
104
|
+
secondRowTitle: {
|
105
|
+
fontWeight: 3,
|
106
|
+
fontSize: 'md',
|
107
|
+
ml: 'sm',
|
108
|
+
flexGrow: 1
|
109
|
+
},
|
110
|
+
comboBoxAndIconParentBox: {
|
111
|
+
width: '378px',
|
112
|
+
ml: '12px',
|
113
|
+
alignItems: 'center'
|
114
|
+
},
|
115
|
+
headingParentBox: {
|
116
|
+
alignItems: 'center',
|
117
|
+
mb: 'md',
|
118
|
+
ml: 'xs'
|
119
|
+
},
|
120
|
+
addRowButton: {
|
121
|
+
ml: 'auto',
|
122
|
+
height: '22px',
|
123
|
+
minWidth: '0',
|
124
|
+
width: '70px'
|
125
|
+
},
|
126
|
+
addButtonIconBox: {
|
127
|
+
alignItems: 'center',
|
128
|
+
width: '38px',
|
129
|
+
justifyContent: 'center'
|
130
|
+
},
|
131
|
+
addIcon: {
|
132
|
+
mr: 'xs',
|
133
|
+
color: 'active'
|
134
|
+
},
|
135
|
+
editAttributesBox: {
|
136
|
+
bg: 'accent.99',
|
137
|
+
p: '16px'
|
138
|
+
},
|
139
|
+
scrollBox: {
|
140
|
+
mt: 'md',
|
141
|
+
maxHeight: '700px'
|
142
|
+
}
|
143
|
+
};
|
144
|
+
var helperTextId = uuid();
|
145
|
+
var Row = function Row(props) {
|
146
|
+
var withBadge = props.withBadge,
|
147
|
+
withTooltip = props.withTooltip,
|
148
|
+
withError = props.withError,
|
149
|
+
leftValue = props.leftValue,
|
150
|
+
rightValue = props.rightValue;
|
151
|
+
return ___EmotionJSX(Box, {
|
152
|
+
isRow: true,
|
153
|
+
sx: sx.fieldRowWrapper
|
154
|
+
}, ___EmotionJSX(TextField, {
|
155
|
+
isReadOnly: true,
|
156
|
+
value: leftValue,
|
157
|
+
labelProps: {
|
158
|
+
mb: 0
|
159
|
+
},
|
160
|
+
controlProps: {
|
161
|
+
variant: 'input.small',
|
162
|
+
'aria-label': "input ".concat(leftValue),
|
163
|
+
sx: {
|
164
|
+
width: '165px'
|
165
|
+
}
|
166
|
+
},
|
167
|
+
"aria-labelledby": withError && helperTextId,
|
168
|
+
slots: withError && {
|
169
|
+
inContainer: ___EmotionJSX(Icon, {
|
170
|
+
icon: AlertCircleIcon,
|
171
|
+
sx: sx.alertCircleIcon,
|
172
|
+
title: {
|
173
|
+
name: 'Alert Circle Icon'
|
174
|
+
}
|
175
|
+
})
|
176
|
+
}
|
177
|
+
}), ___EmotionJSX(Separator, {
|
178
|
+
sx: sx.separator
|
179
|
+
}), ___EmotionJSX(TextField, {
|
180
|
+
isReadOnly: true,
|
181
|
+
value: rightValue,
|
182
|
+
labelProps: {
|
183
|
+
mb: 0
|
184
|
+
},
|
185
|
+
controlProps: {
|
186
|
+
variant: 'input.small',
|
187
|
+
'aria-label': "input ".concat(rightValue),
|
188
|
+
sx: {
|
189
|
+
width: '165px'
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}), withBadge && ___EmotionJSX(Badge, {
|
193
|
+
label: "Required",
|
194
|
+
sx: sx.badge
|
195
|
+
}), withTooltip && ___EmotionJSX(Box, {
|
196
|
+
sx: sx.tooltipBox
|
197
|
+
}, ___EmotionJSX(HelpHint, {
|
198
|
+
tooltipProps: {
|
199
|
+
direction: 'bottom'
|
200
|
+
}
|
201
|
+
}, "Population set to default")));
|
202
|
+
};
|
203
|
+
var Title = function Title() {
|
204
|
+
return ___EmotionJSX(Box, {
|
205
|
+
isRow: true,
|
206
|
+
sx: sx.attributeMappingTitleWrapper
|
207
|
+
}, ___EmotionJSX(Text, {
|
208
|
+
sx: sx.attributeMappingTitle
|
209
|
+
}, "Attribute Mapping"), ___EmotionJSX(Box, null, ___EmotionJSX(IconButton, {
|
210
|
+
sx: sx.createIconButton,
|
211
|
+
variant: "inverted",
|
212
|
+
"aria-label": "edit header button"
|
213
|
+
}, ___EmotionJSX(Icon, {
|
214
|
+
icon: CreateIcon,
|
215
|
+
size: "sm",
|
216
|
+
title: {
|
217
|
+
name: 'Create Icon'
|
218
|
+
}
|
219
|
+
}))));
|
220
|
+
};
|
221
|
+
export var Display = function Display() {
|
222
|
+
return ___EmotionJSX(Box, null, ___EmotionJSX(Title, null), ___EmotionJSX(Box, {
|
223
|
+
sx: sx.defaultFieldsWrapperBox
|
224
|
+
}, ___EmotionJSX(Box, {
|
225
|
+
isRow: true,
|
226
|
+
sx: {
|
227
|
+
width: '100%'
|
228
|
+
}
|
229
|
+
}, ___EmotionJSX(Box, {
|
230
|
+
sx: sx.fieldColumnTitleWrapper
|
231
|
+
}, ___EmotionJSX(Text, {
|
232
|
+
sx: sx.fieldColumnTitle
|
233
|
+
}, "PingOne")), ___EmotionJSX(Box, {
|
234
|
+
sx: sx.fieldColumnTitleWrapper
|
235
|
+
}, ___EmotionJSX(Text, {
|
236
|
+
sx: sx.fieldColumnTitle
|
237
|
+
}, "Google Suites"))), ___EmotionJSX(Separator, null), ___EmotionJSX(Row, {
|
238
|
+
withBadge: true,
|
239
|
+
leftValue: "UserId",
|
240
|
+
rightValue: "mdorey"
|
241
|
+
}), ___EmotionJSX(Row, {
|
242
|
+
leftValue: "givenName",
|
243
|
+
rightValue: "firstName"
|
244
|
+
}), ___EmotionJSX(Row, {
|
245
|
+
leftValue: "familyName",
|
246
|
+
rightValue: "lastName"
|
247
|
+
}), ___EmotionJSX(Row, {
|
248
|
+
withTooltip: true,
|
249
|
+
leftValue: "population",
|
250
|
+
rightValue: "population"
|
251
|
+
}), ___EmotionJSX(Row, {
|
252
|
+
leftValue: "password",
|
253
|
+
rightValue: "password"
|
254
|
+
})));
|
255
|
+
};
|
256
|
+
export var DisplayWithError = function DisplayWithError() {
|
257
|
+
var withError = true;
|
258
|
+
var withErrorSx = {
|
259
|
+
errorBox: {
|
260
|
+
flexDirection: 'row !important',
|
261
|
+
alignItems: 'center',
|
262
|
+
padding: '13px 12px 13px 15px',
|
263
|
+
gap: 'md',
|
264
|
+
border: '1px solid #A31300',
|
265
|
+
width: '450px',
|
266
|
+
marginBottom: 'xs'
|
267
|
+
},
|
268
|
+
text: {
|
269
|
+
fontSize: 'sm',
|
270
|
+
lineHeight: '15px'
|
271
|
+
}
|
272
|
+
};
|
273
|
+
return ___EmotionJSX(Box, null, ___EmotionJSX(Title, null), withError && ___EmotionJSX(Box, {
|
274
|
+
sx: withErrorSx.errorBox
|
275
|
+
}, ___EmotionJSX(Icon, {
|
276
|
+
size: 24,
|
277
|
+
icon: AlertCircleIcon,
|
278
|
+
color: "#A31300",
|
279
|
+
title: {
|
280
|
+
name: 'Alert Circle Icon'
|
281
|
+
}
|
282
|
+
}), ___EmotionJSX(Text, {
|
283
|
+
sx: withErrorSx.text,
|
284
|
+
id: helperTextId,
|
285
|
+
role: "alert"
|
286
|
+
}, "This attribute is unavailable. Please map the attribute again or re-map to a different attribute.")), ___EmotionJSX(Box, {
|
287
|
+
sx: sx.defaultFieldsWrapperBox
|
288
|
+
}, ___EmotionJSX(Box, {
|
289
|
+
isRow: true,
|
290
|
+
sx: {
|
291
|
+
width: '100%'
|
292
|
+
}
|
293
|
+
}, ___EmotionJSX(Box, {
|
294
|
+
sx: sx.fieldColumnTitleWrapper
|
295
|
+
}, ___EmotionJSX(Text, {
|
296
|
+
sx: sx.fieldColumnTitle
|
297
|
+
}, "PingOne")), ___EmotionJSX(Box, {
|
298
|
+
sx: sx.fieldColumnTitleWrapper
|
299
|
+
}, ___EmotionJSX(Text, {
|
300
|
+
sx: sx.fieldColumnTitle
|
301
|
+
}, "Google Suites"))), ___EmotionJSX(Separator, null), ___EmotionJSX(Row, {
|
302
|
+
withBadge: true,
|
303
|
+
leftValue: "UserId",
|
304
|
+
rightValue: "mdorey"
|
305
|
+
}), ___EmotionJSX(Row, {
|
306
|
+
withError: withError,
|
307
|
+
leftValue: "givenName",
|
308
|
+
rightValue: "firstName"
|
309
|
+
}), ___EmotionJSX(Row, {
|
310
|
+
withError: withError,
|
311
|
+
leftValue: "familyName",
|
312
|
+
rightValue: "lastName"
|
313
|
+
})));
|
314
|
+
};
|
315
|
+
export var Edit = function Edit() {
|
316
|
+
var defaultRows = [{
|
317
|
+
isDisabled: false,
|
318
|
+
textValue: '',
|
319
|
+
inputValue: '',
|
320
|
+
name: 'first default'
|
321
|
+
}, {
|
322
|
+
isDisabled: false,
|
323
|
+
textValue: '',
|
324
|
+
inputValue: '',
|
325
|
+
name: 'second default'
|
326
|
+
}];
|
327
|
+
var _useState = useState(defaultRows),
|
328
|
+
_useState2 = _slicedToArray(_useState, 2),
|
329
|
+
rows = _useState2[0],
|
330
|
+
setRows = _useState2[1];
|
331
|
+
var _useState3 = useState(false),
|
332
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
333
|
+
isSubmitted = _useState4[0],
|
334
|
+
submitFields = _useState4[1];
|
335
|
+
var addRow = function addRow() {
|
336
|
+
var _context;
|
337
|
+
var newRow = {
|
338
|
+
isDisabled: false,
|
339
|
+
isNewRow: true,
|
340
|
+
textValue: '',
|
341
|
+
inputValue: '',
|
342
|
+
name: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)
|
343
|
+
};
|
344
|
+
setRows(_concatInstanceProperty(_context = []).call(_context, rows, [newRow]));
|
345
|
+
};
|
346
|
+
var removeRow = function removeRow(rowIndex) {
|
347
|
+
var _context2;
|
348
|
+
var newArray = _filterInstanceProperty(rows).call(rows, function (row, index) {
|
349
|
+
return rowIndex !== index;
|
350
|
+
});
|
351
|
+
setRows(_concatInstanceProperty(_context2 = []).call(_context2, newArray));
|
352
|
+
};
|
353
|
+
var updateRow = function updateRow(rowIndex, value, attribute) {
|
354
|
+
var _context3;
|
355
|
+
var newArray = _mapInstanceProperty(rows).call(rows, function (row, index) {
|
356
|
+
if (rowIndex === index) {
|
357
|
+
var thisRow = rows[index];
|
358
|
+
thisRow[attribute] = value;
|
359
|
+
return thisRow;
|
360
|
+
}
|
361
|
+
return row;
|
362
|
+
});
|
363
|
+
setRows(_concatInstanceProperty(_context3 = []).call(_context3, newArray));
|
364
|
+
};
|
365
|
+
return ___EmotionJSX(Box, {
|
366
|
+
maxWidth: "740px"
|
367
|
+
}, ___EmotionJSX(Box, {
|
368
|
+
isRow: true,
|
369
|
+
sx: editSx.headingParentBox
|
370
|
+
}, ___EmotionJSX(Text, {
|
371
|
+
sx: editSx.headingText
|
372
|
+
}, "Create new attributes and map predefined attributes with their PingOne Mappings."), ___EmotionJSX(Button, {
|
373
|
+
variant: "inline",
|
374
|
+
onPress: addRow,
|
375
|
+
sx: editSx.addRowButton
|
376
|
+
}, ___EmotionJSX(Box, {
|
377
|
+
isRow: true,
|
378
|
+
sx: editSx.addButtonIconBox
|
379
|
+
}, ___EmotionJSX(Icon, {
|
380
|
+
icon: AddIcon,
|
381
|
+
size: 15,
|
382
|
+
title: {
|
383
|
+
name: 'Add Icon'
|
384
|
+
},
|
385
|
+
sx: editSx.addIcon
|
386
|
+
}), "Add"))), ___EmotionJSX(Box, {
|
387
|
+
sx: editSx.editAttributesBox
|
388
|
+
}, ___EmotionJSX(Box, {
|
389
|
+
isRow: true
|
390
|
+
}, ___EmotionJSX(Text, {
|
391
|
+
sx: editSx.firstRowTitle
|
392
|
+
}, "Attributes"), ___EmotionJSX(Text, {
|
393
|
+
sx: editSx.secondRowTitle
|
394
|
+
}, "PingOne Mappings")), ___EmotionJSX(Separator, null), ___EmotionJSX(ScrollBox, {
|
395
|
+
sx: editSx.scrollBox
|
396
|
+
}, ___EmotionJSX(Box, null, _mapInstanceProperty(rows).call(rows, function (row, index) {
|
397
|
+
return ___EmotionJSX(EditRow, _extends({}, row, {
|
398
|
+
index: index,
|
399
|
+
removeRow: removeRow,
|
400
|
+
updateRow: updateRow,
|
401
|
+
key: "row container ".concat(row.name),
|
402
|
+
isSubmitted: isSubmitted,
|
403
|
+
submitFields: submitFields
|
404
|
+
}));
|
405
|
+
})))));
|
406
|
+
};
|
407
|
+
var EditRow = /*#__PURE__*/memo(function (props) {
|
408
|
+
var isDisabled = props.isDisabled,
|
409
|
+
isNewRow = props.isNewRow,
|
410
|
+
index = props.index,
|
411
|
+
textValue = props.textValue,
|
412
|
+
inputValue = props.inputValue,
|
413
|
+
updateRow = props.updateRow,
|
414
|
+
removeRow = props.removeRow,
|
415
|
+
areRowsValid = props.areRowsValid,
|
416
|
+
isSubmitted = props.isSubmitted,
|
417
|
+
submitFields = props.submitFields;
|
418
|
+
var items = [{
|
419
|
+
name: 'Aardvark',
|
420
|
+
id: '1'
|
421
|
+
}, {
|
422
|
+
name: 'Kangaroo',
|
423
|
+
id: '2'
|
424
|
+
}, {
|
425
|
+
name: 'Snake',
|
426
|
+
id: '3'
|
427
|
+
}];
|
428
|
+
var rowRef = useRef();
|
429
|
+
var textFieldRef = useRef();
|
430
|
+
var setTextValue = function setTextValue(value) {
|
431
|
+
updateRow(index, value, 'textValue');
|
432
|
+
submitFields(false);
|
433
|
+
};
|
434
|
+
var setInputValue = function setInputValue(value) {
|
435
|
+
updateRow(index, value, 'inputValue');
|
436
|
+
submitFields(false);
|
437
|
+
};
|
438
|
+
useEffect(function () {
|
439
|
+
if (isNewRow) {
|
440
|
+
textFieldRef.current.focus();
|
441
|
+
textFieldRef.current.scrollIntoView();
|
442
|
+
}
|
443
|
+
}, []);
|
444
|
+
var isInputValueEmpty = !areRowsValid && isSubmitted && inputValue === '' && textValue !== '';
|
445
|
+
var isTextValueEmpty = !areRowsValid && isSubmitted && textValue === '' && inputValue !== '';
|
446
|
+
return ___EmotionJSX(Box, {
|
447
|
+
isRow: true,
|
448
|
+
alignItems: "center",
|
449
|
+
mb: "md",
|
450
|
+
ref: rowRef
|
451
|
+
}, ___EmotionJSX(Box, {
|
452
|
+
width: "310px",
|
453
|
+
sx: isInputValueEmpty ? editSx.rowBox : {}
|
454
|
+
}, ___EmotionJSX(TextField, {
|
455
|
+
name: "custom-name",
|
456
|
+
"aria-label": "text field",
|
457
|
+
labelProps: {
|
458
|
+
'aria-label': 'selection field',
|
459
|
+
mb: 0
|
460
|
+
},
|
461
|
+
controlProps: {
|
462
|
+
sx: editSx.textField
|
463
|
+
},
|
464
|
+
id: "textField ".concat(index),
|
465
|
+
key: "textField ".concat(index),
|
466
|
+
isReadOnly: isDisabled,
|
467
|
+
value: textValue,
|
468
|
+
onChange: function onChange(e) {
|
469
|
+
return setTextValue(e.target.value);
|
470
|
+
},
|
471
|
+
ref: textFieldRef,
|
472
|
+
status: isTextValueEmpty ? 'error' : 'default',
|
473
|
+
helperText: !areRowsValid && isSubmitted && textValue === '' && inputValue !== '' ? 'Enter an attribute.' : null
|
474
|
+
})), ___EmotionJSX(Box, {
|
475
|
+
isRow: true,
|
476
|
+
sx: isInputValueEmpty ? editSx.rowBox : {} && editSx.comboBoxAndIconParentBox
|
477
|
+
}, ___EmotionJSX(Box, {
|
478
|
+
flexGrow: "1",
|
479
|
+
maxWidth: "310px"
|
480
|
+
}, ___EmotionJSX(ComboBoxField, {
|
481
|
+
items: items,
|
482
|
+
labelMode: "float",
|
483
|
+
id: "inputField ".concat(index),
|
484
|
+
key: "inputField ".concat(index),
|
485
|
+
status: isInputValueEmpty ? 'error' : 'default',
|
486
|
+
helperText: isInputValueEmpty ? 'Select an item.' : null,
|
487
|
+
labelProps: {
|
488
|
+
'aria-label': 'selection field',
|
489
|
+
mb: 0
|
490
|
+
},
|
491
|
+
"aria-label": "selection field",
|
492
|
+
controlProps: {
|
493
|
+
'aria-label': 'selection field',
|
494
|
+
sx: editSx.comboBoxField
|
495
|
+
},
|
496
|
+
containerProps: {
|
497
|
+
width: '100%',
|
498
|
+
maxWidth: '310px'
|
499
|
+
},
|
500
|
+
inputValue: inputValue,
|
501
|
+
onInputChange: setInputValue
|
502
|
+
}, function (item) {
|
503
|
+
return ___EmotionJSX(Item, {
|
504
|
+
key: item.name,
|
505
|
+
"data-id": item.name
|
506
|
+
}, item.name);
|
507
|
+
})), ___EmotionJSX(Box, {
|
508
|
+
isRow: true,
|
509
|
+
alignItems: "center",
|
510
|
+
ml: "xs",
|
511
|
+
sx: isInputValueEmpty && {
|
512
|
+
mb: '22.475px',
|
513
|
+
ml: 'xs'
|
514
|
+
}
|
515
|
+
}, ___EmotionJSX(IconButton, {
|
516
|
+
"aria-label": "icon button with tooltip",
|
517
|
+
title: "Advanced Expression"
|
518
|
+
}, ___EmotionJSX(Icon, {
|
519
|
+
icon: CogsIcon,
|
520
|
+
size: "sm",
|
521
|
+
title: {
|
522
|
+
name: 'Cogs Icon'
|
523
|
+
}
|
524
|
+
})), ___EmotionJSX(IconButton, {
|
525
|
+
"aria-label": "icon button with tooltip",
|
526
|
+
title: "Delete",
|
527
|
+
sx: {
|
528
|
+
ml: 'xs'
|
529
|
+
},
|
530
|
+
onPress: function onPress() {
|
531
|
+
return removeRow(index);
|
532
|
+
}
|
533
|
+
}, ___EmotionJSX(Icon, {
|
534
|
+
icon: DeleteIcon,
|
535
|
+
size: "sm",
|
536
|
+
title: {
|
537
|
+
name: 'Delete Icon'
|
538
|
+
}
|
539
|
+
})))));
|
540
|
+
});
|
package/lib/styles/colors.js
CHANGED
@@ -0,0 +1,98 @@
|
|
1
|
+
# Variant Naming Conventions
|
2
|
+
|
3
|
+
Variant names should be camel case so that dot notation can be used, e.g. `delete theme.buttons.myButton`.
|
4
|
+
|
5
|
+
When it comes to mapping the variant within the theme, the foundation of a component is the main differentiator. There are two types currently:
|
6
|
+
1. Components which leverage a Theme UI base
|
7
|
+
2. Custom components or layout components, often built on the `Box` component
|
8
|
+
|
9
|
+
If a component is built on top of a Theme UI component, we follow their existing [variant groups](https://theme-ui.com/components/variants), e.g. any variant for an `IconButton` should be placed within the `buttons` object in the theme because it uses the `IconButton` from Theme UI as its base.
|
10
|
+
|
11
|
+
If a component is custom or used for layout purposes, it will often have `Box` as its base. For these components, we create our own variant group for it under the `variants` object in the theme, e.g. `variants.modal`. Within this object is typically where internal layout variants will go for that component, e.g. `variants.modal.container`. NOTE: You don't need to specify `variants` in the naming, it's just used here for demo purposes.
|
12
|
+
|
13
|
+
|
14
|
+
## Example of component with Theme UI base
|
15
|
+
|
16
|
+
In the example below, `MyBadge` utilizes the Astro `Badge` component which is based on the Theme UI `Badge` component. The object within `MyBadge.styles.js` would then be exported as part of the theme within the `badges` object.
|
17
|
+
|
18
|
+
```js
|
19
|
+
// `src/components/MyBadge/MyBadge.js`
|
20
|
+
const MyBadge = () => <Badge variant="myBadge" />;
|
21
|
+
|
22
|
+
// `src/components/MyBadge/MyBadge.styles.js`
|
23
|
+
const myBadge = { backgroundColor: 'red' };
|
24
|
+
export default { myBadge };
|
25
|
+
|
26
|
+
// `src/styles/variants/index.js`
|
27
|
+
import defaultBadges from '../../components/Badge/Badge.styles';
|
28
|
+
import myBadge from '../../components/MyBadge/MyBadge.styles';
|
29
|
+
export const badges = { ...defaultBadges, ...myBadge };
|
30
|
+
|
31
|
+
// `src/styles/theme.js`
|
32
|
+
import { badges } from './variants';
|
33
|
+
const theme = { badges };
|
34
|
+
```
|
35
|
+
|
36
|
+
This results in a `theme` object as such:
|
37
|
+
|
38
|
+
```json
|
39
|
+
{
|
40
|
+
"badges": {
|
41
|
+
"myBadge": { "backgroundColor": "red" }
|
42
|
+
}
|
43
|
+
}
|
44
|
+
```
|
45
|
+
|
46
|
+
## Example of custom component and internal layout components
|
47
|
+
|
48
|
+
In the example below, `MyComponent` is custom and has `Box` as its foundation. It also includes layout components and a `Button`. Since the `Button` component is built on a Theme UI base, it will follow the variant naming rules for those types of components. The object within `MyComponent.styles.js` should then be exported as part of the theme within the `variants` object.
|
49
|
+
|
50
|
+
```js
|
51
|
+
// `src/components/MyComponent/MyComponent.js`
|
52
|
+
const MyComponent = () => (
|
53
|
+
<Box variant="myComponent.container">
|
54
|
+
<Box variant="myComponent.leftSide" />
|
55
|
+
<Box variant="myComponent.rightSide" />
|
56
|
+
{/* The Button variant is exported differently in the theme */}
|
57
|
+
<Button variant="myComponentButton">Click me</Button>
|
58
|
+
</Box>
|
59
|
+
);
|
60
|
+
|
61
|
+
// `src/components/MyComponent/MyComponent.styles.js`
|
62
|
+
export const myComponentButton = { backgroundColor: 'critical' };
|
63
|
+
const container = { paddingTop: 'xl' };
|
64
|
+
const leftSide = { width: '100px', backgroundColor: 'green' };
|
65
|
+
const rightSide = { width: '20px', backgroundColor: 'orange' };
|
66
|
+
export default { container, leftSide, rightSide };
|
67
|
+
|
68
|
+
// `src/styles/variants/variants.js`
|
69
|
+
import myComponent from '../../components/MyComponent/MyComponent.styles';
|
70
|
+
export default { myComponent };
|
71
|
+
|
72
|
+
// `src/styles/variants/index.js`
|
73
|
+
import defaultButtons from '../../components/Button/Button.styles';
|
74
|
+
import { myComponentButton } from '../../components/MyComponent/MyComponent.styles';
|
75
|
+
export const buttons = { ...defaultButtons, myComponentButton };
|
76
|
+
export { default as variants } from './variants';
|
77
|
+
|
78
|
+
// `src/styles/theme.js`
|
79
|
+
import { buttons, variants } from './variants';
|
80
|
+
const theme = { buttons, variants };
|
81
|
+
```
|
82
|
+
|
83
|
+
This results in a `theme` object as such:
|
84
|
+
|
85
|
+
```json
|
86
|
+
{
|
87
|
+
"buttons": {
|
88
|
+
"myComponentButton": { "backgroundColor": "critical" }
|
89
|
+
},
|
90
|
+
"variants": {
|
91
|
+
"myComponent": {
|
92
|
+
"container": { "paddingTop": "xl" },
|
93
|
+
"leftSide": { "width": "100px", "backgroundColor": "green" },
|
94
|
+
"rightSide": { "width": "20px", "backgroundColor": "orange" }
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
```
|
@@ -43,6 +43,7 @@ import table from '../../components/Table/Table.styles';
|
|
43
43
|
import * as tab from '../../components/Tabs/Tabs.style';
|
44
44
|
import timeZone from '../../components/TimeZonePicker/TimeZone.styles';
|
45
45
|
import tooltip from '../../components/TooltipTrigger/Tooltip.styles';
|
46
|
+
import panelHeader from '../../experimental/PanelHeader/PanelHeader.styles';
|
46
47
|
export default _objectSpread({
|
47
48
|
accordion: accordion,
|
48
49
|
accordionGrid: accordionGrid,
|
@@ -70,6 +71,7 @@ export default _objectSpread({
|
|
70
71
|
navBar: navBar,
|
71
72
|
overlayPanel: overlayPanel,
|
72
73
|
popoverMenu: popoverMenu,
|
74
|
+
panelHeader: panelHeader,
|
73
75
|
rockerButton: rockerButton,
|
74
76
|
scrollBox: scrollBox,
|
75
77
|
separator: separator,
|
package/lib/types/box.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|