@clubmed/trident-ui 1.6.0 → 1.6.1-beta.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 +3 -2
- package/assets/icons/Utilities/LightBulb.svg +3 -0
- package/assets/trident-ui.css +1 -1
- package/atoms/Heading/Heading.d.ts +1 -6
- package/atoms/Heading/Heading.js +2 -11
- package/atoms/Heading/Heading.js.map +1 -1
- package/atoms/Heading/HeadingGroup.d.ts +1 -7
- package/atoms/Heading/HeadingGroup.js +2 -12
- package/atoms/Heading/HeadingGroup.js.map +1 -1
- package/atoms/Icons/IconsResolver.js +2 -2
- package/atoms/Icons/contexts/IconsContext.js +2 -2
- package/atoms/Icons/index.d.ts +0 -1
- package/atoms/Icons/index.js +8 -9
- package/atoms/Icons/index.js.map +1 -1
- package/atoms/Image/Image.d.ts +1 -7
- package/atoms/Image/Image.js +2 -15
- package/atoms/Image/Image.js.map +1 -1
- package/atoms/Prose/Prose.d.ts +1 -5
- package/atoms/Prose/Prose.js +2 -15
- package/atoms/Prose/Prose.js.map +1 -1
- package/chunks/ResizeObserver.js +13 -13
- package/chunks/ResizeObserver.js.map +1 -1
- package/chunks/_commonjsHelpers.js +4 -29
- package/chunks/_commonjsHelpers.js.map +1 -1
- package/chunks/clsx.js.map +1 -1
- package/chunks/plugin.js +4 -4
- package/chunks/plugin.js.map +1 -1
- package/molecules/Arrows/Arrows.d.ts +1 -16
- package/molecules/Arrows/Arrows.js +2 -63
- package/molecules/Arrows/Arrows.js.map +1 -1
- package/molecules/Arrows.d.ts +1 -1
- package/molecules/Arrows.js +1 -1
- package/molecules/Avatar.d.ts +1 -8
- package/molecules/Avatar.js +2 -47
- package/molecules/Avatar.js.map +1 -1
- package/molecules/Backdrop.d.ts +1 -23
- package/molecules/Backdrop.js +2 -115
- package/molecules/Backdrop.js.map +1 -1
- package/molecules/Breadcrumb.d.ts +1 -10
- package/molecules/Breadcrumb.js +2 -47
- package/molecules/Breadcrumb.js.map +1 -1
- package/molecules/Breadcrumb.themes.d.ts +1 -8
- package/molecules/Breadcrumb.themes.js +2 -12
- package/molecules/Breadcrumb.themes.js.map +1 -1
- package/molecules/Buttons/ArrowButton.js.map +1 -1
- package/molecules/Buttons/Button.d.ts +1 -1
- package/molecules/Buttons/Button.js +1 -1
- package/molecules/Buttons/Button.js.map +1 -1
- package/molecules/Buttons/ButtonAnchor.js +1 -1
- package/molecules/Buttons/ButtonAnchor.js.map +1 -1
- package/molecules/Buttons/ButtonContent.d.ts +1 -17
- package/molecules/Buttons/ButtonContent.js +2 -15
- package/molecules/Buttons/ButtonContent.js.map +1 -1
- package/molecules/Buttons/FakeButton.d.ts +1 -1
- package/molecules/Buttons/FakeButton.js +1 -1
- package/molecules/Buttons/FakeButton.js.map +1 -1
- package/molecules/Buttons/v2/Button.d.ts +1 -2288
- package/molecules/Buttons/v2/Button.js +3 -47
- package/molecules/Buttons/v2/Button.js.map +1 -1
- package/molecules/Buttons/v2/Button.type.d.ts +1 -57
- package/molecules/Buttons/v2/Button.type.js +6 -42
- package/molecules/Buttons/v2/Button.type.js.map +1 -1
- package/molecules/Card.d.ts +1 -1
- package/molecules/Card.js +1 -1
- package/molecules/Cards/Card.js +2 -2
- package/molecules/Cards/CardAspectRatios.d.ts +1 -6
- package/molecules/Cards/CardAspectRatios.js +2 -7
- package/molecules/Cards/CardAspectRatios.js.map +1 -1
- package/molecules/Cards/CardBackground.d.ts +1 -4
- package/molecules/Cards/CardBackground.js +2 -27
- package/molecules/Cards/CardBackground.js.map +1 -1
- package/molecules/Cards/CardBackgroundContext.d.ts +1 -6
- package/molecules/Cards/CardBackgroundContext.js +3 -7
- package/molecules/Cards/CardBackgroundContext.js.map +1 -1
- package/molecules/Cards/CardClickable.d.ts +1 -6
- package/molecules/Cards/CardClickable.js +2 -34
- package/molecules/Cards/CardClickable.js.map +1 -1
- package/molecules/Cards/ExpandableCard.d.ts +1 -14
- package/molecules/Cards/ExpandableCard.js +2 -77
- package/molecules/Cards/ExpandableCard.js.map +1 -1
- package/molecules/Cards/v2/Card.d.ts +1 -15
- package/molecules/Cards/v2/Card.js +2 -31
- package/molecules/Cards/v2/Card.js.map +1 -1
- package/molecules/Chip.d.ts +1 -9
- package/molecules/Chip.js +2 -28
- package/molecules/Chip.js.map +1 -1
- package/molecules/Chip.themes.d.ts +1 -12
- package/molecules/Chip.themes.js +3 -21
- package/molecules/Chip.themes.js.map +1 -1
- package/molecules/Clickable/Clickable.d.ts +1 -0
- package/molecules/Clickable/Clickable.js +5 -0
- package/molecules/Clickable/Clickable.js.map +1 -0
- package/molecules/ElasticHeight.d.ts +1 -8
- package/molecules/ElasticHeight.js +2 -33
- package/molecules/ElasticHeight.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkbox.d.ts +1 -6
- package/molecules/Forms/Checkboxes/Checkbox.js +2 -97
- package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
- package/molecules/Forms/Checkboxes/Checkboxes.d.ts +1 -5
- package/molecules/Forms/Checkboxes/Checkboxes.js +2 -46
- package/molecules/Forms/Checkboxes/Checkboxes.js.map +1 -1
- package/molecules/Forms/Checkboxes/index.d.ts +2 -2
- package/molecules/Forms/Checkboxes/index.js +2 -2
- package/molecules/Forms/DateField.d.ts +1 -24
- package/molecules/Forms/DateField.js +2 -185
- package/molecules/Forms/DateField.js.map +1 -1
- package/molecules/Forms/Filter.d.ts +1 -9
- package/molecules/Forms/Filter.js +2 -65
- package/molecules/Forms/Filter.js.map +1 -1
- package/molecules/Forms/FormControl.d.ts +1 -14
- package/molecules/Forms/FormControl.js +2 -51
- package/molecules/Forms/FormControl.js.map +1 -1
- package/molecules/Forms/FormControlError.d.ts +1 -2
- package/molecules/Forms/FormControlError.js +2 -23
- package/molecules/Forms/FormControlError.js.map +1 -1
- package/molecules/Forms/FormLabel.d.ts +1 -8
- package/molecules/Forms/FormLabel.js +2 -34
- package/molecules/Forms/FormLabel.js.map +1 -1
- package/molecules/Forms/NumberField.d.ts +1 -320
- package/molecules/Forms/NumberField.js +3 -126
- package/molecules/Forms/NumberField.js.map +1 -1
- package/molecules/Forms/Password/Password.d.ts +1 -7
- package/molecules/Forms/Password/Password.js +2 -112
- package/molecules/Forms/Password/Password.js.map +1 -1
- package/molecules/Forms/Password/ValidationMessage.d.ts +1 -6
- package/molecules/Forms/Password/ValidationMessage.js +2 -25
- package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
- package/molecules/Forms/Password/index.d.ts +2 -2
- package/molecules/Forms/Password/index.js +2 -2
- package/molecules/Forms/Radios/Radio.d.ts +1 -17
- package/molecules/Forms/Radios/Radio.js +2 -60
- package/molecules/Forms/Radios/Radio.js.map +1 -1
- package/molecules/Forms/Radios/RadioGroup.d.ts +1 -5
- package/molecules/Forms/Radios/RadioGroup.js +2 -73
- package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
- package/molecules/Forms/Radios/index.d.ts +2 -2
- package/molecules/Forms/Radios/index.js +4 -4
- package/molecules/Forms/Range.d.ts +1 -40
- package/molecules/Forms/Range.js +2 -230
- package/molecules/Forms/Range.js.map +1 -1
- package/molecules/Forms/Select.d.ts +1 -10
- package/molecules/Forms/Select.js +2 -101
- package/molecules/Forms/Select.js.map +1 -1
- package/molecules/Forms/Switch.d.ts +1 -5
- package/molecules/Forms/Switch.js +2 -60
- package/molecules/Forms/Switch.js.map +1 -1
- package/molecules/Forms/TextField.d.ts +1 -12
- package/molecules/Forms/TextField.js +2 -95
- package/molecules/Forms/TextField.js.map +1 -1
- package/molecules/HamburgerIcon.d.ts +1 -6
- package/molecules/HamburgerIcon.js +2 -40
- package/molecules/HamburgerIcon.js.map +1 -1
- package/molecules/Link.d.ts +1 -35
- package/molecules/Link.js +2 -53
- package/molecules/Link.js.map +1 -1
- package/molecules/Loader.d.ts +1 -7
- package/molecules/Loader.js +2 -63
- package/molecules/Loader.js.map +1 -1
- package/molecules/Pagination.d.ts +1 -38
- package/molecules/Pagination.helper.d.ts +1 -48
- package/molecules/Pagination.helper.js +5 -27
- package/molecules/Pagination.helper.js.map +1 -1
- package/molecules/Pagination.js +2 -151
- package/molecules/Pagination.js.map +1 -1
- package/molecules/Popin.d.ts +1 -22
- package/molecules/Popin.js +2 -58
- package/molecules/Popin.js.map +1 -1
- package/molecules/Portal/Portal.d.ts +1 -11
- package/molecules/Portal/Portal.js +2 -28
- package/molecules/Portal/Portal.js.map +1 -1
- package/molecules/Spinner.d.ts +1 -9
- package/molecules/Spinner.js +2 -19
- package/molecules/Spinner.js.map +1 -1
- package/molecules/Tabs/Tab.d.ts +1 -31
- package/molecules/Tabs/Tab.js +2 -107
- package/molecules/Tabs/Tab.js.map +1 -1
- package/molecules/Tabs/TabList.d.ts +1 -10
- package/molecules/Tabs/TabList.js +2 -51
- package/molecules/Tabs/TabList.js.map +1 -1
- package/molecules/Tabs/TabPanel.d.ts +1 -17
- package/molecules/Tabs/TabPanel.js +2 -40
- package/molecules/Tabs/TabPanel.js.map +1 -1
- package/molecules/Tabs/Tabs.d.ts +1 -12
- package/molecules/Tabs/Tabs.js +2 -17
- package/molecules/Tabs/Tabs.js.map +1 -1
- package/molecules/Tabs/TabsBody.d.ts +0 -6
- package/molecules/Tabs/TabsBody.js +1 -6
- package/molecules/Tabs/TabsBody.js.map +1 -1
- package/molecules/Tabs/TabsHeader.js +1 -1
- package/molecules/Tabs/TabsHeading.js +1 -1
- package/molecules/Tabs/TabsPanel.js +1 -1
- package/molecules/Tabs/context/TabControl.d.ts +1 -52
- package/molecules/Tabs/context/TabControl.js +3 -87
- package/molecules/Tabs/context/TabControl.js.map +1 -1
- package/molecules/Tabs/hooks/tabControl.d.ts +1 -44
- package/molecules/Tabs/hooks/tabControl.js +7 -31
- package/molecules/Tabs/hooks/tabControl.js.map +1 -1
- package/molecules/Tabs/index.d.ts +7 -7
- package/molecules/Tabs/index.js +13 -14
- package/molecules/Tabs/theme.d.ts +1 -10
- package/molecules/Tabs/theme.js +1 -20
- package/molecules/Tabs/theme.js.map +1 -1
- package/molecules/Tag.d.ts +1 -45
- package/molecules/Tag.js +2 -76
- package/molecules/Tag.js.map +1 -1
- package/package.json +30 -93
- package/tailwind/tailwind.preset.js +232 -232
- package/tailwind/tailwind.preset.js.map +1 -1
- package/ui/Avatar.d.ts +8 -0
- package/ui/Avatar.js +50 -0
- package/ui/Avatar.js.map +1 -0
- package/ui/Backdrop.d.ts +23 -0
- package/ui/Backdrop.js +118 -0
- package/ui/Backdrop.js.map +1 -0
- package/ui/Breadcrumb.d.ts +10 -0
- package/ui/Breadcrumb.js +50 -0
- package/ui/Breadcrumb.js.map +1 -0
- package/ui/Breadcrumb.themes.d.ts +8 -0
- package/ui/Breadcrumb.themes.js +15 -0
- package/ui/Breadcrumb.themes.js.map +1 -0
- package/ui/Chip.d.ts +9 -0
- package/ui/Chip.js +31 -0
- package/ui/Chip.js.map +1 -0
- package/ui/Chip.themes.d.ts +12 -0
- package/ui/Chip.themes.js +24 -0
- package/ui/Chip.themes.js.map +1 -0
- package/{atoms/Clickable → ui}/Clickable.js +1 -1
- package/ui/Clickable.js.map +1 -0
- package/ui/ElasticHeight.d.ts +8 -0
- package/ui/ElasticHeight.js +36 -0
- package/ui/ElasticHeight.js.map +1 -0
- package/ui/HamburgerIcon.d.ts +6 -0
- package/ui/HamburgerIcon.js +43 -0
- package/ui/HamburgerIcon.js.map +1 -0
- package/ui/Image.d.ts +7 -0
- package/ui/Image.js +18 -0
- package/ui/Image.js.map +1 -0
- package/ui/Link.d.ts +35 -0
- package/ui/Link.js +56 -0
- package/ui/Link.js.map +1 -0
- package/ui/Loader.d.ts +7 -0
- package/ui/Loader.js +66 -0
- package/ui/Loader.js.map +1 -0
- package/ui/Pagination.d.ts +38 -0
- package/ui/Pagination.helper.d.ts +48 -0
- package/ui/Pagination.helper.js +30 -0
- package/ui/Pagination.helper.js.map +1 -0
- package/ui/Pagination.js +154 -0
- package/ui/Pagination.js.map +1 -0
- package/ui/Popin.d.ts +22 -0
- package/ui/Popin.js +61 -0
- package/ui/Popin.js.map +1 -0
- package/ui/Portal.d.ts +11 -0
- package/ui/Portal.js +31 -0
- package/ui/Portal.js.map +1 -0
- package/ui/Prose.d.ts +5 -0
- package/ui/Prose.js +18 -0
- package/ui/Prose.js.map +1 -0
- package/ui/Spinner.d.ts +9 -0
- package/ui/Spinner.js +22 -0
- package/ui/Spinner.js.map +1 -0
- package/ui/Tag.d.ts +45 -0
- package/ui/Tag.js +79 -0
- package/ui/Tag.js.map +1 -0
- package/ui/arrows/Arrows.d.ts +16 -0
- package/ui/arrows/Arrows.js +66 -0
- package/ui/arrows/Arrows.js.map +1 -0
- package/ui/buttons/ArrowButton.d.ts +6 -0
- package/ui/buttons/ArrowButton.js +7 -0
- package/ui/buttons/ArrowButton.js.map +1 -0
- package/ui/buttons/Button.d.ts +2392 -0
- package/ui/buttons/Button.js +50 -0
- package/ui/buttons/Button.js.map +1 -0
- package/ui/buttons/Button.type.d.ts +57 -0
- package/ui/buttons/Button.type.js +45 -0
- package/ui/buttons/Button.type.js.map +1 -0
- package/ui/buttons/ButtonContent.d.ts +17 -0
- package/ui/buttons/ButtonContent.js +18 -0
- package/ui/buttons/ButtonContent.js.map +1 -0
- package/ui/cards/Card.d.ts +15 -0
- package/ui/cards/Card.js +34 -0
- package/ui/cards/Card.js.map +1 -0
- package/ui/cards/CardAspectRatios.d.ts +6 -0
- package/ui/cards/CardAspectRatios.js +10 -0
- package/ui/cards/CardAspectRatios.js.map +1 -0
- package/ui/cards/CardBackground.d.ts +4 -0
- package/ui/cards/CardBackground.js +30 -0
- package/ui/cards/CardBackground.js.map +1 -0
- package/ui/cards/CardBackgroundContext.d.ts +6 -0
- package/ui/cards/CardBackgroundContext.js +10 -0
- package/ui/cards/CardBackgroundContext.js.map +1 -0
- package/ui/cards/CardClickable.d.ts +6 -0
- package/ui/cards/CardClickable.js +37 -0
- package/ui/cards/CardClickable.js.map +1 -0
- package/ui/cards/ExpandableCard.d.ts +14 -0
- package/ui/cards/ExpandableCard.js +80 -0
- package/ui/cards/ExpandableCard.js.map +1 -0
- package/{contexts → ui/contexts}/Device.d.ts +1 -1
- package/{contexts → ui/contexts}/Device.js +1 -1
- package/{contexts → ui/contexts}/TridentUIConfig.js +68 -68
- package/ui/contexts/TridentUIConfig.js.map +1 -0
- package/ui/contexts/devices/Device.js.map +1 -0
- package/{contexts/Devices → ui/contexts/devices}/hooks/useQueries.d.ts +8 -1
- package/ui/contexts/devices/hooks/useQueries.js.map +1 -0
- package/ui/contexts/devices/reducers/reducer.js.map +1 -0
- package/ui/forms/DateField.d.ts +24 -0
- package/ui/forms/DateField.js +162 -0
- package/ui/forms/DateField.js.map +1 -0
- package/ui/forms/Filter.d.ts +9 -0
- package/ui/forms/Filter.js +68 -0
- package/ui/forms/Filter.js.map +1 -0
- package/ui/forms/FormControl.d.ts +14 -0
- package/ui/forms/FormControl.js +54 -0
- package/ui/forms/FormControl.js.map +1 -0
- package/ui/forms/FormControlError.d.ts +2 -0
- package/ui/forms/FormControlError.js +26 -0
- package/ui/forms/FormControlError.js.map +1 -0
- package/ui/forms/FormLabel.d.ts +8 -0
- package/ui/forms/FormLabel.js +37 -0
- package/ui/forms/FormLabel.js.map +1 -0
- package/ui/forms/NumberField.d.ts +332 -0
- package/ui/forms/NumberField.js +129 -0
- package/ui/forms/NumberField.js.map +1 -0
- package/ui/forms/Range.d.ts +40 -0
- package/ui/forms/Range.js +161 -0
- package/ui/forms/Range.js.map +1 -0
- package/ui/forms/Select.d.ts +10 -0
- package/ui/forms/Select.js +104 -0
- package/ui/forms/Select.js.map +1 -0
- package/ui/forms/Switch.d.ts +5 -0
- package/ui/forms/Switch.js +63 -0
- package/ui/forms/Switch.js.map +1 -0
- package/ui/forms/TextField.d.ts +12 -0
- package/ui/forms/TextField.js +98 -0
- package/ui/forms/TextField.js.map +1 -0
- package/ui/forms/checkboxes/Checkbox.d.ts +6 -0
- package/ui/forms/checkboxes/Checkbox.js +100 -0
- package/ui/forms/checkboxes/Checkbox.js.map +1 -0
- package/ui/forms/checkboxes/Checkboxes.d.ts +5 -0
- package/ui/forms/checkboxes/Checkboxes.js +49 -0
- package/ui/forms/checkboxes/Checkboxes.js.map +1 -0
- package/ui/forms/checkboxes/index.d.ts +2 -0
- package/ui/forms/checkboxes/index.js +7 -0
- package/ui/forms/checkboxes/index.js.map +1 -0
- package/ui/forms/password/Password.d.ts +7 -0
- package/ui/forms/password/Password.js +115 -0
- package/ui/forms/password/Password.js.map +1 -0
- package/ui/forms/password/ValidationMessage.d.ts +6 -0
- package/ui/forms/password/ValidationMessage.js +28 -0
- package/ui/forms/password/ValidationMessage.js.map +1 -0
- package/ui/forms/password/index.d.ts +2 -0
- package/ui/forms/password/index.js +7 -0
- package/ui/forms/password/index.js.map +1 -0
- package/ui/forms/radios/Radio.d.ts +17 -0
- package/ui/forms/radios/Radio.js +63 -0
- package/ui/forms/radios/Radio.js.map +1 -0
- package/ui/forms/radios/RadioGroup.d.ts +5 -0
- package/ui/forms/radios/RadioGroup.js +76 -0
- package/ui/forms/radios/RadioGroup.js.map +1 -0
- package/ui/forms/radios/index.d.ts +2 -0
- package/ui/forms/radios/index.js +7 -0
- package/ui/forms/radios/index.js.map +1 -0
- package/ui/heading/Heading.d.ts +6 -0
- package/ui/heading/Heading.js +14 -0
- package/ui/heading/Heading.js.map +1 -0
- package/ui/heading/HeadingGroup.d.ts +7 -0
- package/ui/heading/HeadingGroup.js +15 -0
- package/ui/heading/HeadingGroup.js.map +1 -0
- package/ui/helpers/colors/colors.js.map +1 -0
- package/ui/helpers/twMerge.js.map +1 -0
- package/ui/hooks/keyboard.constants.js.map +1 -0
- package/{hooks → ui/hooks}/useInternalStatus.d.ts +1 -1
- package/ui/hooks/useInternalStatus.js.map +1 -0
- package/ui/hooks/useKeyboardControls.js.map +1 -0
- package/{hooks → ui/hooks}/useResizeObserver.js +1 -1
- package/ui/hooks/useResizeObserver.js.map +1 -0
- package/{hooks → ui/hooks}/useSafeBoop.js +674 -708
- package/ui/hooks/useSafeBoop.js.map +1 -0
- package/ui/hooks/useSlots.js.map +1 -0
- package/ui/hooks/useValue.js.map +1 -0
- package/ui/tabs/Tab.d.ts +31 -0
- package/ui/tabs/Tab.js +110 -0
- package/ui/tabs/Tab.js.map +1 -0
- package/ui/tabs/TabList.d.ts +10 -0
- package/ui/tabs/TabList.js +54 -0
- package/ui/tabs/TabList.js.map +1 -0
- package/ui/tabs/TabPanel.d.ts +17 -0
- package/ui/tabs/TabPanel.js +43 -0
- package/ui/tabs/TabPanel.js.map +1 -0
- package/ui/tabs/Tabs.d.ts +12 -0
- package/ui/tabs/Tabs.js +20 -0
- package/ui/tabs/Tabs.js.map +1 -0
- package/ui/tabs/TabsBody.d.ts +6 -0
- package/ui/tabs/TabsBody.js +7 -0
- package/ui/tabs/TabsBody.js.map +1 -0
- package/ui/tabs/context/TabControl.d.ts +52 -0
- package/ui/tabs/context/TabControl.js +90 -0
- package/ui/tabs/context/TabControl.js.map +1 -0
- package/ui/tabs/hooks/tabControl.d.ts +44 -0
- package/ui/tabs/hooks/tabControl.js +34 -0
- package/ui/tabs/hooks/tabControl.js.map +1 -0
- package/ui/tabs/index.d.ts +5 -0
- package/ui/tabs/index.js +13 -0
- package/ui/tabs/index.js.map +1 -0
- package/ui/tabs/theme.d.ts +10 -0
- package/ui/tabs/theme.js +24 -0
- package/ui/tabs/theme.js.map +1 -0
- package/ui/types/Devices.js.map +1 -0
- package/CHANGELOG.md +0 -1949
- package/atoms/Clickable/Clickable.js.map +0 -1
- package/atoms/Icons/Iconics.d.ts +0 -9
- package/atoms/Icons/Iconics.js +0 -2
- package/atoms/Icons/Iconics.js.map +0 -1
- package/contexts/Devices/Device.js.map +0 -1
- package/contexts/Devices/hooks/useQueries.js.map +0 -1
- package/contexts/Devices/reducers/reducer.js.map +0 -1
- package/contexts/TridentUIConfig.js.map +0 -1
- package/helpers/colors/colors.js.map +0 -1
- package/helpers/twMerge.js.map +0 -1
- package/hooks/keyboard.constants.js.map +0 -1
- package/hooks/useInternalStatus.js.map +0 -1
- package/hooks/useKeyboardControls.js.map +0 -1
- package/hooks/useResizeObserver.js.map +0 -1
- package/hooks/useSafeBoop.js.map +0 -1
- package/hooks/useSlots.js.map +0 -1
- package/hooks/useValue.js.map +0 -1
- package/types/Devices.js.map +0 -1
- /package/{atoms/Clickable → ui}/Clickable.d.ts +0 -0
- /package/{molecules/Arrows → ui/arrows}/ArrowsLabels.d.js +0 -0
- /package/{molecules/Arrows → ui/arrows}/ArrowsLabels.d.js.map +0 -0
- /package/{contexts → ui/contexts}/Device.js.map +0 -0
- /package/{contexts → ui/contexts}/TridentUIConfig.d.ts +0 -0
- /package/{contexts/Devices → ui/contexts/devices}/Device.d.ts +0 -0
- /package/{contexts/Devices → ui/contexts/devices}/Device.js +0 -0
- /package/{contexts/Devices → ui/contexts/devices}/hooks/useQueries.js +0 -0
- /package/{contexts/Devices → ui/contexts/devices}/reducers/reducer.d.ts +0 -0
- /package/{contexts/Devices → ui/contexts/devices}/reducers/reducer.js +0 -0
- /package/{helpers → ui/helpers}/colors/colors.d.ts +0 -0
- /package/{helpers → ui/helpers}/colors/colors.js +0 -0
- /package/{helpers → ui/helpers}/twMerge.d.ts +0 -0
- /package/{helpers → ui/helpers}/twMerge.js +0 -0
- /package/{hooks → ui/hooks}/keyboard.constants.d.ts +0 -0
- /package/{hooks → ui/hooks}/keyboard.constants.js +0 -0
- /package/{hooks → ui/hooks}/useInternalStatus.js +0 -0
- /package/{hooks → ui/hooks}/useKeyboardControls.d.ts +0 -0
- /package/{hooks → ui/hooks}/useKeyboardControls.js +0 -0
- /package/{hooks → ui/hooks}/useResizeObserver.d.ts +0 -0
- /package/{hooks → ui/hooks}/useSafeBoop.d.ts +0 -0
- /package/{hooks → ui/hooks}/useSlots.d.ts +0 -0
- /package/{hooks → ui/hooks}/useSlots.js +0 -0
- /package/{hooks → ui/hooks}/useValue.d.ts +0 -0
- /package/{hooks → ui/hooks}/useValue.js +0 -0
- /package/{types → ui/types}/Colors.d.ts +0 -0
- /package/{types → ui/types}/Colors.js +0 -0
- /package/{types → ui/types}/Colors.js.map +0 -0
- /package/{types → ui/types}/Devices.d.ts +0 -0
- /package/{types → ui/types}/Devices.js +0 -0
- /package/{types → ui/types}/Direction.d.ts +0 -0
- /package/{types → ui/types}/Direction.js +0 -0
- /package/{types → ui/types}/Direction.js.map +0 -0
- /package/{types → ui/types}/LiteralUnion.d.ts +0 -0
- /package/{types → ui/types}/LiteralUnion.js +0 -0
- /package/{types → ui/types}/LiteralUnion.js.map +0 -0
- /package/{types → ui/types}/ScrollerLabels.d.ts +0 -0
- /package/{types → ui/types}/ScrollerLabels.js +0 -0
- /package/{types → ui/types}/ScrollerLabels.js.map +0 -0
- /package/{types → ui/types}/Theme.d.ts +0 -0
- /package/{types → ui/types}/Theme.js +0 -0
- /package/{types → ui/types}/Theme.js.map +0 -0
- /package/{types → ui/types}/index.d.ts +0 -0
- /package/{types → ui/types}/index.js +0 -0
- /package/{types → ui/types}/index.js.map +0 -0
package/molecules/Forms/Range.js
CHANGED
|
@@ -1,233 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as M } from "../../chunks/ResizeObserver.js";
|
|
3
|
-
import { c as q } from "../../chunks/clsx.js";
|
|
4
|
-
import { useState as B, useRef as T, useEffect as w, useMemo as A, useId as F } from "react";
|
|
5
|
-
import { g as H } from "../../chunks/_commonjsHelpers.js";
|
|
6
|
-
var L, W;
|
|
7
|
-
function V() {
|
|
8
|
-
if (W) return L;
|
|
9
|
-
W = 1;
|
|
10
|
-
function r(t, n, d) {
|
|
11
|
-
var o, s, u, m, e;
|
|
12
|
-
n == null && (n = 100);
|
|
13
|
-
function i() {
|
|
14
|
-
var a = Date.now() - m;
|
|
15
|
-
a < n && a >= 0 ? o = setTimeout(i, n - a) : (o = null, d || (e = t.apply(u, s), u = s = null));
|
|
16
|
-
}
|
|
17
|
-
var c = function() {
|
|
18
|
-
u = this, s = arguments, m = Date.now();
|
|
19
|
-
var a = d && !o;
|
|
20
|
-
return o || (o = setTimeout(i, n)), a && (e = t.apply(u, s), u = s = null), e;
|
|
21
|
-
};
|
|
22
|
-
return c.clear = function() {
|
|
23
|
-
o && (clearTimeout(o), o = null);
|
|
24
|
-
}, c.flush = function() {
|
|
25
|
-
o && (e = t.apply(u, s), u = s = null, clearTimeout(o), o = null);
|
|
26
|
-
}, c;
|
|
27
|
-
}
|
|
28
|
-
return r.debounce = r, L = r, L;
|
|
29
|
-
}
|
|
30
|
-
var k = V();
|
|
31
|
-
const S = /* @__PURE__ */ H(k);
|
|
32
|
-
function X(r) {
|
|
33
|
-
let {
|
|
34
|
-
debounce: t,
|
|
35
|
-
scroll: n,
|
|
36
|
-
polyfill: d,
|
|
37
|
-
offsetSize: o
|
|
38
|
-
} = r === void 0 ? {
|
|
39
|
-
debounce: 0,
|
|
40
|
-
scroll: !1,
|
|
41
|
-
offsetSize: !1
|
|
42
|
-
} : r;
|
|
43
|
-
const s = d || (typeof window > "u" ? class {
|
|
44
|
-
} : window.ResizeObserver);
|
|
45
|
-
if (!s)
|
|
46
|
-
throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
|
|
47
|
-
const [u, m] = B({
|
|
48
|
-
left: 0,
|
|
49
|
-
top: 0,
|
|
50
|
-
width: 0,
|
|
51
|
-
height: 0,
|
|
52
|
-
bottom: 0,
|
|
53
|
-
right: 0,
|
|
54
|
-
x: 0,
|
|
55
|
-
y: 0
|
|
56
|
-
}), e = T({
|
|
57
|
-
element: null,
|
|
58
|
-
scrollContainers: null,
|
|
59
|
-
resizeObserver: null,
|
|
60
|
-
lastBounds: u
|
|
61
|
-
}), i = t ? typeof t == "number" ? t : t.scroll : null, c = t ? typeof t == "number" ? t : t.resize : null, a = T(!1);
|
|
62
|
-
w(() => (a.current = !0, () => void (a.current = !1)));
|
|
63
|
-
const [y, b, p] = A(() => {
|
|
64
|
-
const l = () => {
|
|
65
|
-
if (!e.current.element) return;
|
|
66
|
-
const {
|
|
67
|
-
left: O,
|
|
68
|
-
top: R,
|
|
69
|
-
width: C,
|
|
70
|
-
height: v,
|
|
71
|
-
bottom: x,
|
|
72
|
-
right: N,
|
|
73
|
-
x: $,
|
|
74
|
-
y: j
|
|
75
|
-
} = e.current.element.getBoundingClientRect(), g = {
|
|
76
|
-
left: O,
|
|
77
|
-
top: R,
|
|
78
|
-
width: C,
|
|
79
|
-
height: v,
|
|
80
|
-
bottom: x,
|
|
81
|
-
right: N,
|
|
82
|
-
x: $,
|
|
83
|
-
y: j
|
|
84
|
-
};
|
|
85
|
-
e.current.element instanceof HTMLElement && o && (g.height = e.current.element.offsetHeight, g.width = e.current.element.offsetWidth), Object.freeze(g), a.current && !K(e.current.lastBounds, g) && m(e.current.lastBounds = g);
|
|
86
|
-
};
|
|
87
|
-
return [l, c ? S(l, c) : l, i ? S(l, i) : l];
|
|
88
|
-
}, [m, o, i, c]);
|
|
89
|
-
function f() {
|
|
90
|
-
e.current.scrollContainers && (e.current.scrollContainers.forEach((l) => l.removeEventListener("scroll", p, !0)), e.current.scrollContainers = null), e.current.resizeObserver && (e.current.resizeObserver.disconnect(), e.current.resizeObserver = null);
|
|
91
|
-
}
|
|
92
|
-
function z() {
|
|
93
|
-
e.current.element && (e.current.resizeObserver = new s(p), e.current.resizeObserver.observe(e.current.element), n && e.current.scrollContainers && e.current.scrollContainers.forEach((l) => l.addEventListener("scroll", p, {
|
|
94
|
-
capture: !0,
|
|
95
|
-
passive: !0
|
|
96
|
-
})));
|
|
97
|
-
}
|
|
98
|
-
const h = (l) => {
|
|
99
|
-
!l || l === e.current.element || (f(), e.current.element = l, e.current.scrollContainers = I(l), z());
|
|
100
|
-
};
|
|
101
|
-
return G(p, !!n), Y(b), w(() => {
|
|
102
|
-
f(), z();
|
|
103
|
-
}, [n, p, b]), w(() => f, []), [h, u, y];
|
|
104
|
-
}
|
|
105
|
-
function Y(r) {
|
|
106
|
-
w(() => {
|
|
107
|
-
const t = r;
|
|
108
|
-
return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
|
|
109
|
-
}, [r]);
|
|
110
|
-
}
|
|
111
|
-
function G(r, t) {
|
|
112
|
-
w(() => {
|
|
113
|
-
if (t) {
|
|
114
|
-
const n = r;
|
|
115
|
-
return window.addEventListener("scroll", n, {
|
|
116
|
-
capture: !0,
|
|
117
|
-
passive: !0
|
|
118
|
-
}), () => void window.removeEventListener("scroll", n, !0);
|
|
119
|
-
}
|
|
120
|
-
}, [r, t]);
|
|
121
|
-
}
|
|
122
|
-
function I(r) {
|
|
123
|
-
const t = [];
|
|
124
|
-
if (!r || r === document.body) return t;
|
|
125
|
-
const {
|
|
126
|
-
overflow: n,
|
|
127
|
-
overflowX: d,
|
|
128
|
-
overflowY: o
|
|
129
|
-
} = window.getComputedStyle(r);
|
|
130
|
-
return [n, d, o].some((s) => s === "auto" || s === "scroll") && t.push(r), [...t, ...I(r.parentElement)];
|
|
131
|
-
}
|
|
132
|
-
const J = ["x", "y", "top", "bottom", "left", "right", "width", "height"], K = (r, t) => J.every((n) => r[n] === t[n]), te = (r) => {
|
|
133
|
-
const t = F(), {
|
|
134
|
-
ariaLabel: n,
|
|
135
|
-
className: d,
|
|
136
|
-
dataTestId: o = "range",
|
|
137
|
-
id: s = t,
|
|
138
|
-
name: u = s,
|
|
139
|
-
singleCursorMode: m = !1,
|
|
140
|
-
min: e = 0,
|
|
141
|
-
options: i = [],
|
|
142
|
-
step: c = 1,
|
|
143
|
-
readOnly: a,
|
|
144
|
-
disabled: y,
|
|
145
|
-
onChange: b,
|
|
146
|
-
...p
|
|
147
|
-
} = r, [f, z] = B(i.length - 1), [h, l] = B(e), [O, { width: R }] = X({ polyfill: M }), C = (v) => {
|
|
148
|
-
if (!a) {
|
|
149
|
-
v.persist();
|
|
150
|
-
const x = Number(v.target.value);
|
|
151
|
-
v.target.id[v.target.id.length - 1] === "a" ? z(x) : l(x), b && b(u, [f, h]);
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
return /* @__PURE__ */ D(
|
|
155
|
-
"div",
|
|
156
|
-
{
|
|
157
|
-
style: {
|
|
158
|
-
"--min": e,
|
|
159
|
-
"--max": i.length - 1,
|
|
160
|
-
"--inputWidth": `${R}px`,
|
|
161
|
-
"--inputHeight": "4px",
|
|
162
|
-
"--thumbWidth": "32px",
|
|
163
|
-
"--usefulWidth": "calc(var(--inputWidth) - var(--thumbWidth))",
|
|
164
|
-
"--valueA": f,
|
|
165
|
-
"--valueB": h
|
|
166
|
-
},
|
|
167
|
-
className: q("relative w-full", d),
|
|
168
|
-
"data-testid": o,
|
|
169
|
-
"data-name": "Range",
|
|
170
|
-
ref: O,
|
|
171
|
-
children: [
|
|
172
|
-
/* @__PURE__ */ D("div", { className: "input-range-container", children: [
|
|
173
|
-
/* @__PURE__ */ E(
|
|
174
|
-
"input",
|
|
175
|
-
{
|
|
176
|
-
...p,
|
|
177
|
-
"aria-label": n,
|
|
178
|
-
className: "input-range",
|
|
179
|
-
id: `${s}-a`,
|
|
180
|
-
max: i.length - 1,
|
|
181
|
-
min: e,
|
|
182
|
-
name: u,
|
|
183
|
-
onChange: C,
|
|
184
|
-
disabled: y,
|
|
185
|
-
step: c,
|
|
186
|
-
type: "range",
|
|
187
|
-
value: f
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
!m && /* @__PURE__ */ E(
|
|
191
|
-
"input",
|
|
192
|
-
{
|
|
193
|
-
...p,
|
|
194
|
-
"aria-label": n,
|
|
195
|
-
className: "input-range",
|
|
196
|
-
disabled: y,
|
|
197
|
-
id: `${s}-b`,
|
|
198
|
-
max: i.length - 1,
|
|
199
|
-
min: e,
|
|
200
|
-
name: u,
|
|
201
|
-
onChange: C,
|
|
202
|
-
step: c,
|
|
203
|
-
type: "range",
|
|
204
|
-
value: h
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
] }),
|
|
208
|
-
/* @__PURE__ */ E(
|
|
209
|
-
"output",
|
|
210
|
-
{
|
|
211
|
-
htmlFor: `${s}-a`,
|
|
212
|
-
style: { "--value": f },
|
|
213
|
-
className: "input-range-output",
|
|
214
|
-
children: i[f].label
|
|
215
|
-
}
|
|
216
|
-
),
|
|
217
|
-
!m && /* @__PURE__ */ E(
|
|
218
|
-
"output",
|
|
219
|
-
{
|
|
220
|
-
htmlFor: `${s}-b`,
|
|
221
|
-
style: { "--value": h },
|
|
222
|
-
className: "input-range-output",
|
|
223
|
-
children: i[h].label
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
]
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
};
|
|
1
|
+
import { Range as r } from "../../ui/forms/Range.js";
|
|
230
2
|
export {
|
|
231
|
-
|
|
3
|
+
r as Range
|
|
232
4
|
};
|
|
233
5
|
//# sourceMappingURL=Range.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.js","sources":["../../../node_modules/debounce/index.js","../../../node_modules/react-use-measure/dist/web.js","../../../lib/molecules/Forms/Range.tsx"],"sourcesContent":["/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n\n var debounced = function(){\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n \n debounced.flush = function() {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n \n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n};\n\n// Adds compatibility for ES modules\ndebounce.debounce = debounce;\n\nmodule.exports = debounce;\n","import { useState, useRef, useEffect, useMemo } from 'react';\nimport createDebounce from 'debounce';\n\nfunction useMeasure(_temp) {\n let {\n debounce,\n scroll,\n polyfill,\n offsetSize\n } = _temp === void 0 ? {\n debounce: 0,\n scroll: false,\n offsetSize: false\n } : _temp;\n const ResizeObserver = polyfill || (typeof window === 'undefined' ? class ResizeObserver {} : window.ResizeObserver);\n\n if (!ResizeObserver) {\n throw new Error('This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills');\n }\n\n const [bounds, set] = useState({\n left: 0,\n top: 0,\n width: 0,\n height: 0,\n bottom: 0,\n right: 0,\n x: 0,\n y: 0\n }); // keep all state in a ref\n\n const state = useRef({\n element: null,\n scrollContainers: null,\n resizeObserver: null,\n lastBounds: bounds\n }); // set actual debounce values early, so effects know if they should react accordingly\n\n const scrollDebounce = debounce ? typeof debounce === 'number' ? debounce : debounce.scroll : null;\n const resizeDebounce = debounce ? typeof debounce === 'number' ? debounce : debounce.resize : null; // make sure to update state only as long as the component is truly mounted\n\n const mounted = useRef(false);\n useEffect(() => {\n mounted.current = true;\n return () => void (mounted.current = false);\n }); // memoize handlers, so event-listeners know when they should update\n\n const [forceRefresh, resizeChange, scrollChange] = useMemo(() => {\n const callback = () => {\n if (!state.current.element) return;\n const {\n left,\n top,\n width,\n height,\n bottom,\n right,\n x,\n y\n } = state.current.element.getBoundingClientRect();\n const size = {\n left,\n top,\n width,\n height,\n bottom,\n right,\n x,\n y\n };\n\n if (state.current.element instanceof HTMLElement && offsetSize) {\n size.height = state.current.element.offsetHeight;\n size.width = state.current.element.offsetWidth;\n }\n\n Object.freeze(size);\n if (mounted.current && !areBoundsEqual(state.current.lastBounds, size)) set(state.current.lastBounds = size);\n };\n\n return [callback, resizeDebounce ? createDebounce(callback, resizeDebounce) : callback, scrollDebounce ? createDebounce(callback, scrollDebounce) : callback];\n }, [set, offsetSize, scrollDebounce, resizeDebounce]); // cleanup current scroll-listeners / observers\n\n function removeListeners() {\n if (state.current.scrollContainers) {\n state.current.scrollContainers.forEach(element => element.removeEventListener('scroll', scrollChange, true));\n state.current.scrollContainers = null;\n }\n\n if (state.current.resizeObserver) {\n state.current.resizeObserver.disconnect();\n state.current.resizeObserver = null;\n }\n } // add scroll-listeners / observers\n\n\n function addListeners() {\n if (!state.current.element) return;\n state.current.resizeObserver = new ResizeObserver(scrollChange);\n state.current.resizeObserver.observe(state.current.element);\n\n if (scroll && state.current.scrollContainers) {\n state.current.scrollContainers.forEach(scrollContainer => scrollContainer.addEventListener('scroll', scrollChange, {\n capture: true,\n passive: true\n }));\n }\n } // the ref we expose to the user\n\n\n const ref = node => {\n if (!node || node === state.current.element) return;\n removeListeners();\n state.current.element = node;\n state.current.scrollContainers = findScrollContainers(node);\n addListeners();\n }; // add general event listeners\n\n\n useOnWindowScroll(scrollChange, Boolean(scroll));\n useOnWindowResize(resizeChange); // respond to changes that are relevant for the listeners\n\n useEffect(() => {\n removeListeners();\n addListeners();\n }, [scroll, scrollChange, resizeChange]); // remove all listeners when the components unmounts\n\n useEffect(() => removeListeners, []);\n return [ref, bounds, forceRefresh];\n} // Adds native resize listener to window\n\n\nfunction useOnWindowResize(onWindowResize) {\n useEffect(() => {\n const cb = onWindowResize;\n window.addEventListener('resize', cb);\n return () => void window.removeEventListener('resize', cb);\n }, [onWindowResize]);\n}\n\nfunction useOnWindowScroll(onScroll, enabled) {\n useEffect(() => {\n if (enabled) {\n const cb = onScroll;\n window.addEventListener('scroll', cb, {\n capture: true,\n passive: true\n });\n return () => void window.removeEventListener('scroll', cb, true);\n }\n }, [onScroll, enabled]);\n} // Returns a list of scroll offsets\n\n\nfunction findScrollContainers(element) {\n const result = [];\n if (!element || element === document.body) return result;\n const {\n overflow,\n overflowX,\n overflowY\n } = window.getComputedStyle(element);\n if ([overflow, overflowX, overflowY].some(prop => prop === 'auto' || prop === 'scroll')) result.push(element);\n return [...result, ...findScrollContainers(element.parentElement)];\n} // Checks if element boundaries are equal\n\n\nconst keys = ['x', 'y', 'top', 'bottom', 'left', 'right', 'width', 'height'];\n\nconst areBoundsEqual = (a, b) => keys.every(key => a[key] === b[key]);\n\nexport { useMeasure as default };\n","import { ResizeObserver } from '@juggle/resize-observer';\nimport clsx from 'clsx';\nimport {\n type ChangeEvent,\n type CSSProperties,\n type InputHTMLAttributes,\n useId,\n useState,\n} from 'react';\n\nimport useMeasure from 'react-use-measure';\nimport './range.css';\n\ninterface RangeProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /**\n * Aria label\n * @default 'Range'\n * */\n ariaLabel?: string;\n /**\n * Additional class names\n * */\n className?: string;\n /**\n * Data test id\n * */\n dataTestId?: string;\n /**\n * Single cursor mode\n * @default false\n * */\n singleCursorMode?: boolean;\n /**\n * Min value\n * @default 0\n * */\n min?: number;\n /**\n * On change\n * */\n onChange?: (name: string, value: number[]) => void;\n /**\n * Options\n * @default []\n * */\n options: { value: number; label: string }[];\n}\n\nexport const Range = (props: RangeProps) => {\n const internalId = useId();\n\n const {\n ariaLabel,\n className,\n dataTestId = 'range',\n id = internalId,\n name = id,\n singleCursorMode = false,\n min = 0,\n options = [],\n step = 1,\n readOnly,\n disabled,\n onChange,\n ...rest\n } = props;\n\n const [valueA, setValueA] = useState(options.length - 1);\n const [valueB, setValueB] = useState(min);\n const [containerRef, { width }] = useMeasure({ polyfill: ResizeObserver });\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (!readOnly) {\n e.persist();\n const inputValue = Number(e.target.value);\n const inputId = e.target.id[e.target.id.length - 1];\n\n if (inputId === 'a') {\n setValueA(inputValue);\n } else {\n setValueB(inputValue);\n }\n\n if (onChange) {\n onChange(name, [valueA, valueB]);\n }\n }\n };\n\n return (\n <div\n style={\n {\n '--min': min,\n '--max': options.length - 1,\n '--inputWidth': `${width}px`,\n '--inputHeight': '4px',\n '--thumbWidth': '32px',\n '--usefulWidth': 'calc(var(--inputWidth) - var(--thumbWidth))',\n '--valueA': valueA,\n '--valueB': valueB,\n } as CSSProperties\n }\n className={clsx('relative w-full', className)}\n data-testid={dataTestId}\n data-name=\"Range\"\n ref={containerRef}\n >\n <div className=\"input-range-container\">\n <input\n {...rest}\n aria-label={ariaLabel}\n className=\"input-range\"\n id={`${id}-a`}\n max={options.length - 1}\n min={min}\n name={name}\n onChange={handleChange}\n disabled={disabled}\n step={step}\n type=\"range\"\n value={valueA}\n />\n {!singleCursorMode && (\n <input\n {...rest}\n aria-label={ariaLabel}\n className=\"input-range\"\n disabled={disabled}\n id={`${id}-b`}\n max={options.length - 1}\n min={min}\n name={name}\n onChange={handleChange}\n step={step}\n type=\"range\"\n value={valueB}\n />\n )}\n </div>\n <output\n htmlFor={`${id}-a`}\n style={{ '--value': valueA } as CSSProperties}\n className=\"input-range-output\"\n >\n {options[valueA].label}\n </output>\n {!singleCursorMode && (\n <output\n htmlFor={`${id}-b`}\n style={{ '--value': valueB } as CSSProperties}\n className=\"input-range-output\"\n >\n {options[valueB].label}\n </output>\n )}\n </div>\n );\n};\n"],"names":["debounce","func","wait","immediate","timeout","args","context","timestamp","result","later","last","debounced","callNow","debounce_1","useMeasure","_temp","scroll","polyfill","offsetSize","ResizeObserver","bounds","set","useState","state","useRef","scrollDebounce","resizeDebounce","mounted","useEffect","forceRefresh","resizeChange","scrollChange","useMemo","callback","left","top","width","height","bottom","right","x","y","size","areBoundsEqual","createDebounce","removeListeners","element","addListeners","scrollContainer","ref","node","findScrollContainers","useOnWindowScroll","useOnWindowResize","onWindowResize","cb","onScroll","enabled","overflow","overflowX","overflowY","prop","keys","a","b","key","Range","props","internalId","useId","ariaLabel","className","dataTestId","id","name","singleCursorMode","min","options","step","readOnly","disabled","onChange","rest","valueA","setValueA","valueB","setValueB","containerRef","handleChange","e","inputValue","jsxs","clsx","jsx"],"mappings":";;;;;;;;;AAcA,WAASA,EAASC,GAAMC,GAAMC,GAAU;AACtC,QAAIC,GAASC,GAAMC,GAASC,GAAWC;AACvC,IAAYN,KAAR,SAAcA,IAAO;AAEzB,aAASO,IAAQ;AACf,UAAIC,IAAO,KAAK,IAAG,IAAKH;AAExB,MAAIG,IAAOR,KAAQQ,KAAQ,IACzBN,IAAU,WAAWK,GAAOP,IAAOQ,CAAI,KAEvCN,IAAU,MACLD,MACHK,IAASP,EAAK,MAAMK,GAASD,CAAI,GACjCC,IAAUD,IAAO;AAAA,IAGzB;AAEE,QAAIM,IAAY,WAAU;AACxB,MAAAL,IAAU,MACVD,IAAO,WACPE,IAAY,KAAK,IAAG;AACpB,UAAIK,IAAUT,KAAa,CAACC;AAC5B,aAAKA,MAASA,IAAU,WAAWK,GAAOP,CAAI,IAC1CU,MACFJ,IAASP,EAAK,MAAMK,GAASD,CAAI,GACjCC,IAAUD,IAAO,OAGZG;AAAA,IACX;AAEE,WAAAG,EAAU,QAAQ,WAAW;AAC3B,MAAIP,MACF,aAAaA,CAAO,GACpBA,IAAU;AAAA,IAEhB,GAEEO,EAAU,QAAQ,WAAW;AAC3B,MAAIP,MACFI,IAASP,EAAK,MAAMK,GAASD,CAAI,GACjCC,IAAUD,IAAO,MAEjB,aAAaD,CAAO,GACpBA,IAAU;AAAA,IAEhB,GAESO;AAAA,EACT;AAGA,SAAAX,EAAS,WAAWA,GAEpBa,IAAiBb;;;;AClEjB,SAASc,EAAWC,GAAO;AACzB,MAAI;AAAA,IACF,UAAAf;AAAA,IACA,QAAAgB;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,EACJ,IAAMH,MAAU,SAAS;AAAA,IACrB,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,EAChB,IAAMA;AACJ,QAAMI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1
|
+
{"version":3,"file":"Range.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconicTypes } from '@clubmed/trident-icons';
|
|
3
|
-
import { SelectHTMLAttributes } from 'react';
|
|
4
|
-
export interface SelectProps<Value> extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {
|
|
5
|
-
description?: string;
|
|
6
|
-
iconType?: IconicTypes;
|
|
7
|
-
errorMessage?: string;
|
|
8
|
-
dataTestId?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const Select: <Value = string>(props: SelectProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export * from '../../ui/forms/Select';
|
|
@@ -1,104 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as l } from "../../chunks/clsx.js";
|
|
3
|
-
import { useValue as I } from "../../hooks/useValue.js";
|
|
4
|
-
import { useInternalStatus as S } from "../../hooks/useInternalStatus.js";
|
|
5
|
-
import { FormControl as j } from "./FormControl.js";
|
|
6
|
-
import { Icon as n } from "@clubmed/trident-icons";
|
|
7
|
-
import { useId as T } from "react";
|
|
8
|
-
const R = (p) => {
|
|
9
|
-
const u = T(), {
|
|
10
|
-
id: t = u,
|
|
11
|
-
name: a = t,
|
|
12
|
-
label: m,
|
|
13
|
-
value: b,
|
|
14
|
-
description: x,
|
|
15
|
-
validationStatus: o = "default",
|
|
16
|
-
iconType: i,
|
|
17
|
-
errorMessage: f,
|
|
18
|
-
disabled: s = !1,
|
|
19
|
-
required: d = !1,
|
|
20
|
-
hideRequiredStar: h,
|
|
21
|
-
className: g,
|
|
22
|
-
dataTestId: v = t,
|
|
23
|
-
onChange: y,
|
|
24
|
-
children: w,
|
|
25
|
-
...N
|
|
26
|
-
} = p, { value: k, setValue: C } = I({ name: a, initialValue: b, onChange: y }), e = S({
|
|
27
|
-
isDisabled: s,
|
|
28
|
-
validationStatus: o
|
|
29
|
-
});
|
|
30
|
-
return /* @__PURE__ */ r(
|
|
31
|
-
j,
|
|
32
|
-
{
|
|
33
|
-
id: t,
|
|
34
|
-
className: g,
|
|
35
|
-
label: m,
|
|
36
|
-
description: x,
|
|
37
|
-
dataName: "TextField",
|
|
38
|
-
dataTestId: v,
|
|
39
|
-
disabled: s,
|
|
40
|
-
required: d,
|
|
41
|
-
hideRequiredStar: h,
|
|
42
|
-
validationStatus: o,
|
|
43
|
-
errorMessage: f,
|
|
44
|
-
children: /* @__PURE__ */ c(
|
|
45
|
-
"div",
|
|
46
|
-
{
|
|
47
|
-
className: l("relative rounded-pill z-0", {
|
|
48
|
-
"bg-white": e !== "disabled",
|
|
49
|
-
"bg-pearl": e === "disabled"
|
|
50
|
-
}),
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ r(
|
|
53
|
-
"select",
|
|
54
|
-
{
|
|
55
|
-
...N,
|
|
56
|
-
id: t,
|
|
57
|
-
name: a,
|
|
58
|
-
disabled: s,
|
|
59
|
-
required: d,
|
|
60
|
-
value: k,
|
|
61
|
-
onChange: (D) => C(D.target.value),
|
|
62
|
-
className: l(
|
|
63
|
-
"text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent",
|
|
64
|
-
{
|
|
65
|
-
"border-lightGrey focus:border-black active:border-black pe-[52px]": e === "default",
|
|
66
|
-
"pe-[84px]": e === "error" || e === "success",
|
|
67
|
-
"text-black": e !== "disabled",
|
|
68
|
-
"text-grey": e === "disabled",
|
|
69
|
-
"border-red": e === "error",
|
|
70
|
-
"border-green": e === "success"
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
"aria-label": a,
|
|
74
|
-
children: w
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ r(
|
|
78
|
-
"div",
|
|
79
|
-
{
|
|
80
|
-
className: l(
|
|
81
|
-
"pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12 -z-1",
|
|
82
|
-
{
|
|
83
|
-
"text-grey": e === "disabled",
|
|
84
|
-
"text-red": e === "error",
|
|
85
|
-
"text-green": e === "success"
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
children: /* @__PURE__ */ c("span", { className: "ms-auto flex gap-x-8", children: [
|
|
89
|
-
e === "error" && /* @__PURE__ */ r(n, { name: "CrossDefault", width: "24px", type: i }),
|
|
90
|
-
e === "success" && /* @__PURE__ */ r(n, { name: "CheckDefault", width: "24px", type: i }),
|
|
91
|
-
/* @__PURE__ */ r("button", { className: "pointer-events-auto inline-flex", children: /* @__PURE__ */ r(n, { name: "ArrowDefaultDown", type: "svg", width: "24px", color: "black" }) })
|
|
92
|
-
] })
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
};
|
|
1
|
+
import { Select as r } from "../../ui/forms/Select.js";
|
|
101
2
|
export {
|
|
102
|
-
|
|
3
|
+
r as Select
|
|
103
4
|
};
|
|
104
5
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":[
|
|
1
|
+
{"version":3,"file":"Select.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface SwitchProps extends FormControlProps<boolean> {
|
|
3
|
-
width?: number;
|
|
4
|
-
}
|
|
5
|
-
export declare function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export * from '../../ui/forms/Switch';
|
|
@@ -1,63 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as x } from "../../chunks/clsx.js";
|
|
3
|
-
import { useValue as f } from "../../hooks/useValue.js";
|
|
4
|
-
/* empty css */
|
|
5
|
-
import { useId as w } from "react";
|
|
6
|
-
function C(n) {
|
|
7
|
-
const s = w(), {
|
|
8
|
-
id: o = s,
|
|
9
|
-
name: r = o,
|
|
10
|
-
className: i,
|
|
11
|
-
checked: h,
|
|
12
|
-
disabled: t,
|
|
13
|
-
width: l = 56,
|
|
14
|
-
onChange: d,
|
|
15
|
-
tabIndex: m = 0,
|
|
16
|
-
children: p
|
|
17
|
-
} = n, { value: a, setValue: u } = f({
|
|
18
|
-
initialValue: h,
|
|
19
|
-
name: r,
|
|
20
|
-
onChange: d
|
|
21
|
-
});
|
|
22
|
-
return /* @__PURE__ */ c(
|
|
23
|
-
"label",
|
|
24
|
-
{
|
|
25
|
-
className: x(i, "relative flex items-center gap-[10px]", {
|
|
26
|
-
"text-b2": !i?.includes("text-"),
|
|
27
|
-
"font-semibold": !i?.includes("font-"),
|
|
28
|
-
"text-grey": t,
|
|
29
|
-
"cursor-pointer": !t
|
|
30
|
-
}),
|
|
31
|
-
"data-testid": "SwitchContainer",
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ c("span", { className: "relative", children: [
|
|
34
|
-
/* @__PURE__ */ e(
|
|
35
|
-
"input",
|
|
36
|
-
{
|
|
37
|
-
type: "checkbox",
|
|
38
|
-
name: r,
|
|
39
|
-
tabIndex: m,
|
|
40
|
-
checked: a,
|
|
41
|
-
disabled: t,
|
|
42
|
-
role: "switch",
|
|
43
|
-
className: "absolute w-full h-full opacity-0 cursor-pointer",
|
|
44
|
-
onChange: () => {
|
|
45
|
-
t || u(!a);
|
|
46
|
-
},
|
|
47
|
-
"data-name": "Switch"
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ e("span", { style: { height: l * 4 / 7, width: l }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: l * 3 / 7, children: /* @__PURE__ */ c("g", { children: [
|
|
51
|
-
/* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 12, fill: "hsl(var(--color-white))" }),
|
|
52
|
-
/* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 4, fill: "hsl(var(--color-grey))" })
|
|
53
|
-
] }) }) })
|
|
54
|
-
] }),
|
|
55
|
-
/* @__PURE__ */ e("span", { children: p })
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
}
|
|
1
|
+
import { Switch as t } from "../../ui/forms/Switch.js";
|
|
60
2
|
export {
|
|
61
|
-
|
|
3
|
+
t as Switch
|
|
62
4
|
};
|
|
63
5
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":[
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormControlProps } from './FormControl.js';
|
|
3
|
-
import { IconicNames, IconicTypes } from '@clubmed/trident-icons';
|
|
4
|
-
export interface TextFieldProps<Value> extends FormControlProps<Value> {
|
|
5
|
-
description?: string;
|
|
6
|
-
icon?: IconicNames;
|
|
7
|
-
iconType?: IconicTypes;
|
|
8
|
-
errorMessage?: string;
|
|
9
|
-
dataTestId?: string;
|
|
10
|
-
formatter?: UseValueProps<Value>['formatter'];
|
|
11
|
-
}
|
|
12
|
-
export declare const TextField: <Value = string>(props: TextFieldProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export * from '../../ui/forms/TextField';
|
|
@@ -1,98 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as u } from "../../chunks/clsx.js";
|
|
3
|
-
import { useValue as F } from "../../hooks/useValue.js";
|
|
4
|
-
import { useInternalStatus as S } from "../../hooks/useInternalStatus.js";
|
|
5
|
-
import { FormControl as j } from "./FormControl.js";
|
|
6
|
-
import { Icon as i } from "@clubmed/trident-icons";
|
|
7
|
-
import { useId as D } from "react";
|
|
8
|
-
const B = (m) => {
|
|
9
|
-
const p = D(), {
|
|
10
|
-
id: t = p,
|
|
11
|
-
name: a = t,
|
|
12
|
-
label: x,
|
|
13
|
-
value: b,
|
|
14
|
-
description: f,
|
|
15
|
-
validationStatus: n = "default",
|
|
16
|
-
icon: s,
|
|
17
|
-
iconType: d,
|
|
18
|
-
errorMessage: h,
|
|
19
|
-
disabled: l = !1,
|
|
20
|
-
required: c = !1,
|
|
21
|
-
hideRequiredStar: g,
|
|
22
|
-
className: v,
|
|
23
|
-
dataTestId: y = "TextField",
|
|
24
|
-
onChange: w,
|
|
25
|
-
formatter: N,
|
|
26
|
-
...C
|
|
27
|
-
} = m, { value: I, setValue: T } = F({ name: a, initialValue: b, onChange: w, formatter: N }), e = S({
|
|
28
|
-
isDisabled: l,
|
|
29
|
-
validationStatus: n
|
|
30
|
-
});
|
|
31
|
-
return /* @__PURE__ */ r(
|
|
32
|
-
j,
|
|
33
|
-
{
|
|
34
|
-
id: t,
|
|
35
|
-
label: x,
|
|
36
|
-
className: v,
|
|
37
|
-
description: f,
|
|
38
|
-
dataName: "TextField",
|
|
39
|
-
dataTestId: y,
|
|
40
|
-
disabled: l,
|
|
41
|
-
required: c,
|
|
42
|
-
hideRequiredStar: g,
|
|
43
|
-
validationStatus: n,
|
|
44
|
-
errorMessage: h,
|
|
45
|
-
children: /* @__PURE__ */ o("div", { className: "relative", children: [
|
|
46
|
-
/* @__PURE__ */ r(
|
|
47
|
-
"input",
|
|
48
|
-
{
|
|
49
|
-
...C,
|
|
50
|
-
id: t,
|
|
51
|
-
name: a,
|
|
52
|
-
disabled: l,
|
|
53
|
-
required: c,
|
|
54
|
-
value: I,
|
|
55
|
-
onChange: (k) => T(k.target.value),
|
|
56
|
-
className: u(
|
|
57
|
-
"text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none",
|
|
58
|
-
{
|
|
59
|
-
"border-lightGrey focus:border-black active:border-black": e === "default",
|
|
60
|
-
"ps-[52px]": s,
|
|
61
|
-
"pe-[52px]": e === "error" || e === "success",
|
|
62
|
-
"bg-white text-black": e !== "disabled",
|
|
63
|
-
"bg-pearl text-grey": e === "disabled",
|
|
64
|
-
"border-red": e === "error",
|
|
65
|
-
"border-green": e === "success"
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
"aria-label": a
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
/* @__PURE__ */ o(
|
|
72
|
-
"div",
|
|
73
|
-
{
|
|
74
|
-
className: u(
|
|
75
|
-
"pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12",
|
|
76
|
-
{
|
|
77
|
-
"text-grey": e === "disabled",
|
|
78
|
-
"text-red": e === "error",
|
|
79
|
-
"text-green": e === "success"
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
children: [
|
|
83
|
-
s && /* @__PURE__ */ r(i, { name: s, width: "24px" }),
|
|
84
|
-
/* @__PURE__ */ o("span", { className: "ms-auto flex gap-x-8", children: [
|
|
85
|
-
e === "error" && /* @__PURE__ */ r(i, { name: "CrossDefault", width: "24px", type: d }),
|
|
86
|
-
e === "success" && /* @__PURE__ */ r(i, { name: "CheckDefault", width: "24px", type: d })
|
|
87
|
-
] })
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
] })
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
};
|
|
1
|
+
import { TextField as r } from "../../ui/forms/TextField.js";
|
|
95
2
|
export {
|
|
96
|
-
|
|
3
|
+
r as TextField
|
|
97
4
|
};
|
|
98
5
|
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sources":[
|
|
1
|
+
{"version":3,"file":"TextField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface Props extends ComponentPropsWithoutRef<'span'> {
|
|
3
|
-
isActive?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare const HamburgerIcon: FunctionComponent<Props>;
|
|
6
|
-
export {};
|
|
1
|
+
export * from '../ui/HamburgerIcon';
|