@bspk/ui 1.0.1 → 1.1.12
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 +5 -0
- package/{Avatar.d.ts → dist/Avatar.d.ts} +2 -2
- package/dist/Avatar.js +27 -0
- package/dist/Avatar.js.map +1 -0
- package/{Badge.d.ts → dist/Badge.d.ts} +2 -2
- package/dist/Badge.js +16 -0
- package/dist/Badge.js.map +1 -0
- package/{BannerAlert.d.ts → dist/BannerAlert.d.ts} +4 -4
- package/dist/BannerAlert.js +20 -0
- package/dist/BannerAlert.js.map +1 -0
- package/{Button.d.ts → dist/Button.d.ts} +1 -1
- package/dist/Button.js +30 -0
- package/dist/Button.js.map +1 -0
- package/{Card.d.ts → dist/Card.d.ts} +2 -2
- package/dist/Card.js +18 -0
- package/dist/Card.js.map +1 -0
- package/{Checkbox.d.ts → dist/Checkbox.d.ts} +2 -2
- package/dist/Checkbox.js +32 -0
- package/dist/Checkbox.js.map +1 -0
- package/{CheckboxGroup.d.ts → dist/CheckboxGroup.d.ts} +1 -1
- package/dist/CheckboxGroup.js +16 -0
- package/dist/CheckboxGroup.js.map +1 -0
- package/{CheckboxOption.d.ts → dist/CheckboxOption.d.ts} +1 -1
- package/dist/CheckboxOption.js +14 -0
- package/dist/CheckboxOption.js.map +1 -0
- package/{Chip.d.ts → dist/Chip.d.ts} +2 -2
- package/dist/Chip.js +22 -0
- package/dist/Chip.js.map +1 -0
- package/{Dialog.d.ts → dist/Dialog.d.ts} +2 -2
- package/dist/Dialog.js +70 -0
- package/dist/Dialog.js.map +1 -0
- package/{Divider.d.ts → dist/Divider.d.ts} +2 -2
- package/dist/Divider.js +26 -0
- package/dist/Divider.js.map +1 -0
- package/{Dropdown.d.ts → dist/Dropdown.d.ts} +2 -2
- package/dist/Dropdown.js +37 -0
- package/dist/Dropdown.js.map +1 -0
- package/{DropdownField.d.ts → dist/DropdownField.d.ts} +1 -1
- package/{DropdownField.js → dist/DropdownField.js} +5 -7
- package/dist/DropdownField.js.map +1 -0
- package/{EmptyState.d.ts → dist/EmptyState.d.ts} +7 -1
- package/dist/EmptyState.js +18 -0
- package/dist/EmptyState.js.map +1 -0
- package/{Fab.d.ts → dist/Fab.d.ts} +2 -2
- package/dist/Fab.js +24 -0
- package/dist/Fab.js.map +1 -0
- package/{FormField.d.ts → dist/FormField.d.ts} +2 -2
- package/dist/FormField.js +27 -0
- package/dist/FormField.js.map +1 -0
- package/{Img.d.ts → dist/Img.d.ts} +1 -1
- package/dist/Img.js +12 -0
- package/dist/Img.js.map +1 -0
- package/{InlineAlert.d.ts → dist/InlineAlert.d.ts} +2 -2
- package/dist/InlineAlert.js +27 -0
- package/dist/InlineAlert.js.map +1 -0
- package/{Layout.d.ts → dist/Layout.d.ts} +1 -1
- package/{Layout.js → dist/Layout.js} +3 -5
- package/dist/Layout.js.map +1 -0
- package/{Link.d.ts → dist/Link.d.ts} +2 -2
- package/dist/Link.js +17 -0
- package/dist/Link.js.map +1 -0
- package/{ListItem.d.ts → dist/ListItem.d.ts} +3 -3
- package/dist/ListItem.js +93 -0
- package/dist/ListItem.js.map +1 -0
- package/{Menu.d.ts → dist/Menu.d.ts} +2 -2
- package/dist/Menu.js +62 -0
- package/dist/Menu.js.map +1 -0
- package/{MenuButton.d.ts → dist/MenuButton.d.ts} +2 -2
- package/dist/MenuButton.js +15 -0
- package/dist/MenuButton.js.map +1 -0
- package/{Modal.d.ts → dist/Modal.d.ts} +2 -2
- package/dist/Modal.js +32 -0
- package/dist/Modal.js.map +1 -0
- package/{NumberField.d.ts → dist/NumberField.d.ts} +1 -1
- package/{NumberField.js → dist/NumberField.js} +5 -7
- package/dist/NumberField.js.map +1 -0
- package/{NumberInput.d.ts → dist/NumberInput.d.ts} +2 -2
- package/dist/NumberInput.js +64 -0
- package/dist/NumberInput.js.map +1 -0
- package/{Popover.d.ts → dist/Popover.d.ts} +2 -2
- package/dist/Popover.js +46 -0
- package/dist/Popover.js.map +1 -0
- package/{Portal.js → dist/Portal.js} +4 -5
- package/dist/Portal.js.map +1 -0
- package/{ProgressBar.d.ts → dist/ProgressBar.d.ts} +2 -2
- package/dist/ProgressBar.js +17 -0
- package/dist/ProgressBar.js.map +1 -0
- package/{ProgressCircle.d.ts → dist/ProgressCircle.d.ts} +3 -3
- package/dist/ProgressCircle.js +30 -0
- package/dist/ProgressCircle.js.map +1 -0
- package/{ProgressionStepper.d.ts → dist/ProgressionStepper.d.ts} +2 -2
- package/dist/ProgressionStepper.js +24 -0
- package/dist/ProgressionStepper.js.map +1 -0
- package/{ProgressionStepperBar.d.ts → dist/ProgressionStepperBar.d.ts} +7 -3
- package/dist/ProgressionStepperBar.js +15 -0
- package/dist/ProgressionStepperBar.js.map +1 -0
- package/{Radio.d.ts → dist/Radio.d.ts} +2 -2
- package/dist/Radio.js +18 -0
- package/dist/Radio.js.map +1 -0
- package/{RadioGroup.d.ts → dist/RadioGroup.d.ts} +1 -1
- package/dist/RadioGroup.js +16 -0
- package/dist/RadioGroup.js.map +1 -0
- package/{RadioOption.d.ts → dist/RadioOption.d.ts} +1 -1
- package/dist/RadioOption.js +14 -0
- package/dist/RadioOption.js.map +1 -0
- package/{SearchBar.d.ts → dist/SearchBar.d.ts} +2 -2
- package/{SearchBar.js → dist/SearchBar.js} +13 -19
- package/dist/SearchBar.js.map +1 -0
- package/{SegmentedControl.d.ts → dist/SegmentedControl.d.ts} +2 -2
- package/dist/SegmentedControl.js +22 -0
- package/dist/SegmentedControl.js.map +1 -0
- package/dist/Skeleton.d.ts +45 -0
- package/dist/Skeleton.js +25 -0
- package/dist/Skeleton.js.map +1 -0
- package/{StylesProviderAnywhere.d.ts → dist/StylesProviderAnywhere.d.ts} +4 -1
- package/dist/StylesProviderAnywhere.js +15 -0
- package/dist/StylesProviderAnywhere.js.map +1 -0
- package/{StylesProviderBetterHomesGardens.d.ts → dist/StylesProviderBetterHomesGardens.d.ts} +4 -1
- package/dist/StylesProviderBetterHomesGardens.js +15 -0
- package/dist/StylesProviderBetterHomesGardens.js.map +1 -0
- package/{StylesProviderCartus.d.ts → dist/StylesProviderCartus.d.ts} +4 -1
- package/dist/StylesProviderCartus.js +15 -0
- package/dist/StylesProviderCartus.js.map +1 -0
- package/{StylesProviderCentury21.d.ts → dist/StylesProviderCentury21.d.ts} +4 -1
- package/dist/StylesProviderCentury21.js +15 -0
- package/dist/StylesProviderCentury21.js.map +1 -0
- package/{StylesProviderColdwellBanker.d.ts → dist/StylesProviderColdwellBanker.d.ts} +4 -1
- package/dist/StylesProviderColdwellBanker.js +15 -0
- package/dist/StylesProviderColdwellBanker.js.map +1 -0
- package/{StylesProviderCorcoran.d.ts → dist/StylesProviderCorcoran.d.ts} +4 -1
- package/dist/StylesProviderCorcoran.js +15 -0
- package/dist/StylesProviderCorcoran.js.map +1 -0
- package/{StylesProviderDenaliBoss.d.ts → dist/StylesProviderDenaliBoss.d.ts} +4 -1
- package/dist/StylesProviderDenaliBoss.js +15 -0
- package/dist/StylesProviderDenaliBoss.js.map +1 -0
- package/{StylesProviderEra.d.ts → dist/StylesProviderEra.d.ts} +4 -1
- package/dist/StylesProviderEra.js +15 -0
- package/dist/StylesProviderEra.js.map +1 -0
- package/{StylesProviderSothebys.d.ts → dist/StylesProviderSothebys.d.ts} +4 -1
- package/dist/StylesProviderSothebys.js +15 -0
- package/dist/StylesProviderSothebys.js.map +1 -0
- package/{Switch.d.ts → dist/Switch.d.ts} +2 -2
- package/dist/Switch.js +21 -0
- package/dist/Switch.js.map +1 -0
- package/{SwitchGroup.d.ts → dist/SwitchGroup.d.ts} +1 -1
- package/dist/SwitchGroup.js +16 -0
- package/dist/SwitchGroup.js.map +1 -0
- package/{SwitchOption.d.ts → dist/SwitchOption.d.ts} +1 -1
- package/dist/SwitchOption.js +14 -0
- package/dist/SwitchOption.js.map +1 -0
- package/{TabGroup.d.ts → dist/TabGroup.d.ts} +2 -2
- package/dist/TabGroup.js +22 -0
- package/dist/TabGroup.js.map +1 -0
- package/{Table.d.ts → dist/Table.d.ts} +2 -2
- package/dist/Table.js +20 -0
- package/dist/Table.js.map +1 -0
- package/{Tag.d.ts → dist/Tag.d.ts} +2 -2
- package/dist/Tag.js +15 -0
- package/dist/Tag.js.map +1 -0
- package/{TextField.d.ts → dist/TextField.d.ts} +1 -1
- package/dist/TextField.js +17 -0
- package/dist/TextField.js.map +1 -0
- package/{TextInput.d.ts → dist/TextInput.d.ts} +2 -2
- package/dist/TextInput.js +23 -0
- package/dist/TextInput.js.map +1 -0
- package/{Textarea.d.ts → dist/Textarea.d.ts} +2 -2
- package/dist/Textarea.js +39 -0
- package/dist/Textarea.js.map +1 -0
- package/{TextareaField.d.ts → dist/TextareaField.d.ts} +1 -1
- package/dist/TextareaField.js +24 -0
- package/dist/TextareaField.js.map +1 -0
- package/{ToggleOption.d.ts → dist/ToggleOption.d.ts} +2 -2
- package/dist/ToggleOption.js +14 -0
- package/dist/ToggleOption.js.map +1 -0
- package/{Tooltip.d.ts → dist/Tooltip.d.ts} +2 -2
- package/dist/Tooltip.js +42 -0
- package/dist/Tooltip.js.map +1 -0
- package/{TopNavigation.d.ts → dist/TopNavigation.d.ts} +2 -2
- package/dist/TopNavigation.js +14 -0
- package/dist/TopNavigation.js.map +1 -0
- package/{Txt.d.ts → dist/Txt.d.ts} +1 -1
- package/{Txt.js → dist/Txt.js} +3 -8
- package/dist/Txt.js.map +1 -0
- package/dist/avatar.css +1 -0
- package/dist/badge.css +1 -0
- package/dist/banner-alert.css +1 -0
- package/dist/base.css +1 -0
- package/dist/button.css +1 -0
- package/dist/card.css +1 -0
- package/dist/checkbox.css +1 -0
- package/dist/chip.css +1 -0
- package/dist/colors.css +1 -0
- package/dist/dialog.css +1 -0
- package/dist/divider.css +1 -0
- package/dist/dropdown.css +1 -0
- package/dist/fab.css +1 -0
- package/dist/form-field.css +1 -0
- package/{hooks → dist/hooks}/useCheckboxGroupState.d.ts +1 -1
- package/{hooks → dist/hooks}/useCheckboxGroupState.js +3 -6
- package/dist/hooks/useCheckboxGroupState.js.map +1 -0
- package/{hooks → dist/hooks}/useCheckboxState.js +2 -5
- package/dist/hooks/useCheckboxState.js.map +1 -0
- package/{hooks → dist/hooks}/useFloating.js +5 -8
- package/dist/hooks/useFloating.js.map +1 -0
- package/{hooks → dist/hooks}/useFloatingMenu.js +6 -9
- package/dist/hooks/useFloatingMenu.js.map +1 -0
- package/{hooks → dist/hooks}/useId.js +4 -7
- package/dist/hooks/useId.js.map +1 -0
- package/{hooks → dist/hooks}/useKeyboardNavigation.js +4 -7
- package/dist/hooks/useKeyboardNavigation.js.map +1 -0
- package/{hooks → dist/hooks}/useLongPress.js +3 -6
- package/dist/hooks/useLongPress.js.map +1 -0
- package/{hooks → dist/hooks}/useModalState.js +3 -6
- package/dist/hooks/useModalState.js.map +1 -0
- package/{hooks → dist/hooks}/useNavOptions.js +4 -7
- package/dist/hooks/useNavOptions.js.map +1 -0
- package/{hooks → dist/hooks}/useOutsideClick.js +2 -5
- package/dist/hooks/useOutsideClick.js.map +1 -0
- package/{hooks → dist/hooks}/useRadioState.js +2 -5
- package/dist/hooks/useRadioState.js.map +1 -0
- package/{hooks → dist/hooks}/useSwitchGroupState.d.ts +1 -1
- package/{hooks → dist/hooks}/useSwitchGroupState.js +3 -6
- package/dist/hooks/useSwitchGroupState.js.map +1 -0
- package/{hooks → dist/hooks}/useTimeout.js +2 -5
- package/dist/hooks/useTimeout.js.map +1 -0
- package/{hooks → dist/hooks}/useValidChildren.js +4 -7
- package/dist/hooks/useValidChildren.js.map +1 -0
- package/{index.js → dist/index.js} +2 -4
- package/dist/index.js.map +1 -0
- package/dist/inline-alert.css +1 -0
- package/dist/link.css +1 -0
- package/dist/list-item.css +1 -0
- package/dist/menu-button.css +1 -0
- package/dist/menu.css +1 -0
- package/dist/modal.css +1 -0
- package/dist/number-input.css +1 -0
- package/dist/popover.css +1 -0
- package/dist/progress-bar.css +1 -0
- package/dist/progress-circle.css +1 -0
- package/dist/progression-stepper-bar.css +1 -0
- package/dist/progression-stepper.css +1 -0
- package/dist/radio.css +1 -0
- package/dist/search-bar.css +1 -0
- package/dist/segmented-control.css +1 -0
- package/dist/skeleton.css +6 -0
- package/dist/switch.css +1 -0
- package/dist/tab-group.css +1 -0
- package/dist/table.css +1 -0
- package/dist/tag.css +1 -0
- package/dist/text-input.css +1 -0
- package/dist/textarea.css +4 -0
- package/dist/toggle-option.css +1 -0
- package/dist/tooltip.css +1 -0
- package/dist/top-navigation.css +1 -0
- package/{utils → dist/utils}/children.js +9 -12
- package/dist/utils/children.js.map +1 -0
- package/dist/utils/colorVariants.d.ts +7 -0
- package/dist/utils/colorVariants.js +22 -0
- package/dist/utils/colorVariants.js.map +1 -0
- package/{utils → dist/utils}/errors.d.ts +1 -1
- package/{utils → dist/utils}/errors.js +20 -12
- package/dist/utils/errors.js.map +1 -0
- package/{utils → dist/utils}/getValidNode.js +2 -5
- package/dist/utils/getValidNode.js.map +1 -0
- package/{utils → dist/utils}/keyboard.js +2 -4
- package/dist/utils/keyboard.js.map +1 -0
- package/dist/utils/placeholder.test.d.ts +1 -0
- package/dist/utils/placeholder.test.js +7 -0
- package/dist/utils/placeholder.test.js.map +1 -0
- package/{utils → dist/utils}/ref.js +2 -4
- package/dist/utils/ref.js.map +1 -0
- package/{utils → dist/utils}/scrollElementIntoView.js +2 -4
- package/dist/utils/scrollElementIntoView.js.map +1 -0
- package/{utils → dist/utils}/srOnly.js +2 -4
- package/dist/utils/srOnly.js.map +1 -0
- package/dist/utils/styleAdd.d.ts +1 -0
- package/dist/utils/styleAdd.js +11 -0
- package/dist/utils/styleAdd.js.map +1 -0
- package/{utils → dist/utils}/tryIntPsrse.js +2 -4
- package/dist/utils/tryIntPsrse.js.map +1 -0
- package/dist/utils/txtVariants.d.ts +7 -0
- package/{utils → dist/utils}/txtVariants.js +7 -4
- package/dist/utils/txtVariants.js.map +1 -0
- package/meta-types.ts +46 -0
- package/meta.ts +465 -0
- package/package.json +31 -20
- package/src/Avatar.tsx +3 -61
- package/src/Badge.tsx +2 -30
- package/src/BannerAlert.tsx +6 -119
- package/src/Button.tsx +3 -228
- package/src/Card.tsx +2 -22
- package/src/Checkbox.tsx +2 -94
- package/src/CheckboxGroup.tsx +2 -2
- package/src/CheckboxOption.tsx +3 -3
- package/src/Chip.tsx +2 -68
- package/src/Dialog.tsx +2 -154
- package/src/Divider.tsx +2 -54
- package/src/Dropdown.tsx +2 -119
- package/src/DropdownField.tsx +3 -2
- package/src/EmptyState.tsx +10 -4
- package/src/Fab.tsx +2 -125
- package/src/FormField.tsx +2 -15
- package/src/Img.tsx +1 -9
- package/src/InlineAlert.tsx +2 -48
- package/src/Layout.tsx +1 -0
- package/src/Link.tsx +2 -23
- package/src/ListItem.tsx +3 -118
- package/src/Menu.tsx +3 -41
- package/src/MenuButton.tsx +2 -17
- package/src/Modal.tsx +3 -24
- package/src/NumberField.tsx +3 -2
- package/src/NumberInput.tsx +2 -126
- package/src/Popover.tsx +3 -110
- package/src/Portal.tsx +1 -0
- package/src/ProgressBar.tsx +2 -49
- package/src/ProgressCircle.tsx +2 -57
- package/src/ProgressionStepper.tsx +2 -175
- package/src/ProgressionStepperBar.tsx +7 -44
- package/src/Radio.tsx +2 -82
- package/src/RadioGroup.tsx +2 -2
- package/src/RadioOption.tsx +3 -3
- package/src/SearchBar.tsx +4 -10
- package/src/SegmentedControl.tsx +2 -116
- package/src/Skeleton.tsx +40 -56
- package/src/StylesProviderAnywhere.tsx +4 -18
- package/src/StylesProviderBetterHomesGardens.tsx +4 -18
- package/src/StylesProviderCartus.tsx +4 -18
- package/src/StylesProviderCentury21.tsx +4 -18
- package/src/StylesProviderColdwellBanker.tsx +4 -18
- package/src/StylesProviderCorcoran.tsx +4 -18
- package/src/StylesProviderDenaliBoss.tsx +4 -18
- package/src/StylesProviderEra.tsx +4 -18
- package/src/StylesProviderSothebys.tsx +4 -18
- package/src/Switch.tsx +2 -66
- package/src/SwitchGroup.tsx +2 -2
- package/src/SwitchOption.tsx +3 -3
- package/src/TabGroup.tsx +2 -100
- package/src/Table.tsx +2 -49
- package/src/Tag.tsx +3 -67
- package/src/TextField.tsx +3 -2
- package/src/TextInput.tsx +2 -152
- package/src/Textarea.tsx +2 -80
- package/src/TextareaField.tsx +3 -2
- package/src/ToggleOption.tsx +2 -79
- package/src/Tooltip.tsx +3 -66
- package/src/TopNavigation.tsx +2 -10
- package/src/Txt.tsx +1 -9
- package/src/avatar.scss +74 -0
- package/src/badge.scss +28 -0
- package/{BannerAlert.js → src/banner-alert.scss} +5 -23
- package/src/{styles/base.css → base.scss} +5 -3
- package/src/button.scss +218 -0
- package/src/card.scss +23 -0
- package/{Checkbox.js → src/checkbox.scss} +9 -34
- package/{Chip.js → src/chip.scss} +3 -24
- package/src/colors.scss +76 -0
- package/{Dialog.js → src/dialog.scss} +7 -76
- package/src/divider.scss +47 -0
- package/{Dropdown.js → src/dropdown.scss} +4 -45
- package/{Fab.js → src/fab.scss} +4 -27
- package/src/form-field.scss +13 -0
- package/src/hooks/useFloating.ts +5 -5
- package/src/inline-alert.scss +51 -0
- package/src/link.scss +21 -0
- package/src/list-item.scss +113 -0
- package/src/menu-button.scss +16 -0
- package/src/menu.scss +36 -0
- package/src/modal.scss +22 -0
- package/src/number-input.scss +128 -0
- package/{Popover.js → src/popover.scss} +10 -49
- package/src/progress-bar.scss +50 -0
- package/src/progress-circle.scss +56 -0
- package/src/progression-stepper-bar.scss +39 -0
- package/{ProgressionStepper.js → src/progression-stepper.scss} +8 -27
- package/{Radio.js → src/radio.scss} +6 -22
- package/src/search-bar.scss +7 -0
- package/{SegmentedControl.js → src/segmented-control.scss} +7 -24
- package/src/skeleton.scss +83 -0
- package/{Switch.js → src/switch.scss} +4 -25
- package/{TabGroup.js → src/tab-group.scss} +9 -26
- package/{Table.js → src/table.scss} +4 -22
- package/{Tag.js → src/tag.scss} +5 -28
- package/{TextInput.js → src/text-input.scss} +7 -31
- package/{Textarea.js → src/textarea.scss} +9 -38
- package/{ToggleOption.js → src/toggle-option.scss} +3 -16
- package/src/tooltip.scss +63 -0
- package/src/top-navigation.scss +5 -0
- package/src/utils/children.ts +1 -1
- package/src/utils/colorVariants.ts +22 -73
- package/src/utils/styleAdd.ts +7 -0
- package/src/utils/txtVariants.ts +8 -27
- package/Accordion.d.ts +0 -20
- package/Accordion.js +0 -18
- package/Accordion.js.map +0 -1
- package/Avatar.js +0 -81
- package/Avatar.js.map +0 -1
- package/Badge.js +0 -43
- package/Badge.js.map +0 -1
- package/BannerAlert.js.map +0 -1
- package/BottomNavigation.d.ts +0 -20
- package/BottomNavigation.js +0 -18
- package/BottomNavigation.js.map +0 -1
- package/BottomSheet.d.ts +0 -20
- package/BottomSheet.js +0 -18
- package/BottomSheet.js.map +0 -1
- package/Breadcrumb.d.ts +0 -20
- package/Breadcrumb.js +0 -18
- package/Breadcrumb.js.map +0 -1
- package/Button.js +0 -254
- package/Button.js.map +0 -1
- package/ButtonDock.d.ts +0 -20
- package/ButtonDock.js +0 -18
- package/ButtonDock.js.map +0 -1
- package/CODE_OF_CONDUCT.md +0 -137
- package/CONTRIBUTING.md +0 -42
- package/Card.js +0 -38
- package/Card.js.map +0 -1
- package/Chart.d.ts +0 -20
- package/Chart.js +0 -18
- package/Chart.js.map +0 -1
- package/Checkbox.js.map +0 -1
- package/CheckboxGroup.js +0 -18
- package/CheckboxGroup.js.map +0 -1
- package/CheckboxOption.js +0 -16
- package/CheckboxOption.js.map +0 -1
- package/Chip.js.map +0 -1
- package/DatePicker.d.ts +0 -20
- package/DatePicker.js +0 -18
- package/DatePicker.js.map +0 -1
- package/Dialog.js.map +0 -1
- package/Divider.js +0 -76
- package/Divider.js.map +0 -1
- package/Drawer.d.ts +0 -20
- package/Drawer.js +0 -18
- package/Drawer.js.map +0 -1
- package/Dropdown.js.map +0 -1
- package/DropdownField.js.map +0 -1
- package/EmptyState.js +0 -20
- package/EmptyState.js.map +0 -1
- package/Fab.js.map +0 -1
- package/FileUpload.d.ts +0 -20
- package/FileUpload.js +0 -18
- package/FileUpload.js.map +0 -1
- package/FormField.js +0 -39
- package/FormField.js.map +0 -1
- package/GUIDELINES.md +0 -41
- package/Image.d.ts +0 -20
- package/Image.js +0 -18
- package/Image.js.map +0 -1
- package/Img.js +0 -20
- package/Img.js.map +0 -1
- package/InlineAlert.js +0 -73
- package/InlineAlert.js.map +0 -1
- package/Layout.js.map +0 -1
- package/Link.js +0 -37
- package/Link.js.map +0 -1
- package/ListItem.js +0 -207
- package/ListItem.js.map +0 -1
- package/Menu.js +0 -98
- package/Menu.js.map +0 -1
- package/MenuButton.js +0 -30
- package/MenuButton.js.map +0 -1
- package/Modal.js +0 -53
- package/Modal.js.map +0 -1
- package/MultiSelection.d.ts +0 -20
- package/MultiSelection.js +0 -18
- package/MultiSelection.js.map +0 -1
- package/NavigationRail.d.ts +0 -20
- package/NavigationRail.js +0 -18
- package/NavigationRail.js.map +0 -1
- package/NumberField.js.map +0 -1
- package/NumberInput.js +0 -188
- package/NumberInput.js.map +0 -1
- package/OTPInput.d.ts +0 -20
- package/OTPInput.js +0 -18
- package/OTPInput.js.map +0 -1
- package/PageControl.d.ts +0 -20
- package/PageControl.js +0 -18
- package/PageControl.js.map +0 -1
- package/PasswordInput.d.ts +0 -20
- package/PasswordInput.js +0 -18
- package/PasswordInput.js.map +0 -1
- package/PhoneNumberInput.d.ts +0 -20
- package/PhoneNumberInput.js +0 -18
- package/PhoneNumberInput.js.map +0 -1
- package/Popover.js.map +0 -1
- package/Portal.js.map +0 -1
- package/ProgressBar.js +0 -64
- package/ProgressBar.js.map +0 -1
- package/ProgressCircle.js +0 -82
- package/ProgressCircle.js.map +0 -1
- package/ProgressionStepper.js.map +0 -1
- package/ProgressionStepperBar.js +0 -51
- package/ProgressionStepperBar.js.map +0 -1
- package/Radio.js.map +0 -1
- package/RadioGroup.js +0 -18
- package/RadioGroup.js.map +0 -1
- package/RadioOption.js +0 -16
- package/RadioOption.js.map +0 -1
- package/Rating.d.ts +0 -16
- package/Rating.js +0 -18
- package/Rating.js.map +0 -1
- package/SearchBar.js.map +0 -1
- package/SegmentedControl.js.map +0 -1
- package/Skeleton.d.ts +0 -28
- package/Skeleton.js +0 -57
- package/Skeleton.js.map +0 -1
- package/SliderInput.d.ts +0 -16
- package/SliderInput.js +0 -18
- package/SliderInput.js.map +0 -1
- package/Snackbar.d.ts +0 -16
- package/Snackbar.js +0 -18
- package/Snackbar.js.map +0 -1
- package/StylesProviderAnywhere.js +0 -29
- package/StylesProviderAnywhere.js.map +0 -1
- package/StylesProviderBetterHomesGardens.js +0 -29
- package/StylesProviderBetterHomesGardens.js.map +0 -1
- package/StylesProviderCartus.js +0 -29
- package/StylesProviderCartus.js.map +0 -1
- package/StylesProviderCentury21.js +0 -29
- package/StylesProviderCentury21.js.map +0 -1
- package/StylesProviderColdwellBanker.js +0 -29
- package/StylesProviderColdwellBanker.js.map +0 -1
- package/StylesProviderCorcoran.js +0 -29
- package/StylesProviderCorcoran.js.map +0 -1
- package/StylesProviderDenaliBoss.js +0 -29
- package/StylesProviderDenaliBoss.js.map +0 -1
- package/StylesProviderEra.js +0 -29
- package/StylesProviderEra.js.map +0 -1
- package/StylesProviderSothebys.js +0 -29
- package/StylesProviderSothebys.js.map +0 -1
- package/Switch.js.map +0 -1
- package/SwitchGroup.js +0 -18
- package/SwitchGroup.js.map +0 -1
- package/SwitchOption.js +0 -16
- package/SwitchOption.js.map +0 -1
- package/TabGroup.js.map +0 -1
- package/Table.js.map +0 -1
- package/Tag.js.map +0 -1
- package/TextField.js +0 -19
- package/TextField.js.map +0 -1
- package/TextInput.js.map +0 -1
- package/Textarea.js.map +0 -1
- package/TextareaField.js +0 -26
- package/TextareaField.js.map +0 -1
- package/TimePicker.d.ts +0 -16
- package/TimePicker.js +0 -18
- package/TimePicker.js.map +0 -1
- package/ToggleOption.js.map +0 -1
- package/Tooltip.js +0 -104
- package/Tooltip.js.map +0 -1
- package/TopNavigation.js +0 -18
- package/TopNavigation.js.map +0 -1
- package/Txt.js.map +0 -1
- package/hooks/useCheckboxGroupState.js.map +0 -1
- package/hooks/useCheckboxState.js.map +0 -1
- package/hooks/useFloating.js.map +0 -1
- package/hooks/useFloatingMenu.js.map +0 -1
- package/hooks/useId.js.map +0 -1
- package/hooks/useKeyboardNavigation.js.map +0 -1
- package/hooks/useLongPress.js.map +0 -1
- package/hooks/useModalState.js.map +0 -1
- package/hooks/useNavOptions.js.map +0 -1
- package/hooks/useOutsideClick.js.map +0 -1
- package/hooks/useRadioState.js.map +0 -1
- package/hooks/useSwitchGroupState.js.map +0 -1
- package/hooks/useTimeout.js.map +0 -1
- package/hooks/useValidChildren.js.map +0 -1
- package/index.js.map +0 -1
- package/meta.d.ts +0 -44
- package/meta.js +0 -5789
- package/meta.js.map +0 -1
- package/src/Accordion.tsx +0 -33
- package/src/BottomNavigation.tsx +0 -33
- package/src/BottomSheet.tsx +0 -33
- package/src/Breadcrumb.tsx +0 -33
- package/src/ButtonDock.tsx +0 -33
- package/src/Chart.tsx +0 -33
- package/src/DatePicker.tsx +0 -33
- package/src/Drawer.tsx +0 -33
- package/src/FileUpload.tsx +0 -33
- package/src/Image.tsx +0 -33
- package/src/MultiSelection.tsx +0 -33
- package/src/NavigationRail.tsx +0 -33
- package/src/OTPInput.tsx +0 -33
- package/src/PageControl.tsx +0 -33
- package/src/PasswordInput.tsx +0 -33
- package/src/PhoneNumberInput.tsx +0 -33
- package/src/Rating.tsx +0 -29
- package/src/SliderInput.tsx +0 -29
- package/src/Snackbar.tsx +0 -29
- package/src/TimePicker.tsx +0 -29
- package/src/meta.ts +0 -6238
- package/src/package.json +0 -3
- package/src/styles/anywhere.css +0 -1693
- package/src/styles/anywhere.ts +0 -1694
- package/src/styles/base.ts +0 -161
- package/src/styles/better-homes-gardens.css +0 -1693
- package/src/styles/better-homes-gardens.ts +0 -1694
- package/src/styles/cartus.css +0 -1691
- package/src/styles/cartus.ts +0 -1692
- package/src/styles/century-21.css +0 -1689
- package/src/styles/century-21.ts +0 -1690
- package/src/styles/coldwell-banker.css +0 -1691
- package/src/styles/coldwell-banker.ts +0 -1692
- package/src/styles/corcoran.css +0 -1685
- package/src/styles/corcoran.ts +0 -1686
- package/src/styles/denali-boss.css +0 -1681
- package/src/styles/denali-boss.ts +0 -1682
- package/src/styles/era.css +0 -1685
- package/src/styles/era.ts +0 -1686
- package/src/styles/sothebys.css +0 -1677
- package/src/styles/sothebys.ts +0 -1678
- package/styles/anywhere.d.ts +0 -2
- package/styles/anywhere.js +0 -1697
- package/styles/anywhere.js.map +0 -1
- package/styles/base.d.ts +0 -2
- package/styles/base.js +0 -164
- package/styles/base.js.map +0 -1
- package/styles/better-homes-gardens.d.ts +0 -2
- package/styles/better-homes-gardens.js +0 -1697
- package/styles/better-homes-gardens.js.map +0 -1
- package/styles/cartus.d.ts +0 -2
- package/styles/cartus.js +0 -1695
- package/styles/cartus.js.map +0 -1
- package/styles/century-21.d.ts +0 -2
- package/styles/century-21.js +0 -1693
- package/styles/century-21.js.map +0 -1
- package/styles/coldwell-banker.d.ts +0 -2
- package/styles/coldwell-banker.js +0 -1695
- package/styles/coldwell-banker.js.map +0 -1
- package/styles/corcoran.d.ts +0 -2
- package/styles/corcoran.js +0 -1689
- package/styles/corcoran.js.map +0 -1
- package/styles/denali-boss.d.ts +0 -2
- package/styles/denali-boss.js +0 -1685
- package/styles/denali-boss.js.map +0 -1
- package/styles/era.d.ts +0 -2
- package/styles/era.js +0 -1689
- package/styles/era.js.map +0 -1
- package/styles/sothebys.d.ts +0 -2
- package/styles/sothebys.js +0 -1681
- package/styles/sothebys.js.map +0 -1
- package/utils/children.js.map +0 -1
- package/utils/colorVariants.d.ts +0 -5
- package/utils/colorVariants.js +0 -61
- package/utils/colorVariants.js.map +0 -1
- package/utils/errors.js.map +0 -1
- package/utils/getValidNode.js.map +0 -1
- package/utils/keyboard.js.map +0 -1
- package/utils/ref.js.map +0 -1
- package/utils/scrollElementIntoView.js.map +0 -1
- package/utils/srOnly.js.map +0 -1
- package/utils/tryIntPsrse.js.map +0 -1
- package/utils/txtVariants.d.ts +0 -2
- package/utils/txtVariants.js.map +0 -1
- /package/{Portal.d.ts → dist/Portal.d.ts} +0 -0
- /package/{hooks → dist/hooks}/useCheckboxState.d.ts +0 -0
- /package/{hooks → dist/hooks}/useFloating.d.ts +0 -0
- /package/{hooks → dist/hooks}/useFloatingMenu.d.ts +0 -0
- /package/{hooks → dist/hooks}/useId.d.ts +0 -0
- /package/{hooks → dist/hooks}/useKeyboardNavigation.d.ts +0 -0
- /package/{hooks → dist/hooks}/useLongPress.d.ts +0 -0
- /package/{hooks → dist/hooks}/useModalState.d.ts +0 -0
- /package/{hooks → dist/hooks}/useNavOptions.d.ts +0 -0
- /package/{hooks → dist/hooks}/useOutsideClick.d.ts +0 -0
- /package/{hooks → dist/hooks}/useRadioState.d.ts +0 -0
- /package/{hooks → dist/hooks}/useTimeout.d.ts +0 -0
- /package/{hooks → dist/hooks}/useValidChildren.d.ts +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{utils → dist/utils}/children.d.ts +0 -0
- /package/{utils → dist/utils}/getValidNode.d.ts +0 -0
- /package/{utils → dist/utils}/keyboard.d.ts +0 -0
- /package/{utils → dist/utils}/ref.d.ts +0 -0
- /package/{utils → dist/utils}/scrollElementIntoView.d.ts +0 -0
- /package/{utils → dist/utils}/srOnly.d.ts +0 -0
- /package/{utils → dist/utils}/tryIntPsrse.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function styleAdd(css, first) {
|
|
2
|
+
if (!css || typeof document === 'undefined')
|
|
3
|
+
return;
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.appendChild(document.createTextNode(css));
|
|
6
|
+
if (first && document.head.firstChild)
|
|
7
|
+
document.head.insertBefore(style, document.head.firstChild);
|
|
8
|
+
else
|
|
9
|
+
document.head.appendChild(style);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=styleAdd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleAdd.js","sourceRoot":"","sources":["../../src/utils/styleAdd.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,KAAe;IACjD,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IAChD,IAAI,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU;QAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;;QAC9F,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
function tryIntParse(value) {
|
|
1
|
+
export function tryIntParse(value) {
|
|
2
2
|
if (value === null || value === undefined)
|
|
3
3
|
return null;
|
|
4
4
|
const parsed = parseInt(value, 10);
|
|
5
5
|
return isNaN(parsed) ? null : parsed;
|
|
6
6
|
}
|
|
7
7
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
8
|
-
|
|
9
|
-
export { tryIntParse };
|
|
10
|
-
//# sourceMappingURL=tryIntPsrse.js.map
|
|
8
|
+
//# sourceMappingURL=tryIntPsrse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tryIntPsrse.js","sourceRoot":"","sources":["../../src/utils/tryIntPsrse.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,KAAyC;IACjE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACzC,CAAC;AAED,sDAAsD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is generated by the build-css script. Do not edit this file directly. Instead, edit the script and run it
|
|
3
|
+
* again.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TXT_VARIANTS: readonly ["body-base", "body-large", "body-small", "body-x-small", "labels-base", "labels-large", "labels-small", "labels-x-small", "display-regular-large", "display-regular-medium", "display-regular-small", "display-semibold-large", "display-semibold-medium", "display-semibold-small", "heading-h1", "heading-h2", "heading-h3", "heading-h4", "heading-h5", "heading-h6", "subheader-large", "subheader-medium", "subheader-x-large", "subheader-xx-large", "subheader-xxx-large"];
|
|
6
|
+
export type TxtVariant = (typeof TXT_VARIANTS)[number];
|
|
7
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This file is generated by the build-css script. Do not edit this file directly. Instead, edit the script and run it
|
|
3
|
+
* again.
|
|
4
|
+
*/
|
|
5
|
+
export const TXT_VARIANTS = [
|
|
2
6
|
'body-base',
|
|
3
7
|
'body-large',
|
|
4
8
|
'body-small',
|
|
@@ -25,6 +29,5 @@ const TXT_VARIANTS = [
|
|
|
25
29
|
'subheader-xx-large',
|
|
26
30
|
'subheader-xxx-large',
|
|
27
31
|
];
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=txtVariants.js.map
|
|
32
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
33
|
+
//# sourceMappingURL=txtVariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"txtVariants.js","sourceRoot":"","sources":["../../src/utils/txtVariants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,uBAAuB;IACvB,wBAAwB;IACxB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,wBAAwB;IACxB,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,oBAAoB;IACpB,qBAAqB;CACf,CAAC;AAGX,sDAAsD"}
|
package/meta-types.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is used to build the meta types for the project. It's used in the build-meta.ts file and also copied in to
|
|
3
|
+
* the meta output file.
|
|
4
|
+
*/
|
|
5
|
+
export type BaseMeta = {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
file?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type TypeMeta = BaseMeta & {
|
|
12
|
+
id: string;
|
|
13
|
+
example?: string;
|
|
14
|
+
references?: string[];
|
|
15
|
+
properties?: TypeProperty[];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type TypeProperty = {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
type?: string[] | string;
|
|
22
|
+
default?: unknown;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
options?: number[] | string[];
|
|
25
|
+
variants?: string[];
|
|
26
|
+
properties?: TypeProperty[];
|
|
27
|
+
references?: string[];
|
|
28
|
+
minimum?: number;
|
|
29
|
+
maximum?: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type ComponentMeta = BaseMeta & {
|
|
33
|
+
slug: string;
|
|
34
|
+
dependencies: string[];
|
|
35
|
+
modified: string;
|
|
36
|
+
css: string;
|
|
37
|
+
hasTouchTarget: boolean;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type UtilityMeta = BaseMeta & {
|
|
41
|
+
param?: string;
|
|
42
|
+
returns?: string;
|
|
43
|
+
example?: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
package/meta.ts
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
/**
|
|
3
|
+
* $ npm run meta
|
|
4
|
+
*
|
|
5
|
+
* This script generates the meta file which contains the information about the component, hooks, and utilities. This
|
|
6
|
+
* file scrapes from the JSdoc and also the Typescript types.
|
|
7
|
+
*
|
|
8
|
+
* The output file should not be included in this repo. ⚡️
|
|
9
|
+
*/
|
|
10
|
+
import { execSync } from 'child_process';
|
|
11
|
+
import fs from 'fs';
|
|
12
|
+
import path, { dirname } from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
|
|
15
|
+
import * as TJS from 'typescript-json-schema';
|
|
16
|
+
|
|
17
|
+
import { ComponentMeta, TypeProperty, UtilityMeta, TypeMeta } from './meta-types';
|
|
18
|
+
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
+
const __dirname = dirname(__filename);
|
|
21
|
+
|
|
22
|
+
function jsDocParse(content: string) {
|
|
23
|
+
try {
|
|
24
|
+
const contentTrimmed = content
|
|
25
|
+
.trim()
|
|
26
|
+
.replace(/^\/\*\*/, '')
|
|
27
|
+
.replace(/\*\/$/, '');
|
|
28
|
+
|
|
29
|
+
const chunks: string[] = contentTrimmed.replace(/\n\s*\* @/g, '&&split&&%%variable%%').split('&&split&&');
|
|
30
|
+
|
|
31
|
+
const data: Record<string, string> = {};
|
|
32
|
+
|
|
33
|
+
chunks.forEach((chunk) => {
|
|
34
|
+
if (chunk.startsWith('%%variable%%')) {
|
|
35
|
+
const chunkMatch = [...(chunk.match(/^%%variable%%([^\s]+)\s(.*)/s) || [])];
|
|
36
|
+
|
|
37
|
+
if (!chunkMatch) throw new Error(`Unable to process chunk.`);
|
|
38
|
+
|
|
39
|
+
const [, key, value] = chunkMatch;
|
|
40
|
+
|
|
41
|
+
if (!value) return;
|
|
42
|
+
|
|
43
|
+
data[key] = value
|
|
44
|
+
.replace(/\n[ ]+\*([ ]*)/g, '\n')
|
|
45
|
+
.replace(/^\s+\*\s+/, '')
|
|
46
|
+
.trim();
|
|
47
|
+
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
data.description = chunk
|
|
52
|
+
.replace(/\n[ ]+\*([ ]*)/g, '\n')
|
|
53
|
+
.replace(/(\S)\n(\S)/g, (_, a, b) => `${a} ${b}`)
|
|
54
|
+
.trim();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return data;
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error(error);
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function pretty(filePath: string) {
|
|
65
|
+
execSync(`npx prettier --write "${filePath}"`, { stdio: 'inherit' });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function kebabCase(str: string): string {
|
|
69
|
+
return (
|
|
70
|
+
str
|
|
71
|
+
.normalize('NFD') // Normalize to decompose accents
|
|
72
|
+
.replace(/[\u0300-\u036f&()']/g, '') // Remove accents
|
|
73
|
+
// Handle camelCase by inserting hyphens between lowercase and uppercase
|
|
74
|
+
.replace(/([a-zA-Z])([A-Z][a-z])/g, '$1-$2')
|
|
75
|
+
// do it again for the next uppercase letter
|
|
76
|
+
.replace(/([a-zA-Z])([A-Z][a-z])/g, '$1-$2')
|
|
77
|
+
.replace(/[^a-zA-Z0-9]+/g, '-') // Replace non-alphanumeric characters with hyphens
|
|
78
|
+
.replace(/^-+|-+$/g, '') // Trim leading or trailing hyphens
|
|
79
|
+
.replace(/--+/g, '-') // Replace multiple hyphens with a single hyphen
|
|
80
|
+
.toLowerCase()
|
|
81
|
+
); // Convert to lowercase
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const ENUM_SIZE_ORDER = [
|
|
85
|
+
'x-small',
|
|
86
|
+
'small',
|
|
87
|
+
'medium',
|
|
88
|
+
'base',
|
|
89
|
+
'large',
|
|
90
|
+
'x-large',
|
|
91
|
+
'xx-large',
|
|
92
|
+
'xxx-large',
|
|
93
|
+
'xxxx-large',
|
|
94
|
+
'xxxxx-large',
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
const metaFilePath = process.argv[2];
|
|
98
|
+
|
|
99
|
+
if (!metaFilePath) {
|
|
100
|
+
console.error('Please provide a path to the meta file.');
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const { componentsDir, hooksDir, rootPath } = {
|
|
105
|
+
componentsDir: path.resolve(__dirname, 'src'),
|
|
106
|
+
hooksDir: path.resolve(__dirname, 'src', 'hooks'),
|
|
107
|
+
rootPath: path.resolve(__dirname),
|
|
108
|
+
} as const;
|
|
109
|
+
|
|
110
|
+
const componentFiles = fs
|
|
111
|
+
.readdirSync(componentsDir)
|
|
112
|
+
.filter((f) => f.endsWith('.tsx'))
|
|
113
|
+
.map((fileName) => {
|
|
114
|
+
const filePath = path.resolve(componentsDir, fileName);
|
|
115
|
+
return {
|
|
116
|
+
filePath,
|
|
117
|
+
name: fileName.replace(/\.[^.]+$/, ''),
|
|
118
|
+
fileName,
|
|
119
|
+
content: fs.readFileSync(filePath, 'utf-8'),
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
function generateComponentMeta({
|
|
124
|
+
filePath: componentFile,
|
|
125
|
+
content,
|
|
126
|
+
name,
|
|
127
|
+
}: {
|
|
128
|
+
filePath: string;
|
|
129
|
+
content: string;
|
|
130
|
+
name: string;
|
|
131
|
+
}): ComponentMeta | null {
|
|
132
|
+
const stats = fs.statSync(componentFile);
|
|
133
|
+
|
|
134
|
+
const componentFunctionMatch = content.match(new RegExp(`function ${name}[(<]`));
|
|
135
|
+
|
|
136
|
+
if (!componentFunctionMatch) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (!content.includes(".bspkName = '")) {
|
|
141
|
+
console.warn(`No bspkName found for component ${name} for ${componentFile}`);
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// eslint-disable-next-line no-useless-escape
|
|
146
|
+
const allJSDocMatches = content.match(/\/\*\*\s*\n([^\*]|(\*(?!\/)))*\*\//g);
|
|
147
|
+
|
|
148
|
+
const componentDocStr = [...(allJSDocMatches || [])].find((doc) => doc.includes(`@name ${name}`));
|
|
149
|
+
|
|
150
|
+
if (!componentDocStr) {
|
|
151
|
+
console.warn(`No JSDoc found for component ${name} for ${componentFile}`);
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const componentDoc = jsDocParse(componentDocStr);
|
|
156
|
+
|
|
157
|
+
const slug = kebabCase(componentDoc.name);
|
|
158
|
+
|
|
159
|
+
const dependencies = [...content.matchAll(/import { ([^}]+) } from '\.\/([a-zA-Z]+)';/g)]
|
|
160
|
+
//
|
|
161
|
+
?.flatMap((d) => d.slice(1).flatMap((x) => x.split(', ')))
|
|
162
|
+
.filter((d, i, arr) => arr.indexOf(d) === i);
|
|
163
|
+
|
|
164
|
+
if (!dependencies?.length) {
|
|
165
|
+
//console.info(`No dependencies OR CSS found for component ${name} for ${componentFile}`);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const cssPath = path.join(componentsDir, `${slug}.scss`);
|
|
169
|
+
|
|
170
|
+
const css = fs.existsSync(cssPath) ? fs.readFileSync(cssPath, { encoding: 'utf-8' }) : '';
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
description: componentDoc.description,
|
|
174
|
+
file: componentFile.split(componentsDir)[1],
|
|
175
|
+
name,
|
|
176
|
+
slug,
|
|
177
|
+
dependencies,
|
|
178
|
+
modified: stats.mtime.toISOString(),
|
|
179
|
+
css,
|
|
180
|
+
hasTouchTarget: css.includes('data-touch-target'),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
async function generateUtilityMeta(utilityFile: string): Promise<UtilityMeta | null> {
|
|
185
|
+
const content = fs.readFileSync(utilityFile, 'utf-8');
|
|
186
|
+
|
|
187
|
+
const fileName = path.basename(utilityFile).replace(/\.[^.]+$/, '');
|
|
188
|
+
|
|
189
|
+
const utility = fileName;
|
|
190
|
+
|
|
191
|
+
const comment = content.match(/\/\*\*[\s\S]+?\*\//);
|
|
192
|
+
|
|
193
|
+
if (!comment?.[0]) {
|
|
194
|
+
console.info(`No JSDoc found for hook ${utility} for ${hooksDir}/${utility}.tsx`);
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const utilityDoc = jsDocParse(comment[0]);
|
|
199
|
+
|
|
200
|
+
if (!utilityDoc.example) {
|
|
201
|
+
// console.info(`No example found for hook ${utility} for ${hooksDir}/${utility}.tsx`);
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return {
|
|
206
|
+
description: utilityDoc.description,
|
|
207
|
+
example: utilityDoc.example,
|
|
208
|
+
file: utilityFile.split(componentsDir)[1],
|
|
209
|
+
name: utility,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function generateTypes() {
|
|
214
|
+
const files = fs.readdirSync(componentsDir, { recursive: true, withFileTypes: true }).flatMap((f) => {
|
|
215
|
+
if (!f.isFile()) return [];
|
|
216
|
+
|
|
217
|
+
if (!f.name.endsWith('.tsx') && !f.name.endsWith('.ts')) return [];
|
|
218
|
+
|
|
219
|
+
const content = fs.readFileSync(path.resolve(f.parentPath, f.name), 'utf-8');
|
|
220
|
+
|
|
221
|
+
// we want to ignore some problematic utility components
|
|
222
|
+
return content.includes('export type') || content.includes('export interface')
|
|
223
|
+
? [`${f.parentPath}/${f.name}`]
|
|
224
|
+
: [];
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const program = TJS.getProgramFromFiles(
|
|
228
|
+
files,
|
|
229
|
+
{
|
|
230
|
+
module: 'ES2020',
|
|
231
|
+
target: 'ES2020',
|
|
232
|
+
lib: ['es5', 'dom'],
|
|
233
|
+
sourceMap: true,
|
|
234
|
+
jsx: 'react-jsx',
|
|
235
|
+
moduleResolution: 'node',
|
|
236
|
+
noImplicitReturns: true,
|
|
237
|
+
noImplicitThis: true,
|
|
238
|
+
noImplicitAny: true,
|
|
239
|
+
strictNullChecks: true,
|
|
240
|
+
esModuleInterop: true,
|
|
241
|
+
baseUrl: '.',
|
|
242
|
+
},
|
|
243
|
+
rootPath,
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
const generator = TJS.buildGenerator(program, {
|
|
247
|
+
required: true,
|
|
248
|
+
defaultProps: true,
|
|
249
|
+
noExtraProps: false,
|
|
250
|
+
})!;
|
|
251
|
+
|
|
252
|
+
const symbols = generator.getSchemaForSymbols(generator.getMainFileSymbols(program), true);
|
|
253
|
+
|
|
254
|
+
const definitions = symbols.definitions as {
|
|
255
|
+
[key: string]: TJS.Definition;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const nextTypes: TypeMeta[] = [];
|
|
259
|
+
|
|
260
|
+
const cleanUpDefinitionEnums = (def: TJS.Definition): number[] | string[] | undefined => {
|
|
261
|
+
// IF all enums are numerical, fix numerical sorting
|
|
262
|
+
if (def.enum?.every((e) => typeof e === 'number')) {
|
|
263
|
+
def.enum.sort((a, b) => a - b);
|
|
264
|
+
return def.enum;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const defEnum = def.enum?.flatMap((e) => (typeof e === 'string' ? e : e?.toString() || []));
|
|
268
|
+
if (!defEnum || !defEnum.length) return undefined;
|
|
269
|
+
|
|
270
|
+
if (defEnum.some((e) => ENUM_SIZE_ORDER.includes(e)))
|
|
271
|
+
defEnum.sort((a, b) => ENUM_SIZE_ORDER.indexOf(a) - ENUM_SIZE_ORDER.indexOf(b));
|
|
272
|
+
|
|
273
|
+
return defEnum;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const defineProperty = (
|
|
277
|
+
name: string,
|
|
278
|
+
definition: TJS.DefinitionOrBoolean,
|
|
279
|
+
required?: string[],
|
|
280
|
+
): TypeProperty | undefined => {
|
|
281
|
+
if (typeof definition !== 'object') return undefined;
|
|
282
|
+
|
|
283
|
+
const next: TypeProperty = {
|
|
284
|
+
name,
|
|
285
|
+
required: required?.includes(name),
|
|
286
|
+
description: definition.description,
|
|
287
|
+
default: definition.default === 'undefined' ? undefined : definition.default,
|
|
288
|
+
type: definition.type,
|
|
289
|
+
properties:
|
|
290
|
+
definition.properties &&
|
|
291
|
+
Object.entries(definition.properties)?.flatMap(
|
|
292
|
+
([name2, definition2]) => defineProperty(name2, definition2, definition.required) || [],
|
|
293
|
+
),
|
|
294
|
+
minimum: definition.minimum,
|
|
295
|
+
maximum: definition.maximum,
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
const defEnum = cleanUpDefinitionEnums(definition);
|
|
299
|
+
|
|
300
|
+
if (defEnum) {
|
|
301
|
+
next.type = defEnum?.map((e) => e?.toString());
|
|
302
|
+
next.options = defEnum;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (definition.$ref) {
|
|
306
|
+
next.type = definition.$ref.split('/').pop() as string;
|
|
307
|
+
|
|
308
|
+
if (definitions[next.type]) {
|
|
309
|
+
next.options = cleanUpDefinitionEnums(definitions[next.type]);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return next;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
if (definitions)
|
|
317
|
+
Object.entries(definitions).forEach(([definitionName, definition]) => {
|
|
318
|
+
if (typeof definition !== 'object') return;
|
|
319
|
+
|
|
320
|
+
if (!definition?.properties && !definition?.allOf) return;
|
|
321
|
+
|
|
322
|
+
if (['React', 'Omit<'].some((n) => definitionName.startsWith(n))) return;
|
|
323
|
+
|
|
324
|
+
let properties: TypeProperty[] = [];
|
|
325
|
+
|
|
326
|
+
if (definition.allOf) {
|
|
327
|
+
properties = definition.allOf.flatMap((ofDefinition) => {
|
|
328
|
+
if (typeof ofDefinition !== 'object') return [];
|
|
329
|
+
|
|
330
|
+
if (ofDefinition.properties) {
|
|
331
|
+
return Object.entries(ofDefinition.properties).flatMap(
|
|
332
|
+
([refName, refDefinition]) =>
|
|
333
|
+
defineProperty(refName, refDefinition, ofDefinition.required) || [],
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (!ofDefinition['$ref']) return [];
|
|
338
|
+
|
|
339
|
+
const reference = ofDefinition['$ref'].substring(14);
|
|
340
|
+
|
|
341
|
+
const defReference = definitions[reference];
|
|
342
|
+
|
|
343
|
+
if (!defReference) return [];
|
|
344
|
+
|
|
345
|
+
return Object.entries(defReference.properties || {}).flatMap(
|
|
346
|
+
([refName, refDefinition]) =>
|
|
347
|
+
defineProperty(refName, refDefinition, defReference.required) || [],
|
|
348
|
+
);
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (definition.properties) {
|
|
353
|
+
const props = definition.properties as Record<string, TJS.Definition>;
|
|
354
|
+
const hasDescription = Object.values(props).some((p) => p.description);
|
|
355
|
+
if (!hasDescription) {
|
|
356
|
+
// probably a type that is only used as a reference
|
|
357
|
+
// console.error(`${definitionName} has no description`);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
properties = Object.entries(props).flatMap(
|
|
361
|
+
([propName, prop]) => defineProperty(propName, prop, definition.required) || [],
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
nextTypes.push({
|
|
366
|
+
name: definitionName,
|
|
367
|
+
properties,
|
|
368
|
+
id: kebabCase(definitionName),
|
|
369
|
+
description: definition.description,
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
// we don't reference types that have names less than 3 characters long
|
|
374
|
+
const nextTypeNames = nextTypes.flatMap((t) => (t.name.length > 3 ? t.name : []));
|
|
375
|
+
|
|
376
|
+
nextTypes.forEach((nextType) => {
|
|
377
|
+
const references = nextType.properties
|
|
378
|
+
?.flatMap((prop) =>
|
|
379
|
+
nextTypeNames.filter((name) => prop.description?.includes(name) || prop.type?.includes(name)),
|
|
380
|
+
)
|
|
381
|
+
?.filter((name, index, arr) => arr.indexOf(name) === index);
|
|
382
|
+
|
|
383
|
+
if (references && references.length > 0) nextType.references = references;
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
const duplicateIds = nextTypes.flatMap((t) => t.id).filter((id, index, arr) => arr.indexOf(id) !== index);
|
|
387
|
+
|
|
388
|
+
if (duplicateIds.length > 0) {
|
|
389
|
+
console.error(`Duplicate IDs found: ${duplicateIds.join(', ')}`);
|
|
390
|
+
console.error('Please fix the IDs in the components.');
|
|
391
|
+
process.exit(1);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
return nextTypes;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
async function createMeta() {
|
|
398
|
+
const componentsMeta: ComponentMeta[] = componentFiles
|
|
399
|
+
.flatMap((component) => generateComponentMeta(component) || [])
|
|
400
|
+
// filter out dependencies that aren't components
|
|
401
|
+
.map((m, _, arr): ComponentMeta => {
|
|
402
|
+
return {
|
|
403
|
+
...m,
|
|
404
|
+
dependencies: m.dependencies?.filter((d) => arr.find((c) => c.name === d)),
|
|
405
|
+
};
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
componentsMeta.sort((a, b) => a.name.localeCompare(b.name));
|
|
409
|
+
|
|
410
|
+
const hookFiles = fs
|
|
411
|
+
.readdirSync(hooksDir)
|
|
412
|
+
.map((f) => `${hooksDir}/${f}`)
|
|
413
|
+
.filter((f) => f.endsWith('.tsx') || f.endsWith('.ts'));
|
|
414
|
+
|
|
415
|
+
const metaComponentNames: string[] = componentsMeta.map((m) => m.name);
|
|
416
|
+
|
|
417
|
+
const utilitiesMeta: UtilityMeta[] = [];
|
|
418
|
+
for (const hookFile of hookFiles) {
|
|
419
|
+
const elementMeta = await generateUtilityMeta(hookFile);
|
|
420
|
+
if (elementMeta) utilitiesMeta.push(elementMeta);
|
|
421
|
+
}
|
|
422
|
+
utilitiesMeta.sort((a, b) => a.name.localeCompare(b.name));
|
|
423
|
+
|
|
424
|
+
const typesMeta = generateTypes();
|
|
425
|
+
typesMeta.sort((a, b) => a.name.localeCompare(b.name));
|
|
426
|
+
|
|
427
|
+
fs.writeFileSync(
|
|
428
|
+
metaFilePath,
|
|
429
|
+
[
|
|
430
|
+
`/** This file is generated by the @bspk/ui/meta.ts script with data scraped from the library. */`,
|
|
431
|
+
|
|
432
|
+
fs.readFileSync(path.resolve(__dirname, 'meta-types.ts'), { encoding: 'utf-8' }),
|
|
433
|
+
|
|
434
|
+
`export const componentsMeta: ComponentMeta[] = ${JSON.stringify(componentsMeta, null, 2)} as const;`,
|
|
435
|
+
|
|
436
|
+
`export const utilitiesMeta: UtilityMeta[] = ${JSON.stringify(utilitiesMeta, null, 2)} as const;`,
|
|
437
|
+
|
|
438
|
+
`export const typesMeta: TypeMeta[] = ${JSON.stringify(typesMeta, null, 2)} as const;`,
|
|
439
|
+
|
|
440
|
+
`export type MetaTypeName = '${typesMeta.map((t) => t.name).join("' | '")}';`,
|
|
441
|
+
|
|
442
|
+
`export type MetaComponentName = '${metaComponentNames.join("' | '")}';`,
|
|
443
|
+
].join('\n\n'),
|
|
444
|
+
);
|
|
445
|
+
|
|
446
|
+
pretty(metaFilePath);
|
|
447
|
+
|
|
448
|
+
console.info('Create meta complete.');
|
|
449
|
+
|
|
450
|
+
return {
|
|
451
|
+
componentsMeta,
|
|
452
|
+
utilitiesMeta,
|
|
453
|
+
typesMeta,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
async function main() {
|
|
458
|
+
await createMeta();
|
|
459
|
+
|
|
460
|
+
process.exit(0);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
main();
|
|
464
|
+
|
|
465
|
+
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
package/package.json
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bspk/ui",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"main": "index.js",
|
|
3
|
+
"version": "1.1.12",
|
|
5
4
|
"license": "CC-BY-4.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"meta.ts",
|
|
12
|
+
"meta-types.ts"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
"./*": "./dist/*.js",
|
|
16
|
+
".": "./dist/index.js"
|
|
17
|
+
},
|
|
6
18
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"build
|
|
9
|
-
"
|
|
10
|
-
"lint
|
|
11
|
-
"clean": "ts-node .scripts/clean.ts",
|
|
12
|
-
"lint": "eslint && tsc --noEmit",
|
|
19
|
+
"sass": "sass --style=compressed --no-source-map src:dist",
|
|
20
|
+
"build": "tsx build.ts",
|
|
21
|
+
"lint:css": "npx stylelint '**/*.scss'",
|
|
22
|
+
"lint": "eslint",
|
|
13
23
|
"lint:fix": "eslint --fix",
|
|
14
|
-
"rollup": "rollup -c",
|
|
15
24
|
"semantic-release": "semantic-release",
|
|
16
25
|
"test": "jest",
|
|
17
|
-
"pack": "rm -rf ./package && npm run build && npm pack && npm run clean",
|
|
18
26
|
"prepare": "husky",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
27
|
+
"pre:commit": "tsx .scripts/pre-commit.ts",
|
|
28
|
+
"tsc": "tsc",
|
|
29
|
+
"meta": "tsx meta.ts"
|
|
22
30
|
},
|
|
23
31
|
"publishConfig": {
|
|
24
32
|
"access": "public"
|
|
@@ -27,19 +35,20 @@
|
|
|
27
35
|
"node": ">=20"
|
|
28
36
|
},
|
|
29
37
|
"dependencies": {
|
|
30
|
-
"@bspk/icons": "^1.0.3",
|
|
31
38
|
"@bspk/styles": "^1.0.0",
|
|
32
39
|
"@floating-ui/dom": "^1.6.13",
|
|
33
40
|
"focus-trap-react": "^11.0.1"
|
|
34
41
|
},
|
|
35
42
|
"peerDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"react": "^18.3.1"
|
|
43
|
+
"@bspk/icons": "^1.0.3",
|
|
44
|
+
"react": "^18.3.1",
|
|
45
|
+
"react-dom": "^18.3.1"
|
|
38
46
|
},
|
|
39
47
|
"devDependencies": {
|
|
40
48
|
"@cspell/eslint-plugin": "^8.17.5",
|
|
49
|
+
"@eslint/css": "^0.8.1",
|
|
41
50
|
"@eslint/js": "^9.14.0",
|
|
42
|
-
"@
|
|
51
|
+
"@playwright/test": "^1.52.0",
|
|
43
52
|
"@semantic-release/git": "^10.0.1",
|
|
44
53
|
"@semantic-release/github": "^11.0.2",
|
|
45
54
|
"@semantic-release/npm": "^12.0.1",
|
|
@@ -60,12 +69,14 @@
|
|
|
60
69
|
"husky": "^9.1.7",
|
|
61
70
|
"jest": "^29.7.0",
|
|
62
71
|
"prettier-plugin-jsdoc": "^1.3.0",
|
|
63
|
-
"
|
|
64
|
-
"rollup": "^2.79.2",
|
|
72
|
+
"sass": "^1.89.0",
|
|
65
73
|
"semantic-release": "^24.2.0",
|
|
74
|
+
"stylelint": "^16.19.1",
|
|
75
|
+
"stylelint-config-standard": "^38.0.0",
|
|
76
|
+
"stylelint-config-standard-scss": "^14.0.0",
|
|
66
77
|
"ts-jest": "^29.2.5",
|
|
67
|
-
"ts-node": "^10.9.2",
|
|
68
78
|
"tslib": "^2.8.1",
|
|
79
|
+
"tsx": "^4.19.4",
|
|
69
80
|
"typescript": "5.6.3",
|
|
70
81
|
"typescript-eslint": "8.13.0",
|
|
71
82
|
"typescript-json-schema": "^0.65.1"
|