@hellobetterdigitalnz/betterui 0.0.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -30
- package/package.json +48 -45
- package/src/App.tsx +30 -30
- package/src/Components/DataDisplay/Accordion/Accordion.stories.tsx +57 -57
- package/src/Components/DataDisplay/Accordion/Accordion.tsx +14 -14
- package/src/Components/DataDisplay/Accordion/AccordionContext.tsx +11 -11
- package/src/Components/DataDisplay/Accordion/AccordionContextInterface.tsx +8 -8
- package/src/Components/DataDisplay/Accordion/AccordionItem.tsx +62 -62
- package/src/Components/DataDisplay/Accordion/AccordionItemProps.tsx +12 -12
- package/src/Components/DataDisplay/Accordion/AccordionProps.tsx +8 -8
- package/src/Components/DataDisplay/Accordion/AccordionProvider.tsx +65 -65
- package/src/Components/DataDisplay/Accordion/AccordionProviderInterface.tsx +8 -8
- package/src/Components/DataDisplay/Accordion/accordion.module.scss +56 -56
- package/src/Components/DataDisplay/Badge/Badge.stories.tsx +44 -44
- package/src/Components/DataDisplay/Badge/Badge.tsx +32 -32
- package/src/Components/DataDisplay/Badge/BadgeProps.tsx +6 -6
- package/src/Components/DataDisplay/Badge/badge.module.scss +42 -42
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCard.stories.tsx +26 -26
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCard.tsx +47 -47
- package/src/Components/DataDisplay/Cards/BannerCard/BannerCardInterface.tsx +15 -15
- package/src/Components/DataDisplay/Cards/BannerCard/banner-card.scss +54 -54
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCard.stories.tsx +31 -31
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCard.tsx +53 -53
- package/src/Components/DataDisplay/Cards/PathwayCard/PathwayCardInterface.tsx +17 -17
- package/src/Components/DataDisplay/Cards/PathwayCard/pathway-card-stories.scss +3 -3
- package/src/Components/DataDisplay/Cards/PathwayCard/pathway-card.scss +62 -62
- package/src/Components/DataDisplay/Media/Media.stories.tsx +30 -0
- package/src/Components/DataDisplay/Media/Media.tsx +28 -7
- package/src/Components/DataDisplay/Media/media.module.scss +8 -0
- package/src/Components/DataDisplay/Modal/Modal.stories.tsx +27 -0
- package/src/Components/DataDisplay/Modal/Modal.tsx +16 -5
- package/src/Components/DataDisplay/Modal/ModalActions.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalActionsLeft.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalActionsRight.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalBody.tsx +15 -5
- package/src/Components/DataDisplay/Modal/ModalBodyProps.tsx +7 -0
- package/src/Components/DataDisplay/Modal/ModalCurtain.tsx +5 -5
- package/src/Components/DataDisplay/Modal/ModalHeader.tsx +32 -5
- package/src/Components/DataDisplay/Modal/ModalHeaderProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/modal.module.scss +58 -0
- package/src/Components/DataDisplay/NotificationsBell/NotificationBell.stories.tsx +27 -27
- package/src/Components/DataDisplay/NotificationsBell/NotificationsBell.tsx +51 -51
- package/src/Components/DataDisplay/NotificationsBell/notificationBell.module.scss +47 -47
- package/src/Components/DataDisplay/NotificationsPanel/Notification.stories.tsx +128 -128
- package/src/Components/DataDisplay/NotificationsPanel/Notification.tsx +59 -59
- package/src/Components/DataDisplay/NotificationsPanel/NotificationProps.tsx +11 -11
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroup.tsx +17 -17
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroupProps.tsx +8 -8
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroups.tsx +42 -42
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsGroupsProps.tsx +7 -7
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsHeader.tsx +27 -27
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsHeaderProps.tsx +7 -9
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsNone.tsx +11 -11
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsPanel.tsx +8 -8
- package/src/Components/DataDisplay/NotificationsPanel/NotificationsPanelProps.tsx +6 -6
- package/src/Components/DataDisplay/NotificationsPanel/notificationPanel.module.scss +196 -196
- package/src/Components/DataDisplay/Tab/Tab.stories.tsx +72 -72
- package/src/Components/DataDisplay/Tab/Tab.tsx +20 -20
- package/src/Components/DataDisplay/Tab/TabBody.tsx +6 -6
- package/src/Components/DataDisplay/Tab/TabBodyContent.tsx +15 -15
- package/src/Components/DataDisplay/Tab/TabBodyContentProps.tsx +9 -9
- package/src/Components/DataDisplay/Tab/TabBodyProps.tsx +8 -8
- package/src/Components/DataDisplay/Tab/TabContext.tsx +9 -9
- package/src/Components/DataDisplay/Tab/TabContextProps.tsx +6 -6
- package/src/Components/DataDisplay/Tab/TabNav.tsx +6 -6
- package/src/Components/DataDisplay/Tab/TabNavItem.tsx +49 -49
- package/src/Components/DataDisplay/Tab/TabNavItemProps.tsx +9 -9
- package/src/Components/DataDisplay/Tab/TabNavProps.tsx +8 -8
- package/src/Components/DataDisplay/Tab/TabProps.tsx +8 -8
- package/src/Components/DataDisplay/Tab/tab.module.scss +35 -35
- package/src/Components/DataDisplay/Tab/tab.stories.scss +3 -3
- package/src/Components/DataDisplay/Table/Table.stories.tsx +64 -64
- package/src/Components/DataDisplay/Table/Table.tsx +10 -10
- package/src/Components/DataDisplay/Table/TableBody.tsx +13 -13
- package/src/Components/DataDisplay/Table/TableBodyProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/TableCell.tsx +30 -30
- package/src/Components/DataDisplay/Table/TableCellAction.tsx +27 -27
- package/src/Components/DataDisplay/Table/TableCellActionProps.tsx +11 -11
- package/src/Components/DataDisplay/Table/TableCellProps.tsx +11 -11
- package/src/Components/DataDisplay/Table/TableCellWithDesc.tsx +21 -21
- package/src/Components/DataDisplay/Table/TableCellWithDescProps.tsx +9 -9
- package/src/Components/DataDisplay/Table/TableCellWithImage.tsx +39 -39
- package/src/Components/DataDisplay/Table/TableCellWithImageProps.tsx +10 -10
- package/src/Components/DataDisplay/Table/TableFooter.tsx +5 -5
- package/src/Components/DataDisplay/Table/TableHead.tsx +11 -11
- package/src/Components/DataDisplay/Table/TableHeadProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/TableHeaderCell.tsx +17 -17
- package/src/Components/DataDisplay/Table/TableHeaderCellProps.tsx +10 -10
- package/src/Components/DataDisplay/Table/TableProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/TableRow.tsx +9 -9
- package/src/Components/DataDisplay/Table/TableRowProps.tsx +8 -8
- package/src/Components/DataDisplay/Table/table.module.scss +103 -103
- package/src/Components/Form/Button/Button.stories.tsx +66 -66
- package/src/Components/Form/Button/Button.tsx +64 -64
- package/src/Components/Form/Button/ButtonProps.tsx +18 -18
- package/src/Components/Form/Button/button.module.scss +142 -142
- package/src/Components/Form/Checkbox/Checkbox.stories.tsx +49 -49
- package/src/Components/Form/Checkbox/Checkbox.tsx +85 -85
- package/src/Components/Form/Checkbox/CheckboxProps.tsx +22 -22
- package/src/Components/Form/Checkbox/checkbox.module.scss +63 -63
- package/src/Components/Form/CheckboxSelect/CheckboxSelect.tsx +5 -5
- package/src/Components/Form/CheckboxSelect/CheckboxSelectItem.tsx +5 -5
- package/src/Components/Form/CheckboxSet/CheckboxSet.stories.tsx +93 -93
- package/src/Components/Form/CheckboxSet/CheckboxSet.tsx +14 -14
- package/src/Components/Form/CheckboxSet/CheckboxSetItem.tsx +88 -88
- package/src/Components/Form/CheckboxSet/CheckboxSetProps.tsx +9 -9
- package/src/Components/Form/CheckboxSet/checkboxSet.module.scss +13 -13
- package/src/Components/Form/CurrencyField/CurrenctField.stories.tsx +22 -22
- package/src/Components/Form/CurrencyField/CurrencyField.tsx +59 -59
- package/src/Components/Form/CurrencyField/CurrencyFieldProps.tsx +8 -8
- package/src/Components/Form/DateField/DateField.stories.tsx +22 -22
- package/src/Components/Form/DateField/DateField.tsx +58 -58
- package/src/Components/Form/DropdownBadge/DropdownBadge.stories.tsx +49 -49
- package/src/Components/Form/DropdownBadge/DropdownBadge.tsx +160 -160
- package/src/Components/Form/DropdownBadge/DropdownBadgeItem.tsx +40 -40
- package/src/Components/Form/DropdownBadge/DropdownBadgeItemProps.tsx +10 -10
- package/src/Components/Form/DropdownBadge/DropdownBadgeProps.tsx +31 -31
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelector.tsx +11 -11
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelectorProps.tsx +7 -7
- package/src/Components/Form/DropdownBadge/dropdownBadge.module.scss +105 -105
- package/src/Components/Form/DropdownField/DropdownField.stories.tsx +50 -50
- package/src/Components/Form/DropdownField/DropdownField.tsx +118 -118
- package/src/Components/Form/DropdownField/DropdownFieldItem.tsx +26 -26
- package/src/Components/Form/DropdownField/DropdownFieldItemProps.tsx +9 -9
- package/src/Components/Form/DropdownField/DropdownFieldProps.tsx +33 -33
- package/src/Components/Form/DropdownField/DropdownFieldSelector.tsx +15 -15
- package/src/Components/Form/DropdownField/DropdownFieldSelectorProps.tsx +7 -7
- package/src/Components/Form/DropdownField/dropdown.module.scss +79 -79
- package/src/Components/Form/EmailField/EmailField.stories.ts +23 -23
- package/src/Components/Form/EmailField/EmailField.tsx +51 -51
- package/src/Components/Form/ErrorMessage/ErrorMessage.tsx +5 -5
- package/src/Components/Form/FormFieldHolder/FormFieldHolder.stories.tsx +30 -0
- package/src/Components/Form/FormFieldHolder/FormFieldHolder.tsx +40 -5
- package/src/Components/Form/FormFieldHolder/FormFieldHolderProps.tsx +12 -0
- package/src/Components/Form/FormFieldHolder/formHolder.module.scss +56 -0
- package/src/Components/Form/IconButton/IconButton.stories.tsx +45 -45
- package/src/Components/Form/IconButton/IconButton.tsx +58 -58
- package/src/Components/Form/IconButton/IconButtonProps.tsx +15 -15
- package/src/Components/Form/IconButton/iconButton.module.scss +111 -111
- package/src/Components/Form/InputProps.tsx +25 -25
- package/src/Components/Form/MultiSelectField/MultiSelectField.tsx +5 -5
- package/src/Components/Form/MultiSelectField/MultiSelectFieldItem.tsx +5 -5
- package/src/Components/Form/MultiSelectField/MultiSelectFieldTag.tsx +5 -5
- package/src/Components/Form/PasswordField/PasswordField.stories.tsx +22 -22
- package/src/Components/Form/PasswordField/PasswordField.tsx +70 -70
- package/src/Components/Form/RadioButtons/RadioButton.tsx +70 -70
- package/src/Components/Form/RadioButtons/RadioButtonProps.tsx +22 -22
- package/src/Components/Form/RadioButtons/RadioButtons.stories.tsx +64 -64
- package/src/Components/Form/RadioButtons/RadioButtons.tsx +18 -18
- package/src/Components/Form/RadioButtons/RadioButtonsProps.tsx +10 -10
- package/src/Components/Form/RadioButtons/radioButton.stories.scss +3 -3
- package/src/Components/Form/RadioButtons/radiobutton.module.scss +63 -63
- package/src/Components/Form/TextField/TextField.stories.ts +22 -23
- package/src/Components/Form/TextField/TextField.tsx +56 -52
- package/src/Components/Form/TextField/TextFieldProps.tsx +8 -0
- package/src/Components/Form/Textarea/Textarea.stories.ts +31 -31
- package/src/Components/Form/Textarea/Textarea.tsx +71 -71
- package/src/Components/Form/Textarea/TextareaProps.tsx +27 -27
- package/src/Components/Form/Textarea/textarea.module.scss +49 -49
- package/src/Components/Form/TimeField/TimeField.stories.tsx +22 -22
- package/src/Components/Form/TimeField/TimeField.tsx +58 -58
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.stories.tsx +49 -49
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.tsx +87 -87
- package/src/Components/Form/ToggleSwitch/ToggleSwitchProps.tsx +22 -22
- package/src/Components/Form/ToggleSwitch/toggleSwitch.module.scss +82 -82
- package/src/Components/Form/inputs.module.scss +129 -121
- package/src/Components/Icons/Arrows/CaretDown/CaretDown.tsx +49 -49
- package/src/Components/Icons/Arrows/CaretLeft/CaretLeft.tsx +102 -0
- package/src/Components/Icons/Arrows/CaretRight/CaretRight.tsx +102 -0
- package/src/Components/Icons/Arrows/CaretUp/CaretUp.tsx +49 -49
- package/src/Components/Icons/Brand/WindowLogo/WindowLogo.tsx +105 -0
- package/src/Components/Icons/Commerce/CurrencyDollarSimple/CurrencyDollarSimple.tsx +105 -105
- package/src/Components/Icons/Communication/AddressBook/AddressBook.stories.ts +28 -28
- package/src/Components/Icons/Communication/AddressBook/AddressBook.tsx +50 -50
- package/src/Components/Icons/Communication/Asterick/Asterisk.stories.ts +28 -28
- package/src/Components/Icons/Communication/Asterick/Asterisk.tsx +50 -50
- package/src/Components/Icons/Communication/AsterickSimple/AsteriskSimple.stories.ts +28 -28
- package/src/Components/Icons/Communication/AsterickSimple/AsteriskSimple.tsx +49 -49
- package/src/Components/Icons/Communication/At/At.stories.ts +28 -28
- package/src/Components/Icons/Communication/At/At.tsx +49 -49
- package/src/Components/Icons/Communication/Broadcast/Broadcast.stories.ts +27 -27
- package/src/Components/Icons/Communication/Broadcast/Broadcast.tsx +49 -49
- package/src/Components/Icons/Communication/Chat/Chat.stories.ts +28 -28
- package/src/Components/Icons/Communication/Chat/Chat.tsx +49 -49
- package/src/Components/Icons/Design/Eye/Eye.tsx +105 -105
- package/src/Components/Icons/Design/EyeSlash/EyeSlash.tsx +105 -105
- package/src/Components/Icons/IconProps.tsx +5 -5
- package/src/Components/Icons/SecurityAndWarnings/WarningCircle/WarningCircle.tsx +105 -0
- package/src/Components/Icons/SystemAndDevice/Bell/Bell.tsx +49 -49
- package/src/Components/Icons/SystemAndDevice/MagnifyingGlass/MagnifyingGlass.tsx +105 -0
- package/src/Components/Icons/Time/CalendarBank/CalendarBank.tsx +105 -105
- package/src/Components/Icons/Time/Clock/Clock.tsx +105 -105
- package/src/Components/Layout/CalloutPopup/CalloutPopup.tsx +5 -5
- package/src/Components/Layout/Header/Header.tsx +5 -5
- package/src/Components/Layout/Header/HeaderLeft.tsx +5 -5
- package/src/Components/Layout/Header/HeaderRight.tsx +5 -5
- package/src/Components/Layout/Pagination/Pagination.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationFirst.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationLast.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationNext.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationNumber.tsx +5 -5
- package/src/Components/Layout/Pagination/PaginationPrevious.tsx +5 -5
- package/src/Components/Layout/ProfileAvatar/ProfileAvatar.stories.tsx +22 -0
- package/src/Components/Layout/ProfileAvatar/ProfileAvatar.tsx +31 -5
- package/src/Components/Layout/ProfileAvatar/ProfileAvatarProps.tsx +10 -4
- package/src/Components/Layout/ProfileAvatar/profileAvatar.module.scss +35 -0
- package/src/Components/Layout/ProfileDropdown/ProfileDropdown.stories.tsx +67 -0
- package/src/Components/Layout/ProfileDropdown/ProfileDropdown.tsx +12 -5
- package/src/Components/Layout/ProfileDropdown/ProfileDropdownProps.tsx +8 -0
- package/src/Components/Layout/ProfileDropdown/ProfileHeader.tsx +24 -5
- package/src/Components/Layout/ProfileDropdown/ProfileHeaderProps.tsx +8 -0
- package/src/Components/Layout/ProfileDropdown/ProfileLink.tsx +10 -5
- package/src/Components/Layout/ProfileDropdown/ProfileLinkProps.tsx +7 -0
- package/src/Components/Layout/ProfileDropdown/ProfileLinks.tsx +14 -5
- package/src/Components/Layout/ProfileDropdown/ProfileLinksProps.tsx +7 -0
- package/src/Components/Layout/ProfileDropdown/ProfileNavigationItem.tsx +29 -5
- package/src/Components/Layout/ProfileDropdown/ProfileNavigationItemProps.tsx +10 -0
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchPanel.tsx +79 -5
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchPanelProps.tsx +10 -0
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchUser.tsx +22 -5
- package/src/Components/Layout/ProfileDropdown/ProfileSwitchUserProps.tsx +7 -0
- package/src/Components/Layout/ProfileDropdown/profileDropdown.module.scss +207 -0
- package/src/Components/Layout/Sidebar/Sidebar.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarChevron.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarNavigation.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarNavigationItem.tsx +5 -5
- package/src/Components/Layout/Sidebar/SidebarSubNavigation.tsx +5 -5
- package/src/Notification/Notification.tsx +83 -83
- package/src/Notification/NotificationList.tsx +47 -22
- package/src/global.scss +224 -231
- package/src/main.tsx +10 -9
- package/src/variables.scss +2 -2
- package/.editorconfig +0 -17
- package/.eslintrc.cjs +0 -14
- package/.storybook/main.ts +0 -23
- package/.storybook/preview.ts +0 -17
- package/index.html +0 -13
- package/public/image/table-image.png +0 -0
- package/public/vite.svg +0 -1
- package/src/Components/DataDisplay/Media/media.scss +0 -0
- package/tokens/color/color.mdx +0 -82
- package/tokens/shadow/shadow-panel.scss +0 -12
- package/tokens/shadow/shadow.mdx +0 -34
- package/tokens/typography/typography.mdx +0 -31
- package/tsconfig.json +0 -25
- package/tsconfig.node.json +0 -10
- package/vite.config.ts +0 -7
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import cx from 'classnames';
|
|
2
|
-
import DropdownFieldSelectorProps from "./DropdownFieldSelectorProps";
|
|
3
|
-
import styles from './dropdown.module.scss';
|
|
4
|
-
|
|
5
|
-
const DropdownFieldSelector = (props: DropdownFieldSelectorProps) => {
|
|
6
|
-
|
|
7
|
-
const classes = [styles.dropdownSelector];
|
|
8
|
-
|
|
9
|
-
return <div className={cx(classes)}>
|
|
10
|
-
{props.children}
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default DropdownFieldSelector;
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import DropdownFieldSelectorProps from "./DropdownFieldSelectorProps";
|
|
3
|
+
import styles from './dropdown.module.scss';
|
|
4
|
+
|
|
5
|
+
const DropdownFieldSelector = (props: DropdownFieldSelectorProps) => {
|
|
6
|
+
|
|
7
|
+
const classes = [styles.dropdownSelector];
|
|
8
|
+
|
|
9
|
+
return <div className={cx(classes)}>
|
|
10
|
+
{props.children}
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default DropdownFieldSelector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {ReactNode} from "react";
|
|
2
|
-
|
|
3
|
-
interface DropdownFieldSelectorProps {
|
|
4
|
-
children: ReactNode
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default DropdownFieldSelectorProps;
|
|
1
|
+
import {ReactNode} from "react";
|
|
2
|
+
|
|
3
|
+
interface DropdownFieldSelectorProps {
|
|
4
|
+
children: ReactNode
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default DropdownFieldSelectorProps;
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
.dropdown {
|
|
2
|
-
position: relative;
|
|
3
|
-
|
|
4
|
-
.control {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: space-between;
|
|
8
|
-
width: 100%;
|
|
9
|
-
height: 48px;
|
|
10
|
-
padding: var(--space-unit) calc(var(--space-unit) * 3);
|
|
11
|
-
border: 1px solid var(--color-gray-300);
|
|
12
|
-
border-radius: 6px;
|
|
13
|
-
font-family: var(--font);
|
|
14
|
-
font-size: var(--font-size-input);
|
|
15
|
-
line-height: var(--line-height-input);
|
|
16
|
-
font-weight: var(--line-height-input);
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.disabled {
|
|
21
|
-
cursor: not-allowed;
|
|
22
|
-
opacity: 0.3;
|
|
23
|
-
pointer-events: none;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.label {
|
|
27
|
-
flex-grow: 1;
|
|
28
|
-
white-space: nowrap;
|
|
29
|
-
text-overflow: ellipsis;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
padding-right: calc(var(--space-unit) * 3);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.placeholder {
|
|
35
|
-
white-space: nowrap;
|
|
36
|
-
text-overflow: ellipsis;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
flex-grow: 1;
|
|
39
|
-
color: var(--color-gray-500);
|
|
40
|
-
font-size: var(--font-size-input);
|
|
41
|
-
line-height: var(--line-height-input);
|
|
42
|
-
font-weight: var(--font-weight-input);
|
|
43
|
-
padding-right: calc(var(--space-unit) * 3);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.chevron {
|
|
47
|
-
width: 16px;
|
|
48
|
-
height: 16px;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
|
|
53
|
-
svg {
|
|
54
|
-
width: 100%;
|
|
55
|
-
height: auto;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.dropdownSelector {
|
|
61
|
-
width: 100%;
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
position: absolute;
|
|
65
|
-
padding: calc(var(--space-unit) * 2) 0;
|
|
66
|
-
border-radius: 4px;
|
|
67
|
-
background-color: var(--color-white);
|
|
68
|
-
box-shadow: var(--drop-shadow-default);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.dropdownItem {
|
|
72
|
-
padding: calc(var(--space-unit) * 2);
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
|
|
75
|
-
&.active,
|
|
76
|
-
&:hover {
|
|
77
|
-
background-color: var(--color-gray-50);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
.dropdown {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.control {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 48px;
|
|
10
|
+
padding: var(--space-unit) calc(var(--space-unit) * 3);
|
|
11
|
+
border: 1px solid var(--color-gray-300);
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
font-family: var(--font);
|
|
14
|
+
font-size: var(--font-size-input);
|
|
15
|
+
line-height: var(--line-height-input);
|
|
16
|
+
font-weight: var(--line-height-input);
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.disabled {
|
|
21
|
+
cursor: not-allowed;
|
|
22
|
+
opacity: 0.3;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.label {
|
|
27
|
+
flex-grow: 1;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
text-overflow: ellipsis;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
padding-right: calc(var(--space-unit) * 3);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.placeholder {
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
flex-grow: 1;
|
|
39
|
+
color: var(--color-gray-500);
|
|
40
|
+
font-size: var(--font-size-input);
|
|
41
|
+
line-height: var(--line-height-input);
|
|
42
|
+
font-weight: var(--font-weight-input);
|
|
43
|
+
padding-right: calc(var(--space-unit) * 3);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.chevron {
|
|
47
|
+
width: 16px;
|
|
48
|
+
height: 16px;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
|
|
53
|
+
svg {
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: auto;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.dropdownSelector {
|
|
61
|
+
width: 100%;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
position: absolute;
|
|
65
|
+
padding: calc(var(--space-unit) * 2) 0;
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
background-color: var(--color-white);
|
|
68
|
+
box-shadow: var(--drop-shadow-default);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.dropdownItem {
|
|
72
|
+
padding: calc(var(--space-unit) * 2);
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
|
|
75
|
+
&.active,
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: var(--color-gray-50);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import EmailField from './EmailField.tsx';
|
|
4
|
-
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Form / EmailField',
|
|
8
|
-
component: EmailField,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'centered',
|
|
11
|
-
},
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
} satisfies Meta<typeof EmailField>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof EmailField>;
|
|
17
|
-
|
|
18
|
-
export const Example: Story = {
|
|
19
|
-
args: {
|
|
20
|
-
placeholder:"Placeholder",
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import EmailField from './EmailField.tsx';
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Form / EmailField',
|
|
8
|
+
component: EmailField,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
} satisfies Meta<typeof EmailField>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof EmailField>;
|
|
17
|
+
|
|
18
|
+
export const Example: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
placeholder:"Placeholder",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import cx from 'classnames';
|
|
2
|
-
import styles from '../inputs.module.scss' ;
|
|
3
|
-
import InputProps from "../InputProps";
|
|
4
|
-
|
|
5
|
-
const EmailField = (props: InputProps) => {
|
|
6
|
-
const {
|
|
7
|
-
name,
|
|
8
|
-
id,
|
|
9
|
-
value,
|
|
10
|
-
placeholder,
|
|
11
|
-
extraClass,
|
|
12
|
-
disabled,
|
|
13
|
-
error,
|
|
14
|
-
ariaLabel,
|
|
15
|
-
required,
|
|
16
|
-
readonly,
|
|
17
|
-
autoComplete,
|
|
18
|
-
...args
|
|
19
|
-
} = props;
|
|
20
|
-
|
|
21
|
-
const classes = [styles.input];
|
|
22
|
-
if (error) {
|
|
23
|
-
classes.push(styles.error);
|
|
24
|
-
}
|
|
25
|
-
if (extraClass) {
|
|
26
|
-
classes.push(extraClass);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return <input
|
|
30
|
-
className={cx(classes)}
|
|
31
|
-
id={id}
|
|
32
|
-
name={name}
|
|
33
|
-
type='email'
|
|
34
|
-
value={value}
|
|
35
|
-
placeholder={placeholder}
|
|
36
|
-
disabled={disabled}
|
|
37
|
-
readOnly={readonly}
|
|
38
|
-
required={required}
|
|
39
|
-
autoComplete={autoComplete ? "on" : "off"}
|
|
40
|
-
aria-label={ariaLabel ? ariaLabel : name}
|
|
41
|
-
aria-required={required ? "true" : "false"}
|
|
42
|
-
aria-invalid={error ? "true" : "false"}
|
|
43
|
-
aria-disabled={disabled ? "true" : "false"}
|
|
44
|
-
aria-readonly={readonly ? "true" : "false"}
|
|
45
|
-
aria-autocomplete={autoComplete ? "list" : "none"}
|
|
46
|
-
{...args}
|
|
47
|
-
/>
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export default EmailField;
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import styles from '../inputs.module.scss' ;
|
|
3
|
+
import InputProps from "../InputProps";
|
|
4
|
+
|
|
5
|
+
const EmailField = (props: InputProps) => {
|
|
6
|
+
const {
|
|
7
|
+
name,
|
|
8
|
+
id,
|
|
9
|
+
value,
|
|
10
|
+
placeholder,
|
|
11
|
+
extraClass,
|
|
12
|
+
disabled,
|
|
13
|
+
error,
|
|
14
|
+
ariaLabel,
|
|
15
|
+
required,
|
|
16
|
+
readonly,
|
|
17
|
+
autoComplete,
|
|
18
|
+
...args
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
const classes = [styles.input];
|
|
22
|
+
if (error) {
|
|
23
|
+
classes.push(styles.error);
|
|
24
|
+
}
|
|
25
|
+
if (extraClass) {
|
|
26
|
+
classes.push(extraClass);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return <input
|
|
30
|
+
className={cx(classes)}
|
|
31
|
+
id={id}
|
|
32
|
+
name={name}
|
|
33
|
+
type='email'
|
|
34
|
+
value={value}
|
|
35
|
+
placeholder={placeholder}
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
readOnly={readonly}
|
|
38
|
+
required={required}
|
|
39
|
+
autoComplete={autoComplete ? "on" : "off"}
|
|
40
|
+
aria-label={ariaLabel ? ariaLabel : name}
|
|
41
|
+
aria-required={required ? "true" : "false"}
|
|
42
|
+
aria-invalid={error ? "true" : "false"}
|
|
43
|
+
aria-disabled={disabled ? "true" : "false"}
|
|
44
|
+
aria-readonly={readonly ? "true" : "false"}
|
|
45
|
+
aria-autocomplete={autoComplete ? "list" : "none"}
|
|
46
|
+
{...args}
|
|
47
|
+
/>
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export default EmailField;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const ErrorMessage = () =>{
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default ErrorMessage;
|
|
1
|
+
const ErrorMessage = () =>{
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default ErrorMessage;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import FormFieldHolder from "./FormFieldHolder";
|
|
3
|
+
import TextField from "../TextField/TextField";
|
|
4
|
+
|
|
5
|
+
const meta: Meta = {
|
|
6
|
+
title: "Form / FormFieldHolder",
|
|
7
|
+
component: FormFieldHolder,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered",
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
const FormFieldHolderTemplate: Story = {
|
|
19
|
+
render: () => {
|
|
20
|
+
return (
|
|
21
|
+
<FormFieldHolder label="Name" description={"helper text"}>
|
|
22
|
+
<TextField placeholder="Placeholder" />
|
|
23
|
+
</FormFieldHolder>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const FormFieldHolderComponent = {
|
|
29
|
+
...FormFieldHolderTemplate,
|
|
30
|
+
};
|
|
@@ -1,5 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import WarningCircle from "../../Icons/SecurityAndWarnings/WarningCircle/WarningCircle";
|
|
2
|
+
import FormFieldHolderProps from "./FormFieldHolderProps";
|
|
3
|
+
import styles from "./formHolder.module.scss";
|
|
4
|
+
|
|
5
|
+
const FormFieldHolder = (props: FormFieldHolderProps) => {
|
|
6
|
+
const { label, description, extraClass = "", children, error } = props;
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
className={`field-holder ${extraClass} ${styles.holder} ${
|
|
11
|
+
error ? styles.holderError : ""
|
|
12
|
+
}`}
|
|
13
|
+
>
|
|
14
|
+
{!!label && (
|
|
15
|
+
<div className={styles.label}>
|
|
16
|
+
<label>{label}</label>
|
|
17
|
+
</div>
|
|
18
|
+
)}
|
|
19
|
+
<div className={styles.field}>{children}</div>
|
|
20
|
+
|
|
21
|
+
{!!description && (
|
|
22
|
+
<div className={styles.description}>
|
|
23
|
+
<>
|
|
24
|
+
{error && (
|
|
25
|
+
<div className={styles.helperIcon}>
|
|
26
|
+
<WarningCircle />
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
29
|
+
</>
|
|
30
|
+
<>
|
|
31
|
+
{typeof description === "string" && <p>{description}</p>}
|
|
32
|
+
{typeof description !== "string" && { description }}
|
|
33
|
+
</>
|
|
34
|
+
</div>
|
|
35
|
+
)}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default FormFieldHolder;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
interface FormFieldHolderProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string | ReactNode;
|
|
6
|
+
extraClass?: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default FormFieldHolderProps;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.holder {
|
|
2
|
+
margin-bottom: calc(var(--space-unit) * 5);
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.label {
|
|
7
|
+
display: block;
|
|
8
|
+
margin-bottom: calc(var(--space-unit) * 3);
|
|
9
|
+
|
|
10
|
+
label {
|
|
11
|
+
font-size: var(--font-size-label);
|
|
12
|
+
line-height: var(--line-height-label);
|
|
13
|
+
font-weight: var(--font-weight-label);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.holderError & {
|
|
17
|
+
color: var(--color-error);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.field {
|
|
22
|
+
.holderError & {
|
|
23
|
+
color: var(--color-error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.description {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
font-size: var(--font-size-body-sm);
|
|
31
|
+
line-height: var(--line-height-body-sm);
|
|
32
|
+
font-weight: var(--font-weight-body-sm);
|
|
33
|
+
padding-top: calc(var(--space-unit) * 2);
|
|
34
|
+
color: var(--color-description);
|
|
35
|
+
|
|
36
|
+
p {
|
|
37
|
+
font-size: var(--font-size-body-sm);
|
|
38
|
+
line-height: var(--line-height-body-sm);
|
|
39
|
+
font-weight: var(--font-weight-body-sm);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.helperIcon {
|
|
43
|
+
margin-right: var(--space-unit);
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
|
|
47
|
+
svg {
|
|
48
|
+
width: 16px;
|
|
49
|
+
height: 16px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.holderError & {
|
|
54
|
+
color: var(--color-error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
|
|
3
|
-
import IconButton from "./IconButton";
|
|
4
|
-
import CalendarBank from "../../Icons/Time/CalendarBank/CalendarBank";
|
|
5
|
-
|
|
6
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
7
|
-
const meta = {
|
|
8
|
-
title: "Form / IconButton",
|
|
9
|
-
component: IconButton,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: "centered",
|
|
12
|
-
},
|
|
13
|
-
tags: ["autodocs"],
|
|
14
|
-
} satisfies Meta<typeof IconButton>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof IconButton>;
|
|
18
|
-
|
|
19
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
20
|
-
export const Primary: Story = {
|
|
21
|
-
args: {
|
|
22
|
-
icon: <CalendarBank />,
|
|
23
|
-
style: "solid",
|
|
24
|
-
size: "default",
|
|
25
|
-
scheme: "primary",
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const Secondary: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
icon: <CalendarBank />,
|
|
32
|
-
style: "hollow",
|
|
33
|
-
size: "default",
|
|
34
|
-
scheme: "primary",
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const Borderless: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
icon: <CalendarBank type="bold" />,
|
|
41
|
-
style: "no-border",
|
|
42
|
-
size: "default",
|
|
43
|
-
scheme: "primary",
|
|
44
|
-
},
|
|
45
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import IconButton from "./IconButton";
|
|
4
|
+
import CalendarBank from "../../Icons/Time/CalendarBank/CalendarBank";
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Form / IconButton",
|
|
9
|
+
component: IconButton,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
},
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
} satisfies Meta<typeof IconButton>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof IconButton>;
|
|
18
|
+
|
|
19
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
20
|
+
export const Primary: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
icon: <CalendarBank />,
|
|
23
|
+
style: "solid",
|
|
24
|
+
size: "default",
|
|
25
|
+
scheme: "primary",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Secondary: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
icon: <CalendarBank />,
|
|
32
|
+
style: "hollow",
|
|
33
|
+
size: "default",
|
|
34
|
+
scheme: "primary",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Borderless: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
icon: <CalendarBank type="bold" />,
|
|
41
|
+
style: "no-border",
|
|
42
|
+
size: "default",
|
|
43
|
+
scheme: "primary",
|
|
44
|
+
},
|
|
45
|
+
};
|