periplo-ui 4.23.2 → 4.24.0
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/dist/base.css +254 -0
- package/dist/components/data-display/Avatar/Avatar.js +8 -9
- package/dist/components/data-display/Avatar/Avatar.js.map +1 -1
- package/dist/components/data-display/Avatar/index.js +1 -2
- package/dist/components/data-display/Badge/Badge.d.ts +1 -1
- package/dist/components/data-display/Badge/Badge.js +10 -11
- package/dist/components/data-display/Badge/Badge.js.map +1 -1
- package/dist/components/data-display/Badge/index.js +1 -2
- package/dist/components/data-display/Carousel/Carousel.js +3 -4
- package/dist/components/data-display/Carousel/Carousel.js.map +1 -1
- package/dist/components/data-display/Carousel/index.js +1 -2
- package/dist/components/data-display/Chip/Chip.d.ts +1 -1
- package/dist/components/data-display/Chip/Chip.js +29 -33
- package/dist/components/data-display/Chip/Chip.js.map +1 -1
- package/dist/components/data-display/Chip/index.js +1 -2
- package/dist/components/data-display/DataTable/DataTable.js +11 -10
- package/dist/components/data-display/DataTable/DataTable.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableBody.js +15 -14
- package/dist/components/data-display/DataTable/components/DataTableBody.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableCell.js +2 -3
- package/dist/components/data-display/DataTable/components/DataTableCheckbox.js +2 -3
- package/dist/components/data-display/DataTable/components/DataTableCheckbox.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableColumnHeader.js +4 -5
- package/dist/components/data-display/DataTable/components/DataTableColumnHeader.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableGroupRow.js +8 -8
- package/dist/components/data-display/DataTable/components/DataTableGroupRow.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTablePagination.js +9 -10
- package/dist/components/data-display/DataTable/components/DataTablePagination.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableSelectCells.js +1 -2
- package/dist/components/data-display/DataTable/components/DataTableToolbar.js +8 -9
- package/dist/components/data-display/DataTable/components/DataTableToolbar.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableToolbarButton.js +2 -3
- package/dist/components/data-display/DataTable/components/dataTableCellStyles.js +3 -4
- package/dist/components/data-display/DataTable/components/dataTableCellStyles.js.map +1 -1
- package/dist/components/data-display/DataTable/data.js +1 -2
- package/dist/components/data-display/DataTable/hooks/useGroupExpansion.js +1 -2
- package/dist/components/data-display/DataTable/hooks/useSelectColumn.js +1 -2
- package/dist/components/data-display/DataTable/hooks/useSelection.js +1 -2
- package/dist/components/data-display/DataTable/hooks/useSorting.js +1 -2
- package/dist/components/data-display/DataTable/index.js +1 -1
- package/dist/components/data-display/DataTable/utils.js +1 -2
- package/dist/components/data-display/Flag/Flag.js +3 -4
- package/dist/components/data-display/Flag/Flag.js.map +1 -1
- package/dist/components/data-display/Flag/index.js +1 -2
- package/dist/components/data-display/Label/Label.js +2 -3
- package/dist/components/data-display/Label/Label.js.map +1 -1
- package/dist/components/data-display/Label/index.js +1 -2
- package/dist/components/data-display/Marquee/Marquee.js +2 -3
- package/dist/components/data-display/Marquee/Marquee.js.map +1 -1
- package/dist/components/data-display/Marquee/index.js +1 -2
- package/dist/components/data-display/NotificationBadge/NotificationBadge.js +13 -15
- package/dist/components/data-display/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/components/data-display/NotificationBadge/index.js +1 -2
- package/dist/components/data-display/Popover/Popover.js +4 -5
- package/dist/components/data-display/Popover/Popover.js.map +1 -1
- package/dist/components/data-display/Popover/index.js +1 -2
- package/dist/components/data-display/Separator/Separator.js +2 -3
- package/dist/components/data-display/Separator/Separator.js.map +1 -1
- package/dist/components/data-display/Separator/index.js +1 -2
- package/dist/components/data-display/Table/Table.js +5 -6
- package/dist/components/data-display/Table/Table.js.map +1 -1
- package/dist/components/data-display/Table/index.js +1 -2
- package/dist/components/data-display/Tooltip/Tooltip.js +22 -6
- package/dist/components/data-display/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/data-display/Tooltip/index.js +1 -2
- package/dist/components/data-display/TruncatedTypographyWithTooltip/TruncatedTypographyWithTooltip.js +2 -3
- package/dist/components/data-display/TruncatedTypographyWithTooltip/index.js +1 -2
- package/dist/components/data-display/Typography/Typography.d.ts +4 -4
- package/dist/components/data-display/Typography/Typography.js +27 -31
- package/dist/components/data-display/Typography/Typography.js.map +1 -1
- package/dist/components/data-display/Typography/index.js +1 -2
- package/dist/components/feedback/Dialog/Dialog.js +8 -9
- package/dist/components/feedback/Dialog/Dialog.js.map +1 -1
- package/dist/components/feedback/Dialog/index.js +1 -2
- package/dist/components/feedback/Progress/Progress.d.ts +2 -2
- package/dist/components/feedback/Progress/Progress.js +7 -8
- package/dist/components/feedback/Progress/Progress.js.map +1 -1
- package/dist/components/feedback/Progress/hooks/useFakeProgress.js +1 -2
- package/dist/components/feedback/Progress/index.js +1 -2
- package/dist/components/feedback/Skeleton/Skeleton.js +2 -3
- package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/feedback/Skeleton/index.js +1 -2
- package/dist/components/feedback/Toaster/Toaster.js +11 -12
- package/dist/components/feedback/Toaster/Toaster.js.map +1 -1
- package/dist/components/feedback/Toaster/index.js +1 -2
- package/dist/components/inputs/Button/Button.d.ts +1 -1
- package/dist/components/inputs/Button/Button.js +62 -58
- package/dist/components/inputs/Button/Button.js.map +1 -1
- package/dist/components/inputs/Button/index.js +1 -2
- package/dist/components/inputs/Calendar/Calendar.js +38 -36
- package/dist/components/inputs/Calendar/Calendar.js.map +1 -1
- package/dist/components/inputs/Calendar/index.js +1 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +14 -13
- package/dist/components/inputs/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/inputs/Checkbox/index.js +1 -2
- package/dist/components/inputs/Combobox/Combobox.d.ts +1 -1
- package/dist/components/inputs/Combobox/Combobox.js +6 -6
- package/dist/components/inputs/Combobox/Combobox.js.map +1 -1
- package/dist/components/inputs/Combobox/ComboboxOptionWithTooltip.js +1 -2
- package/dist/components/inputs/Combobox/ComboboxTrigger.js +7 -5
- package/dist/components/inputs/Combobox/ComboboxTrigger.js.map +1 -1
- package/dist/components/inputs/Combobox/StaticComboboxList.js +10 -22
- package/dist/components/inputs/Combobox/StaticComboboxList.js.map +1 -1
- package/dist/components/inputs/Combobox/VirtualizedComboboxList.js +6 -7
- package/dist/components/inputs/Combobox/VirtualizedComboboxList.js.map +1 -1
- package/dist/components/inputs/Combobox/hooks/index.js +1 -1
- package/dist/components/inputs/Combobox/hooks/useComboboxOpenState.js +1 -2
- package/dist/components/inputs/Combobox/hooks/useComboboxSelection.js +1 -2
- package/dist/components/inputs/Combobox/hooks/useDebouncedState.js +5 -6
- package/dist/components/inputs/Combobox/hooks/useDebouncedState.js.map +1 -1
- package/dist/components/inputs/Combobox/hooks/useDisplayValue.js +1 -2
- package/dist/components/inputs/Combobox/index.js +1 -1
- package/dist/components/inputs/Combobox/types.d.ts +1 -1
- package/dist/components/inputs/Combobox/useCombobox.js +1 -2
- package/dist/components/inputs/Command/Command.js +25 -21
- package/dist/components/inputs/Command/Command.js.map +1 -1
- package/dist/components/inputs/Command/index.js +1 -2
- package/dist/components/inputs/CountrySelect/CountrySelect.js +7 -9
- package/dist/components/inputs/CountrySelect/CountrySelect.js.map +1 -1
- package/dist/components/inputs/CountrySelect/index.js +1 -2
- package/dist/components/inputs/DatePicker/DatePicker.js +7 -8
- package/dist/components/inputs/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/inputs/DatePicker/hooks/useLocale.js +1 -2
- package/dist/components/inputs/DatePicker/index.js +1 -2
- package/dist/components/inputs/Field/Field.js +15 -13
- package/dist/components/inputs/Field/Field.js.map +1 -1
- package/dist/components/inputs/Field/index.js +1 -2
- package/dist/components/inputs/Form/Form.d.ts +1 -1
- package/dist/components/inputs/Form/Form.js +5 -6
- package/dist/components/inputs/Form/Form.js.map +1 -1
- package/dist/components/inputs/Form/Page.js +1 -2
- package/dist/components/inputs/Form/index.js +1 -2
- package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.d.ts +7 -1
- package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js +80 -29
- package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js.map +1 -1
- package/dist/components/inputs/InlineMultiSelect/index.js +1 -2
- package/dist/components/inputs/Input/Input.js +22 -15
- package/dist/components/inputs/Input/Input.js.map +1 -1
- package/dist/components/inputs/Input/index.js +1 -2
- package/dist/components/inputs/InputDate/InputDate.js +16 -17
- package/dist/components/inputs/InputDate/InputDate.js.map +1 -1
- package/dist/components/inputs/InputDate/index.js +1 -2
- package/dist/components/inputs/InputOTP/InputOTP.js +5 -6
- package/dist/components/inputs/InputOTP/InputOTP.js.map +1 -1
- package/dist/components/inputs/InputOTP/index.js +1 -2
- package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js +14 -14
- package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js.map +1 -1
- package/dist/components/inputs/LazyDatePicker/index.js +1 -2
- package/dist/components/inputs/MultiSelect/MultiSelect.js +9 -14
- package/dist/components/inputs/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/inputs/MultiSelect/Page.js +1 -2
- package/dist/components/inputs/MultiSelect/index.js +1 -2
- package/dist/components/inputs/PhoneInput/PhoneInput.js +18 -21
- package/dist/components/inputs/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/components/inputs/PhoneInput/hooks/index.js +1 -2
- package/dist/components/inputs/PhoneInput/hooks/usePhoneField.js +7 -8
- package/dist/components/inputs/PhoneInput/hooks/usePhoneField.js.map +1 -1
- package/dist/components/inputs/PhoneInput/index.js +1 -1
- package/dist/components/inputs/PhoneInput/phone.js +1 -2
- package/dist/components/inputs/RadioGroup/Page.js +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +14 -14
- package/dist/components/inputs/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/inputs/RadioGroup/index.js +1 -2
- package/dist/components/inputs/Select/Select.js +22 -21
- package/dist/components/inputs/Select/Select.js.map +1 -1
- package/dist/components/inputs/Select/index.js +1 -2
- package/dist/components/inputs/StarRating/StarRating.js +10 -11
- package/dist/components/inputs/StarRating/StarRating.js.map +1 -1
- package/dist/components/inputs/StarRating/index.js +1 -2
- package/dist/components/inputs/Textarea/Textarea.js +11 -11
- package/dist/components/inputs/Textarea/Textarea.js.map +1 -1
- package/dist/components/inputs/Textarea/index.js +1 -2
- package/dist/components/inputs/Toggle/Toggle.js +19 -15
- package/dist/components/inputs/Toggle/Toggle.js.map +1 -1
- package/dist/components/inputs/Toggle/index.js +1 -2
- package/dist/components/inputs/ToggleGroup/ToggleGroup.js +2 -3
- package/dist/components/inputs/ToggleGroup/index.js +1 -2
- package/dist/components/inputs/shared/ClearButton.js +9 -10
- package/dist/components/inputs/shared/ClearButton.js.map +1 -1
- package/dist/components/inputs/shared/InputGroup.js +15 -12
- package/dist/components/inputs/shared/InputGroup.js.map +1 -1
- package/dist/components/inputs/shared/calendarDayContext.js +1 -2
- package/dist/components/inputs/shared/fieldInvalid.js +1 -2
- package/dist/components/navigation/Breadcrumb/Breadcrumb.js +8 -9
- package/dist/components/navigation/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/navigation/Breadcrumb/index.js +1 -2
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js +31 -35
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/navigation/DropdownMenu/index.js +1 -2
- package/dist/components/navigation/Pagination/Pagination.js +6 -7
- package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
- package/dist/components/navigation/Pagination/index.js +1 -2
- package/dist/components/navigation/Sheet/Sheet.js +9 -12
- package/dist/components/navigation/Sheet/Sheet.js.map +1 -1
- package/dist/components/navigation/Sheet/index.js +1 -2
- package/dist/components/navigation/Sidebar/Sidebar.d.ts +2 -2
- package/dist/components/navigation/Sidebar/Sidebar.js +30 -31
- package/dist/components/navigation/Sidebar/Sidebar.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarMenu.d.ts +5 -5
- package/dist/components/navigation/Sidebar/SidebarMenu.js +46 -53
- package/dist/components/navigation/Sidebar/SidebarMenu.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarPage.js +9 -10
- package/dist/components/navigation/Sidebar/SidebarPage.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarUser.js +23 -25
- package/dist/components/navigation/Sidebar/SidebarUser.js.map +1 -1
- package/dist/components/navigation/Sidebar/context.js +1 -2
- package/dist/components/navigation/Sidebar/index.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +21 -7
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/navigation/Tabs/index.js +1 -2
- package/dist/components/shared/CloseButton.js +1 -2
- package/dist/components/shared/OptionCheck.d.ts +14 -0
- package/dist/components/shared/OptionCheck.js +22 -0
- package/dist/components/shared/OptionCheck.js.map +1 -0
- package/dist/components/shared/Spinner.d.ts +7 -0
- package/dist/components/shared/Spinner.js +19 -0
- package/dist/components/shared/Spinner.js.map +1 -0
- package/dist/components/shared/index.d.ts +2 -0
- package/dist/components/shared/index.js +3 -1
- package/dist/components/surface/Accordion/Accordion.js +5 -6
- package/dist/components/surface/Accordion/Accordion.js.map +1 -1
- package/dist/components/surface/Accordion/index.js +1 -2
- package/dist/components/surface/Card/Card.js +2 -3
- package/dist/components/surface/Card/Card.js.map +1 -1
- package/dist/components/surface/Card/index.js +1 -2
- package/dist/components/surface/Collapsible/Collapsible.js +1 -2
- package/dist/components/surface/Collapsible/index.js +1 -2
- package/dist/foundations/shared.d.ts +22 -0
- package/dist/foundations/shared.js +63 -0
- package/dist/foundations/shared.js.map +1 -0
- package/dist/lib/countries.js +1 -2
- package/dist/lib/dateUtils.js +1 -2
- package/dist/lib/flagSvg.js +1 -2
- package/dist/lib/inputModality.js +1 -2
- package/dist/lib/marquee.js +1 -2
- package/dist/lib/useListScroll.js +1 -2
- package/dist/lib/useLocale.js +1 -2
- package/dist/lib/useMobile.js +1 -2
- package/dist/lib/useSlidingIndicator.js +1 -2
- package/dist/lib/useTouchDevice.js +1 -2
- package/dist/lib/utils.js +66 -3
- package/dist/lib/utils.js.map +1 -1
- package/dist/node_modules/country-flag-icons/3x2/AC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AD.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AQ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AX.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/AZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BB.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BD.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BJ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BQ-BO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BQ-SA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BQ-SE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BQ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BV.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/BZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CD.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CV.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CX.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/CZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/DE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/DJ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/DK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/DM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/DO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/DZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/EC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/EE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/EG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/EH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ER.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ES-CT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ES.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ET.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/EU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/FI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/FJ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/FK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/FM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/FO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/FR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GB-ENG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GB-NIR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GB-SCT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GB-WLS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GB.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GD.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GP.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GQ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/GY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/HK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/HM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/HN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/HR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/HT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/HU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ID.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IQ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/IT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/JE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/JM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/JO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/JP.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KP.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/KZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LB.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LV.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/LY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MD.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ME.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ML.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MP.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MQ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MV.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MX.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/MZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NP.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/NZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/OM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/PY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/QA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/RE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/RO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/RS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/RU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/RW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SB.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SD.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SJ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ST.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SV.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SX.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/SZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TD.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TH.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TJ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TL.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TR.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TV.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TW.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/TZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/UA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/UG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/UM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/US.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/UY.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/UZ.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/VA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/VC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/VE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/VG.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/VI.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/VN.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/VU.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/WF.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/WS.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/XA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/XC.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/XK.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/XO.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/YE.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/YT.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ZA.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ZM.js +1 -2
- package/dist/node_modules/country-flag-icons/3x2/ZW.js +1 -2
- package/dist/theme.css +3 -336
- package/dist/tokens.css +491 -0
- package/dist/utilities.css +642 -0
- package/package.json +86 -85
- package/dist/theme/control.css +0 -94
- package/dist/theme/fade-text.css +0 -7
- package/dist/theme/hit-area.css +0 -42
- package/dist/theme/motion.css +0 -3
- package/dist/theme/press.css +0 -22
- package/dist/theme/scrollbar.css +0 -3
- package/dist/theme/sliding-indicator.css +0 -7
- package/dist/theme/sticky-column.css +0 -11
- package/dist/theme/surface.css +0 -18
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
1
|
import { useFakeProgress } from "./hooks/useFakeProgress.js";
|
|
2
|
+
import { cn } from "../../../lib/utils.js";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
7
|
-
|
|
8
|
-
var progressVariants = cva("relative w-full overflow-hidden bg-
|
|
7
|
+
// src/components/feedback/Progress/Progress.tsx
|
|
8
|
+
var progressVariants = cva("relative w-full overflow-hidden bg-surface-progress-inactive", {
|
|
9
9
|
variants: {
|
|
10
10
|
size: {
|
|
11
11
|
sm: "h-2",
|
|
@@ -15,14 +15,14 @@ var progressVariants = cva("relative w-full overflow-hidden bg-background-300",
|
|
|
15
15
|
radius: {
|
|
16
16
|
none: "rounded-none",
|
|
17
17
|
sm: "rounded-sm",
|
|
18
|
-
md: "rounded-
|
|
18
|
+
md: "rounded-lg",
|
|
19
19
|
lg: "rounded-lg",
|
|
20
20
|
full: "rounded-full"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
defaultVariants: { size: "md" }
|
|
24
24
|
});
|
|
25
|
-
var Progress = React$1.forwardRef(({ className, value, variant = "default", size, indicatorColor = "bg-
|
|
25
|
+
var Progress = React$1.forwardRef(({ className, value, variant = "default", size, indicatorColor = "bg-surface-progress-active", duration = 1e4, onComplete, autoStart = true, radius = "full", ...props }, ref) => {
|
|
26
26
|
const { progress: fakeProgressValue } = useFakeProgress({
|
|
27
27
|
duration,
|
|
28
28
|
onComplete,
|
|
@@ -38,16 +38,15 @@ var Progress = React$1.forwardRef(({ className, value, variant = "default", size
|
|
|
38
38
|
...props,
|
|
39
39
|
value: progressValue,
|
|
40
40
|
children: variant === "indeterminate" ? /* @__PURE__ */ jsx(ProgressPrimitive.Indicator, {
|
|
41
|
-
className: cn(progressVariants({ radius }), "
|
|
41
|
+
className: cn(progressVariants({ radius }), "size-full flex-1 motion-indeterminate bg-surface-brand-strong", indicatorColor),
|
|
42
42
|
style: { transform: "translateX(-50%)" }
|
|
43
43
|
}) : /* @__PURE__ */ jsx(ProgressPrimitive.Indicator, {
|
|
44
|
-
className: cn(progressVariants({ radius }), "
|
|
44
|
+
className: cn(progressVariants({ radius }), "size-full flex-1 transition-transform", indicatorColor),
|
|
45
45
|
style: { transform: `translateX(-${(100 - (progressValue ?? 0)).toString()}%)` }
|
|
46
46
|
})
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
49
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
50
|
-
//#endregion
|
|
51
50
|
export { Progress };
|
|
52
51
|
|
|
53
52
|
//# sourceMappingURL=Progress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","names":["React"],"sources":["../../../../src/components/feedback/Progress/Progress.tsx"],"sourcesContent":["import * as ProgressPrimitive from '@radix-ui/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { useFakeProgress } from './hooks/useFakeProgress'\n\nimport { cn } from '@/lib/utils'\n\nconst progressVariants = cva('relative w-full overflow-hidden bg-
|
|
1
|
+
{"version":3,"file":"Progress.js","names":["React"],"sources":["../../../../src/components/feedback/Progress/Progress.tsx"],"sourcesContent":["import * as ProgressPrimitive from '@radix-ui/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { useFakeProgress } from './hooks/useFakeProgress'\n\nimport { cn } from '@/lib/utils'\n\nconst progressVariants = cva('relative w-full overflow-hidden bg-surface-progress-inactive', {\n variants: {\n size: {\n sm: 'h-2',\n md: 'h-4',\n lg: 'h-6',\n },\n radius: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-lg',\n lg: 'rounded-lg',\n full: 'rounded-full',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n})\n\nexport type ProgressProps = {\n /**\n * The variant of the progress bar.\n * 'default': A standard progress bar that requires a `value` prop.\n * 'fake': A progress bar that simulates progress over a given `duration`.\n * 'indeterminate': A progress bar for when the progress is unknown.\n * @default 'default'\n */\n variant?: 'default' | 'fake' | 'indeterminate'\n /**\n * The color of the progress indicator. Should be a Tailwind CSS background color class.\n * @default 'bg-surface-progress-active'\n */\n indicatorColor?: string\n /**\n * The total duration of the fake progress in milliseconds.\n * Only used when `variant` is 'fake'.\n * @default 10000\n */\n duration?: number\n /**\n * A callback function to be called when the fake progress is complete.\n * Only used when `variant` is 'fake'.\n */\n onComplete?: () => void\n /**\n * Whether to start the fake progress automatically.\n * Only used when `variant` is 'fake'.\n * @default true\n */\n autoStart?: boolean\n /**\n * The border radius of the progress bar and indicator.\n * @default 'full'\n */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'full'\n} & React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> &\n VariantProps<typeof progressVariants>\n\nconst Progress = React.forwardRef<React.ComponentRef<typeof ProgressPrimitive.Root>, Readonly<ProgressProps>>(\n (\n {\n className,\n value,\n variant = 'default',\n size,\n indicatorColor = 'bg-surface-progress-active',\n duration = 10000,\n onComplete,\n autoStart = true,\n radius = 'full',\n ...props\n },\n ref,\n ) => {\n const { progress: fakeProgressValue } = useFakeProgress({\n duration,\n onComplete,\n autoStart: variant === 'fake' ? autoStart : false,\n })\n\n const progressValue = variant === 'fake' ? fakeProgressValue : value\n\n return (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(progressVariants({ size, radius }), className)}\n {...props}\n value={progressValue}\n >\n {variant === 'indeterminate' ? (\n <ProgressPrimitive.Indicator\n className={cn(\n progressVariants({ radius }),\n 'size-full flex-1 motion-indeterminate bg-surface-brand-strong',\n indicatorColor,\n )}\n style={{\n transform: 'translateX(-50%)',\n }}\n />\n ) : (\n <ProgressPrimitive.Indicator\n className={cn(progressVariants({ radius }), 'size-full flex-1 transition-transform', indicatorColor)}\n style={{ transform: `translateX(-${(100 - (progressValue ?? 0)).toString()}%)` }}\n />\n )}\n </ProgressPrimitive.Root>\n )\n },\n)\nProgress.displayName = ProgressPrimitive.Root.displayName\n\nexport { Progress }\n"],"mappings":";;;;;;;AAQA,IAAM,mBAAmB,IAAI,gEAAgE;CAC3F,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,QAAQ;GACN,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;CACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC;AAyCD,IAAM,WAAWA,QAAM,YAEnB,EACE,WACA,OACA,UAAU,WACV,MACA,iBAAiB,8BACjB,WAAW,KACX,YACA,YAAY,MACZ,SAAS,QACT,GAAG,SAEL,QACG;CACH,MAAM,EAAE,UAAU,sBAAsB,gBAAgB;EACtD;EACA;EACA,WAAW,YAAY,SAAS,YAAY;CAC9C,CAAC;CAED,MAAM,gBAAgB,YAAY,SAAS,oBAAoB;CAE/D,OACE,oBAAC,kBAAkB,MAAnB;EACO;EACL,WAAW,GAAG,iBAAiB;GAAE;GAAM;EAAO,CAAC,GAAG,SAAS;EAC3D,GAAI;EACJ,OAAO;EAEN,UAAA,YAAY,kBACX,oBAAC,kBAAkB,WAAnB;GACE,WAAW,GACT,iBAAiB,EAAE,OAAO,CAAC,GAC3B,iEACA,cACF;GACA,OAAO,EACL,WAAW,mBACb;EACD,CAAA,IAED,oBAAC,kBAAkB,WAAnB;GACE,WAAW,GAAG,iBAAiB,EAAE,OAAO,CAAC,GAAG,yCAAyC,cAAc;GACnG,OAAO,EAAE,WAAW,gBAAgB,OAAO,iBAAiB,GAAA,CAAI,SAAS,EAAE,IAAI;EAChF,CAAA;CAEmB,CAAA;AAE5B,CACF;AACA,SAAS,cAAc,kBAAkB,KAAK"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/feedback/Progress/hooks/useFakeProgress.ts
|
|
3
3
|
var useFakeProgress = ({ duration = 3e3, onComplete, autoStart = true } = {}) => {
|
|
4
4
|
const [progress, setProgress] = useState(0);
|
|
5
5
|
const [isComplete, setIsComplete] = useState(false);
|
|
@@ -60,7 +60,6 @@ var useFakeProgress = ({ duration = 3e3, onComplete, autoStart = true } = {}) =>
|
|
|
60
60
|
reset
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
//#endregion
|
|
64
63
|
export { useFakeProgress };
|
|
65
64
|
|
|
66
65
|
//# sourceMappingURL=useFakeProgress.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Progress };
|
|
1
|
+
export { Progress } from "./Progress.js";
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/feedback/Skeleton/Skeleton.tsx
|
|
4
4
|
function Skeleton({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("div", {
|
|
6
6
|
"data-testid": "skeleton",
|
|
7
|
-
className: cn("
|
|
7
|
+
className: cn("motion-pulse rounded-lg bg-surface-tertiary", className),
|
|
8
8
|
...props
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { Skeleton };
|
|
13
12
|
|
|
14
13
|
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.js","names":[],"sources":["../../../../src/components/feedback/Skeleton/Skeleton.tsx"],"sourcesContent":["import { cn } from '@/lib/utils'\n\nfunction Skeleton({ className, ...props }: Readonly<React.HTMLAttributes<HTMLDivElement>>) {\n return (\n <div
|
|
1
|
+
{"version":3,"file":"Skeleton.js","names":[],"sources":["../../../../src/components/feedback/Skeleton/Skeleton.tsx"],"sourcesContent":["import { cn } from '@/lib/utils'\n\nfunction Skeleton({ className, ...props }: Readonly<React.HTMLAttributes<HTMLDivElement>>) {\n return (\n <div data-testid=\"skeleton\" className={cn('motion-pulse rounded-lg bg-surface-tertiary', className)} {...props} />\n )\n}\n\nexport { Skeleton }\n"],"mappings":";;;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAAyD;CACzF,OACE,oBAAC,OAAD;EAAK,eAAY;EAAW,WAAW,GAAG,+CAA+C,SAAS;EAAG,GAAI;CAAQ,CAAA;AAErH"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Skeleton };
|
|
1
|
+
export { Skeleton } from "./Skeleton.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import { cn } from "../../../lib/utils.js";
|
|
4
3
|
import { typographyVariants } from "../../data-display/Typography/Typography.js";
|
|
5
4
|
import { buttonVariants } from "../../inputs/Button/Button.js";
|
|
6
|
-
import {
|
|
5
|
+
import { Spinner } from "../../shared/Spinner.js";
|
|
6
|
+
import { cn } from "../../../lib/utils.js";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { CheckCircleIcon } from "@phosphor-icons/react/dist/ssr/CheckCircle";
|
|
9
9
|
import { GlobeHemisphereEastIcon } from "@phosphor-icons/react/dist/ssr/GlobeHemisphereEast";
|
|
@@ -11,7 +11,7 @@ import { InfoIcon } from "@phosphor-icons/react/dist/ssr/Info";
|
|
|
11
11
|
import { WarningIcon } from "@phosphor-icons/react/dist/ssr/Warning";
|
|
12
12
|
import { XCircleIcon } from "@phosphor-icons/react/dist/ssr/XCircle";
|
|
13
13
|
import { Toaster as Toaster$1, toast as toast$1 } from "sonner";
|
|
14
|
-
|
|
14
|
+
// src/components/feedback/Toaster/Toaster.tsx
|
|
15
15
|
/**
|
|
16
16
|
* Toast notification component with customizable styles and behaviors
|
|
17
17
|
* @example
|
|
@@ -37,21 +37,21 @@ var Toaster = ({ visibleToasts = 3, position = "bottom-right", closeButton = fal
|
|
|
37
37
|
toastOptions: {
|
|
38
38
|
unstyled: true,
|
|
39
39
|
classNames: {
|
|
40
|
-
toast: "group toast-group flex w-full min-w-75 items-center gap-4 p-4 rounded-lg text-
|
|
40
|
+
toast: "group toast-group flex w-full min-w-75 items-center gap-4 p-4 rounded-lg text-body-md border bg-surface-primary shadow-raised data-[type=default]:bg-surface-primary data-[type=default]:text-primary data-[type=default]:border-strong data-[type=success]:bg-surface-status-active data-[type=success]:text-status-active data-[type=success]:border-success data-[type=error]:bg-surface-status-returned data-[type=error]:text-status-returned data-[type=error]:border-danger data-[type=warning]:bg-surface-status-expired data-[type=warning]:text-warning data-[type=warning]:border-warning data-[type=info]:bg-surface-information data-[type=info]:text-information data-[type=info]:border-information",
|
|
41
41
|
icon: "-mr-1 shrink-0",
|
|
42
42
|
content: "min-w-0",
|
|
43
43
|
title: cn(typographyVariants({ weight: "medium" }), "text-inherit"),
|
|
44
44
|
description: cn(typographyVariants(), "text-inherit"),
|
|
45
45
|
loader: "static! transform-none! data-[visible=false]:hidden",
|
|
46
|
-
closeButton: "order-last ml-auto shrink-0 rounded-sm p-0
|
|
46
|
+
closeButton: "order-last ml-auto shrink-0 rounded-sm p-0 text-tertiary motion-hover hover:text-icon-primary focus-visible:text-icon-primary border-none! bg-transparent! [&_svg]:h-4 [&_svg]:w-4",
|
|
47
47
|
actionButton: cn(buttonVariants({
|
|
48
48
|
variant: "primary",
|
|
49
49
|
size: "sm"
|
|
50
|
-
}), "inline-block max-w-24 shrink-0 truncate text-left
|
|
50
|
+
}), "inline-block max-w-24 shrink-0 truncate py-1.5 text-left control-touch-none"),
|
|
51
51
|
cancelButton: cn(buttonVariants({
|
|
52
52
|
variant: "ghost",
|
|
53
53
|
size: "sm"
|
|
54
|
-
}), "-mr-2 ml-auto inline-block max-w-24 shrink-0 truncate text-left
|
|
54
|
+
}), "-mr-2 ml-auto inline-block max-w-24 shrink-0 truncate py-1.5 text-left control-touch-none")
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
icons: {
|
|
@@ -60,10 +60,10 @@ var Toaster = ({ visibleToasts = 3, position = "bottom-right", closeButton = fal
|
|
|
60
60
|
error: /* @__PURE__ */ jsx(XCircleIcon, { size: 24 }),
|
|
61
61
|
info: /* @__PURE__ */ jsx(InfoIcon, { size: 24 }),
|
|
62
62
|
loading: /* @__PURE__ */ jsx("div", {
|
|
63
|
-
className: "flex
|
|
64
|
-
children: /* @__PURE__ */ jsx(
|
|
65
|
-
|
|
66
|
-
className: "
|
|
63
|
+
className: "flex icon-lg items-center justify-center",
|
|
64
|
+
children: /* @__PURE__ */ jsx(Spinner, {
|
|
65
|
+
"aria-hidden": true,
|
|
66
|
+
className: "icon-md"
|
|
67
67
|
})
|
|
68
68
|
})
|
|
69
69
|
},
|
|
@@ -83,7 +83,6 @@ var toast = Object.assign((message, options) => toast$1(message, {
|
|
|
83
83
|
dismiss: (toastId) => toast$1.dismiss(toastId),
|
|
84
84
|
custom: (render, options) => toast$1.custom(render, options)
|
|
85
85
|
});
|
|
86
|
-
//#endregion
|
|
87
86
|
export { Toaster, toast };
|
|
88
87
|
|
|
89
88
|
//# sourceMappingURL=Toaster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.js","names":["Sonner","sonnerToast"],"sources":["../../../../src/components/feedback/Toaster/Toaster.tsx"],"sourcesContent":["'use client'\n\nimport { CheckCircleIcon } from '@phosphor-icons/react/dist/ssr/CheckCircle'\nimport { GlobeHemisphereEastIcon } from '@phosphor-icons/react/dist/ssr/GlobeHemisphereEast'\nimport { InfoIcon } from '@phosphor-icons/react/dist/ssr/Info'\nimport {
|
|
1
|
+
{"version":3,"file":"Toaster.js","names":["Sonner","sonnerToast"],"sources":["../../../../src/components/feedback/Toaster/Toaster.tsx"],"sourcesContent":["'use client'\n\nimport { CheckCircleIcon } from '@phosphor-icons/react/dist/ssr/CheckCircle'\nimport { GlobeHemisphereEastIcon } from '@phosphor-icons/react/dist/ssr/GlobeHemisphereEast'\nimport { InfoIcon } from '@phosphor-icons/react/dist/ssr/Info'\nimport { WarningIcon } from '@phosphor-icons/react/dist/ssr/Warning'\nimport { XCircleIcon } from '@phosphor-icons/react/dist/ssr/XCircle'\nimport { Toaster as Sonner, toast as sonnerToast, ToasterProps as SonnerProps } from 'sonner'\n\nimport { typographyVariants } from '../../data-display/Typography'\nimport { buttonVariants } from '../../inputs/Button'\nimport { Spinner } from '../../shared'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * Toast message type options\n */\nexport type ToastType = 'success' | 'error' | 'warning' | 'loading' | 'default' | 'info'\n\n/**\n * Toast position options\n * @default 'bottom-right'\n */\nexport type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'\n\n/**\n * Configuration for toast action buttons\n */\nexport type ToastAction = {\n /** Label text for the action button */\n label: string\n /** onClick handler for the action button */\n onClick: () => void\n /** Optional style object for the button */\n style?: React.CSSProperties\n}\n\n/**\n * Options for customizing toast appearance and behavior\n */\nexport type ToastOptions = {\n /** Optional description text below the main message */\n description?: React.ReactNode\n /** Duration in milliseconds to show the toast */\n duration?: number\n /** Custom icon element */\n icon?: React.ReactNode\n /** Position of the toast on screen */\n position?: ToastPosition\n /** ID for programmatically managing the toast */\n id?: string | number\n /** Action button configuration */\n action?: ToastAction\n /** Cancel button configuration */\n cancel?: ToastAction\n /** Callback when toast is dismissed */\n onDismiss?: () => void\n /** Callback when toast auto-closes */\n onAutoClose?: () => void\n /** Whether the toast can be dismissed */\n dismissible?: boolean\n /** Custom CSS classes */\n className?: string\n /** Whether to show the close button at the toast */\n closeButton?: boolean\n}\n\n/**\n * Props for the Toaster component\n */\nexport type ToasterProps = {\n /** Number of visible toasts */\n visibleToasts?: number\n /** Position of toasts */\n position?: ToastPosition\n /** Show close button on toasts, dismissable has to be true */\n closeButton?: boolean\n /** Whether to expand the toast */\n expand?: boolean\n} & Omit<SonnerProps, 'richColors' | 'expand' | 'gap' | 'dir' | 'invert'>\n\n/**\n * Toast notification component with customizable styles and behaviors\n * @example\n * ```tsx\n * <Toaster\n * theme=\"light\"\n * visibleToasts={3}\n * position=\"bottom-right\"\n * />\n * ```\n */\nconst Toaster = ({\n visibleToasts = 3,\n position = 'bottom-right',\n closeButton = false,\n expand = true,\n ...props\n}: Readonly<ToasterProps>) => {\n return (\n <Sonner\n className=\"toaster group\"\n theme=\"light\"\n richColors={false}\n expand={expand}\n visibleToasts={visibleToasts}\n position={position}\n closeButton={closeButton}\n dir=\"ltr\"\n invert={false}\n toastOptions={{\n unstyled: true,\n classNames: {\n toast:\n 'group toast-group flex w-full min-w-75 items-center gap-4 p-4 rounded-lg text-body-md border bg-surface-primary shadow-raised data-[type=default]:bg-surface-primary data-[type=default]:text-primary data-[type=default]:border-strong data-[type=success]:bg-surface-status-active data-[type=success]:text-status-active data-[type=success]:border-success data-[type=error]:bg-surface-status-returned data-[type=error]:text-status-returned data-[type=error]:border-danger data-[type=warning]:bg-surface-status-expired data-[type=warning]:text-warning data-[type=warning]:border-warning data-[type=info]:bg-surface-information data-[type=info]:text-information data-[type=info]:border-information',\n icon: '-mr-1 shrink-0',\n content: 'min-w-0',\n title: cn(typographyVariants({ weight: 'medium' }), 'text-inherit'),\n description: cn(typographyVariants(), 'text-inherit'),\n loader: 'static! transform-none! data-[visible=false]:hidden',\n closeButton:\n 'order-last ml-auto shrink-0 rounded-sm p-0 text-tertiary motion-hover hover:text-icon-primary focus-visible:text-icon-primary border-none! bg-transparent! [&_svg]:h-4 [&_svg]:w-4',\n actionButton: cn(\n buttonVariants({ variant: 'primary', size: 'sm' }),\n 'inline-block max-w-24 shrink-0 truncate py-1.5 text-left control-touch-none',\n ),\n cancelButton: cn(\n buttonVariants({ variant: 'ghost', size: 'sm' }),\n '-mr-2 ml-auto inline-block max-w-24 shrink-0 truncate py-1.5 text-left control-touch-none',\n ),\n },\n }}\n icons={{\n success: <CheckCircleIcon size={24} />,\n warning: <WarningIcon size={24} />,\n error: <XCircleIcon size={24} />,\n info: <InfoIcon size={24} />,\n loading: (\n <div className=\"flex icon-lg items-center justify-center\">\n <Spinner aria-hidden className=\"icon-md\" />\n </div>\n ),\n }}\n {...props}\n />\n )\n}\n\nconst toast = Object.assign(\n (message: React.ReactNode, options?: ToastOptions) =>\n sonnerToast(message, { icon: <GlobeHemisphereEastIcon size={24} />, ...options }),\n {\n info: (message: React.ReactNode, options?: ToastOptions) => sonnerToast.info(message, options),\n success: (message: React.ReactNode, options?: ToastOptions) => sonnerToast.success(message, options),\n error: (message: React.ReactNode, options?: ToastOptions) => sonnerToast.error(message, options),\n warning: (message: React.ReactNode, options?: ToastOptions) => sonnerToast.warning(message, options),\n loading: (message: React.ReactNode, options?: ToastOptions) => sonnerToast.loading(message, options),\n promise: <T,>(\n promise: Promise<T>,\n opts: {\n loading: React.ReactNode\n success: React.ReactNode | ((data: T) => React.ReactNode)\n error: React.ReactNode | ((error: Error) => React.ReactNode)\n duration?: number\n description?: React.ReactNode\n position?: ToastPosition\n id?: string\n icon?: React.ReactNode\n className?: string\n dismissible?: boolean\n closeButton?: boolean\n },\n ) => sonnerToast.promise(promise, opts),\n dismiss: (toastId: string | number) => sonnerToast.dismiss(toastId),\n custom: (render: (id: string | number) => React.ReactElement, options?: ToastOptions) =>\n sonnerToast.custom(render, options),\n },\n)\n\nexport { Toaster, toast }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAA,WAAA,EAAA,gBAAA,GAAA,WAAA,gBAAA,cAAA,OAAA,SAAA,MAAA,GAAA,YAAA;CAOE,OAAA,oBAAA,WAAA;EAEI,WAAA;EACA,OAAA;EACA,YAAA;EACQ;EACO;EACL;EACG;EACb,KAAA;EACA,QAAA;EACA,cAAA;GACE,UAAA;GACA,YAAA;IACE,OAAA;IAEA,MAAA;IACA,SAAA;IACA,OAAA,GAAA,mBAAA,EAAA,QAAA,SAAA,CAAA,GAAA,cAAA;IACA,aAAA,GAAA,mBAAA,GAAA,cAAA;IACA,QAAA;IACA,aAAA;IAEA,cAAA,GAAA,eAAA;KACmB,SAAA;KAAoB,MAAA;IAAW,CAAA,GAAA,6EAAA;IAGlD,cAAA,GAAA,eAAA;KACmB,SAAA;KAAkB,MAAA;IAAW,CAAA,GAAA,2FAAA;GAGlD;EACF;EACA,OAAA;GACE,SAAA,oBAAA,iBAAA,EAAA,MAAA,GAAA,CAAA;GACA,SAAA,oBAAA,aAAA,EAAA,MAAA,GAAA,CAAA;GACA,OAAA,oBAAA,aAAA,EAAA,MAAA,GAAA,CAAA;GACA,MAAA,oBAAA,UAAA,EAAA,MAAA,GAAA,CAAA;GACA,SAAA,oBAAA,OAAA;IACO,WAAA;IACH,UAAA,oBAAA,SAAA;KAAS,eAAA;KAAY,WAAA;IAAqB,CAAA;GACvC,CAAA;EAET;EACA,GAAA;CACD,CAAA;AAEL;AAEA,IAAA,QAAA,OAAA,QAAA,SAAA,YAAA,QAAA,SAAA;CAE2B,MAAA,oBAAA,yBAAA,EAAA,MAAA,GAAA,CAAA;CAA6C,GAAA;AAAW,CAAA,GAAA;CAE/E,OAAA,SAAA,YAAA,QAAA,KAAA,SAAA,OAAA;CACA,UAAA,SAAA,YAAA,QAAA,QAAA,SAAA,OAAA;CACA,QAAA,SAAA,YAAA,QAAA,MAAA,SAAA,OAAA;CACA,UAAA,SAAA,YAAA,QAAA,QAAA,SAAA,OAAA;CACA,UAAA,SAAA,YAAA,QAAA,QAAA,SAAA,OAAA;CACA,UAAA,SAAA,SAAA,QAAA,QAAA,SAAA,IAAA;CAgBA,UAAA,YAAA,QAAA,QAAA,OAAA;CACA,SAAA,QAAA,YAAA,QAAA,OAAA,QAAA,OAAA;AAEF,CAAA"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Toaster, toast };
|
|
1
|
+
export { Toaster, toast } from "./Toaster.js";
|
|
@@ -47,7 +47,7 @@ export type ButtonProps = {
|
|
|
47
47
|
*/
|
|
48
48
|
children?: React.ReactNode;
|
|
49
49
|
/**
|
|
50
|
-
* Custom props to pass to the icons (StartIcon, EndIcon
|
|
50
|
+
* Custom props to pass to the icons (StartIcon, EndIcon).
|
|
51
51
|
* Allows overriding size, weight, color, etc.
|
|
52
52
|
*/
|
|
53
53
|
iconProps?: Partial<IconProps>;
|
|
@@ -1,71 +1,92 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { typographyVariants } from "../../data-display/Typography/Typography.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Spinner } from "../../shared/Spinner.js";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import * as React$1 from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/inputs/Button/Button.tsx
|
|
8
8
|
var buttonVariants = cva(`
|
|
9
9
|
inline-flex h-(--control-height) items-center justify-center gap-2 rounded-lg px-(--control-px) font-medium
|
|
10
|
-
|
|
11
|
-
disabled:pointer-events-none
|
|
10
|
+
motion-hover
|
|
11
|
+
disabled:pointer-events-none
|
|
12
12
|
`, {
|
|
13
13
|
variants: {
|
|
14
14
|
/**
|
|
15
15
|
* Defines the visual style of the button
|
|
16
16
|
*/
|
|
17
17
|
variant: {
|
|
18
|
-
primary:
|
|
18
|
+
primary: `
|
|
19
|
+
bg-surface-brand-strong text-on-brand
|
|
20
|
+
hover:bg-surface-brand-strong-hovered
|
|
21
|
+
active:bg-surface-brand-strong-pressed
|
|
22
|
+
disabled:bg-surface-brand-strong-disabled disabled:text-tertiary
|
|
23
|
+
`,
|
|
19
24
|
secondary: `
|
|
20
|
-
bg-neutral-
|
|
21
|
-
hover:bg-neutral-
|
|
22
|
-
active:bg-neutral-
|
|
23
|
-
disabled:bg-neutral-
|
|
25
|
+
bg-surface-neutral-strong text-inverse
|
|
26
|
+
hover:bg-surface-neutral-strong-hovered
|
|
27
|
+
active:bg-surface-neutral-strong-pressed
|
|
28
|
+
disabled:bg-surface-neutral-strong-disabled disabled:text-tertiary
|
|
24
29
|
`,
|
|
25
30
|
ghost: `
|
|
26
|
-
border border-
|
|
27
|
-
hover:bg-neutral-
|
|
28
|
-
active:bg-neutral-
|
|
29
|
-
disabled:border-
|
|
31
|
+
border border-control text-primary
|
|
32
|
+
hover:bg-surface-neutral-subtle-hovered
|
|
33
|
+
active:bg-surface-neutral-subtle-pressed
|
|
34
|
+
disabled:border-disabled disabled:text-tertiary
|
|
30
35
|
`,
|
|
31
36
|
"inverse-ghost": `
|
|
32
|
-
border border-
|
|
33
|
-
hover:
|
|
34
|
-
active:bg-neutral-
|
|
35
|
-
disabled:border-
|
|
37
|
+
border border-inverse text-inverse
|
|
38
|
+
hover:bg-surface-neutral-strong-hovered
|
|
39
|
+
active:bg-surface-neutral-strong-pressed
|
|
40
|
+
disabled:border-disabled disabled:text-tertiary
|
|
41
|
+
`,
|
|
42
|
+
text: `
|
|
43
|
+
text-primary
|
|
44
|
+
hover:bg-surface-neutral-subtle-hovered
|
|
45
|
+
active:bg-surface-neutral-subtle-pressed
|
|
46
|
+
disabled:text-tertiary
|
|
47
|
+
`,
|
|
48
|
+
error: `
|
|
49
|
+
bg-surface-danger-strong text-on-strong
|
|
50
|
+
hover:bg-surface-danger-strong-hovered
|
|
51
|
+
active:bg-surface-danger-strong-pressed
|
|
52
|
+
disabled:bg-surface-danger-strong-disabled disabled:text-tertiary
|
|
36
53
|
`,
|
|
37
|
-
text: "text-primary-foreground hover:bg-neutral-50 active:bg-neutral-100 disabled:text-neutral-500",
|
|
38
|
-
error: "bg-error text-white hover:bg-error-800 active:bg-error-900 disabled:bg-error-200 disabled:text-neutral-600",
|
|
39
54
|
success: `
|
|
40
|
-
bg-success text-
|
|
41
|
-
hover:bg-success-
|
|
42
|
-
active:bg-success-
|
|
43
|
-
disabled:bg-success-
|
|
55
|
+
bg-surface-success-strong text-on-strong
|
|
56
|
+
hover:bg-surface-success-strong-hovered
|
|
57
|
+
active:bg-surface-success-strong-pressed
|
|
58
|
+
disabled:bg-surface-success-strong-disabled disabled:text-tertiary
|
|
44
59
|
`,
|
|
45
60
|
input: `
|
|
46
|
-
border border-
|
|
47
|
-
hover:bg-neutral-
|
|
48
|
-
focus-visible:border-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
border border-input bg-surface-primary text-primary
|
|
62
|
+
hover:bg-surface-neutral-subtle-hovered
|
|
63
|
+
focus-visible:border-focused focus-visible:outline-1 focus-visible:-outline-offset-2
|
|
64
|
+
focus-visible:outline-focused
|
|
65
|
+
focus-visible:hover:border-focused
|
|
66
|
+
active:bg-surface-neutral-subtle-pressed
|
|
67
|
+
enabled:hover:border-control
|
|
68
|
+
disabled:border-disabled disabled:bg-surface-disabled disabled:text-tertiary
|
|
69
|
+
aria-expanded:border-focused aria-expanded:outline-1 aria-expanded:-outline-offset-2
|
|
70
|
+
aria-expanded:outline-focused
|
|
71
|
+
aria-expanded:hover:border-focused
|
|
72
|
+
aria-invalid:border-danger aria-invalid:outline-1 aria-invalid:-outline-offset-2 aria-invalid:outline-danger
|
|
73
|
+
aria-invalid:hover:border-danger
|
|
74
|
+
aria-invalid:focus-visible:border-focused aria-invalid:focus-visible:outline-focused
|
|
54
75
|
`
|
|
55
76
|
},
|
|
56
77
|
/**
|
|
57
78
|
* Controls the size and padding of the button
|
|
58
79
|
*/
|
|
59
80
|
size: {
|
|
60
|
-
sm: "text-
|
|
61
|
-
md: "text-
|
|
62
|
-
lg: "text-
|
|
81
|
+
sm: "text-title-sm control-sm",
|
|
82
|
+
md: "text-title-md control-md",
|
|
83
|
+
lg: "text-title-md control-lg"
|
|
63
84
|
},
|
|
64
85
|
iconOnly: { true: "w-(--control-height) rounded-full p-0" }
|
|
65
86
|
},
|
|
66
87
|
compoundVariants: [{
|
|
67
88
|
variant: "input",
|
|
68
|
-
className: [typographyVariants({ variant: "body-lg" }), "px-(--control-inset) text-(length:--control-text) leading-(--control-leading)"]
|
|
89
|
+
className: [typographyVariants({ variant: "body-lg" }), "px-(--control-inset) text-(length:--control-text) leading-(--control-leading) tracking-(--control-tracking)"]
|
|
69
90
|
}],
|
|
70
91
|
defaultVariants: {
|
|
71
92
|
variant: "primary",
|
|
@@ -89,24 +110,9 @@ var buttonVariants = cva(`
|
|
|
89
110
|
* <Button loading>Processing...</Button>
|
|
90
111
|
*/
|
|
91
112
|
var Button = React$1.forwardRef(({ className, variant = "primary", size = "md", StartIcon, EndIcon, loading, iconOnly, iconProps = {}, ...props }, ref) => {
|
|
92
|
-
const
|
|
93
|
-
switch (size) {
|
|
94
|
-
case "sm": return {
|
|
95
|
-
size: 16,
|
|
96
|
-
weight: "regular"
|
|
97
|
-
};
|
|
98
|
-
case "lg": return {
|
|
99
|
-
size: 20,
|
|
100
|
-
weight: "regular"
|
|
101
|
-
};
|
|
102
|
-
default: return {
|
|
103
|
-
size: 18,
|
|
104
|
-
weight: "regular"
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
};
|
|
113
|
+
const iconClassName = iconProps.size === void 0 ? "icon-control shrink-0" : "shrink-0";
|
|
108
114
|
const mergedIconProps = {
|
|
109
|
-
|
|
115
|
+
weight: "regular",
|
|
110
116
|
...iconProps
|
|
111
117
|
};
|
|
112
118
|
return /* @__PURE__ */ jsxs("button", {
|
|
@@ -119,14 +125,13 @@ var Button = React$1.forwardRef(({ className, variant = "primary", size = "md",
|
|
|
119
125
|
disabled: loading,
|
|
120
126
|
...props,
|
|
121
127
|
children: [
|
|
122
|
-
loading && /* @__PURE__ */ jsx(
|
|
123
|
-
|
|
124
|
-
className: "animate-spin",
|
|
128
|
+
loading && /* @__PURE__ */ jsx(Spinner, {
|
|
129
|
+
className: "icon-control",
|
|
125
130
|
"aria-label": "Loading"
|
|
126
131
|
}),
|
|
127
132
|
StartIcon && !loading && /* @__PURE__ */ jsx(StartIcon, {
|
|
128
133
|
...mergedIconProps,
|
|
129
|
-
className:
|
|
134
|
+
className: iconClassName
|
|
130
135
|
}),
|
|
131
136
|
iconOnly ? /* @__PURE__ */ jsx("span", {
|
|
132
137
|
className: "sr-only",
|
|
@@ -134,13 +139,12 @@ var Button = React$1.forwardRef(({ className, variant = "primary", size = "md",
|
|
|
134
139
|
}) : props.children,
|
|
135
140
|
EndIcon && !iconOnly && /* @__PURE__ */ jsx(EndIcon, {
|
|
136
141
|
...mergedIconProps,
|
|
137
|
-
className:
|
|
142
|
+
className: iconClassName
|
|
138
143
|
})
|
|
139
144
|
]
|
|
140
145
|
});
|
|
141
146
|
});
|
|
142
147
|
Button.displayName = "Button";
|
|
143
|
-
//#endregion
|
|
144
148
|
export { Button, buttonVariants };
|
|
145
149
|
|
|
146
150
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["React"],"sources":["../../../../src/components/inputs/Button/Button.tsx"],"sourcesContent":["import type { Icon,
|
|
1
|
+
{"version":3,"file":"Button.js","names":["React"],"sources":["../../../../src/components/inputs/Button/Button.tsx"],"sourcesContent":["import type { Icon, IconProps } from '@phosphor-icons/react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../../lib/utils'\nimport { typographyVariants } from '../../data-display/Typography'\nimport { Spinner } from '../../shared'\n\nconst buttonVariants = cva(\n `\n inline-flex h-(--control-height) items-center justify-center gap-2 rounded-lg px-(--control-px) font-medium\n motion-hover\n disabled:pointer-events-none\n `,\n {\n variants: {\n /**\n * Defines the visual style of the button\n */\n variant: {\n primary: `\n bg-surface-brand-strong text-on-brand\n hover:bg-surface-brand-strong-hovered\n active:bg-surface-brand-strong-pressed\n disabled:bg-surface-brand-strong-disabled disabled:text-tertiary\n `,\n secondary: `\n bg-surface-neutral-strong text-inverse\n hover:bg-surface-neutral-strong-hovered\n active:bg-surface-neutral-strong-pressed\n disabled:bg-surface-neutral-strong-disabled disabled:text-tertiary\n `,\n ghost: `\n border border-control text-primary\n hover:bg-surface-neutral-subtle-hovered\n active:bg-surface-neutral-subtle-pressed\n disabled:border-disabled disabled:text-tertiary\n `,\n 'inverse-ghost': `\n border border-inverse text-inverse\n hover:bg-surface-neutral-strong-hovered\n active:bg-surface-neutral-strong-pressed\n disabled:border-disabled disabled:text-tertiary\n `,\n text: `\n text-primary\n hover:bg-surface-neutral-subtle-hovered\n active:bg-surface-neutral-subtle-pressed\n disabled:text-tertiary\n `,\n error: `\n bg-surface-danger-strong text-on-strong\n hover:bg-surface-danger-strong-hovered\n active:bg-surface-danger-strong-pressed\n disabled:bg-surface-danger-strong-disabled disabled:text-tertiary\n `,\n success: `\n bg-surface-success-strong text-on-strong\n hover:bg-surface-success-strong-hovered\n active:bg-surface-success-strong-pressed\n disabled:bg-surface-success-strong-disabled disabled:text-tertiary\n `,\n input: `\n border border-input bg-surface-primary text-primary\n hover:bg-surface-neutral-subtle-hovered\n focus-visible:border-focused focus-visible:outline-1 focus-visible:-outline-offset-2\n focus-visible:outline-focused\n focus-visible:hover:border-focused\n active:bg-surface-neutral-subtle-pressed\n enabled:hover:border-control\n disabled:border-disabled disabled:bg-surface-disabled disabled:text-tertiary\n aria-expanded:border-focused aria-expanded:outline-1 aria-expanded:-outline-offset-2\n aria-expanded:outline-focused\n aria-expanded:hover:border-focused\n aria-invalid:border-danger aria-invalid:outline-1 aria-invalid:-outline-offset-2 aria-invalid:outline-danger\n aria-invalid:hover:border-danger\n aria-invalid:focus-visible:border-focused aria-invalid:focus-visible:outline-focused\n `,\n },\n /**\n * Controls the size and padding of the button\n */\n size: {\n sm: 'text-title-sm control-sm',\n md: 'text-title-md control-md',\n lg: 'text-title-md control-lg',\n },\n iconOnly: {\n true: 'w-(--control-height) rounded-full p-0',\n },\n },\n compoundVariants: [\n {\n variant: 'input',\n className: [\n typographyVariants({ variant: 'body-lg' }),\n 'px-(--control-inset) text-(length:--control-text) leading-(--control-leading) tracking-(--control-tracking)',\n ],\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n)\n\nexport type ControlSize = 'sm' | 'md' | 'lg'\n\nexport type ButtonProps = {\n /**\n * The visual style of the button.\n * @default primary\n */\n variant?: 'primary' | 'secondary' | 'ghost' | 'inverse-ghost' | 'text' | 'error' | 'success' | 'input'\n\n /**\n * The size of the button, affecting height, padding, and font size.\n * @default md\n */\n size?: ControlSize\n\n /**\n * Icon component to display at the start of the button content.\n * Use Phosphor icons for consistent styling.\n * @example <Button StartIcon={House}>Home</Button>\n */\n StartIcon?: Icon\n\n /**\n * Icon component to display at the end of the button content.\n * Use Phosphor icons for consistent styling.\n * @example <Button EndIcon={ArrowRight}>Next</Button>\n */\n EndIcon?: Icon\n\n /**\n * When true, displays a loading spinner and disables the button.\n * The spinner replaces the StartIcon if present.\n * @default false\n */\n loading?: boolean\n\n /**\n * When true, creates a circular button with only the StartIcon visible.\n * @default false\n */\n iconOnly?: boolean\n\n /**\n * The content to display inside the button.\n * Not displayed when iconOnly is true.\n */\n children?: React.ReactNode\n\n /**\n * Custom props to pass to the icons (StartIcon, EndIcon).\n * Allows overriding size, weight, color, etc.\n */\n iconProps?: Partial<IconProps>\n} & React.ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants>\n\n/**\n * A versatile button component that supports multiple variants, sizes, and icon placements.\n *\n * @example\n * // Basic usage\n * <Button>Click me</Button>\n *\n * // With icon\n * <Button StartIcon={House}>Home</Button>\n *\n * // Icon only button\n * <Button StartIcon={Plus} iconOnly aria-label=\"Add item\" />\n *\n * // Loading state\n * <Button loading>Processing...</Button>\n */\nconst Button = React.forwardRef<HTMLButtonElement, Readonly<ButtonProps>>(\n (\n { className, variant = 'primary', size = 'md', StartIcon, EndIcon, loading, iconOnly, iconProps = {}, ...props },\n ref,\n ) => {\n const iconClassName = iconProps.size === undefined ? 'icon-control shrink-0' : 'shrink-0'\n const mergedIconProps: IconProps = { weight: 'regular', ...iconProps }\n return (\n <button\n className={cn(buttonVariants({ variant, size, iconOnly }), className)}\n ref={ref}\n disabled={loading}\n {...props}\n >\n {loading && <Spinner className=\"icon-control\" aria-label=\"Loading\" />}\n {StartIcon && !loading && <StartIcon {...mergedIconProps} className={iconClassName} />}\n {iconOnly ? <span className=\"sr-only\">{props.children}</span> : props.children}\n {EndIcon && !iconOnly && <EndIcon {...mergedIconProps} className={iconClassName} />}\n </button>\n )\n },\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;AAQA,IAAM,iBAAiB,IACrB;;;;KAKA;CACE,UAAU;;;;EAIR,SAAS;GACP,SAAS;;;;;;GAMT,WAAW;;;;;;GAMX,OAAO;;;;;;GAMP,iBAAiB;;;;;;GAMjB,MAAM;;;;;;GAMN,OAAO;;;;;;GAMP,SAAS;;;;;;GAMT,OAAO;;;;;;;;;;;;;;;;EAgBT;;;;EAIA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,UAAU,EACR,MAAM,wCACR;CACF;CACA,kBAAkB,CAChB;EACE,SAAS;EACT,WAAW,CACT,mBAAmB,EAAE,SAAS,UAAU,CAAC,GACzC,6GACF;CACF,CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;;;;;;;;;;;;;;;;;AA0EA,IAAM,SAASA,QAAM,YAEjB,EAAE,WAAW,UAAU,WAAW,OAAO,MAAM,WAAW,SAAS,SAAS,UAAU,YAAY,CAAC,GAAG,GAAG,SACzG,QACG;CACH,MAAM,gBAAgB,UAAU,SAAS,KAAA,IAAY,0BAA0B;CAC/E,MAAM,kBAA6B;EAAE,QAAQ;EAAW,GAAG;CAAU;CACrE,OACE,qBAAC,UAAD;EACE,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAS,CAAC,GAAG,SAAS;EAC/D;EACL,UAAU;EACV,GAAI;EAJN,UAAA;GAMG,WAAW,oBAAC,SAAD;IAAS,WAAU;IAAe,cAAW;GAAW,CAAA;GACnE,aAAa,CAAC,WAAW,oBAAC,WAAD;IAAW,GAAI;IAAiB,WAAW;GAAgB,CAAA;GACpF,WAAW,oBAAC,QAAD;IAAM,WAAU;IAAW,UAAA,MAAM;GAAe,CAAA,IAAI,MAAM;GACrE,WAAW,CAAC,YAAY,oBAAC,SAAD;IAAS,GAAI;IAAiB,WAAW;GAAgB,CAAA;EAC5E;;AAEZ,CACF;AACA,OAAO,cAAc"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Button, buttonVariants };
|
|
1
|
+
export { Button, buttonVariants } from "./Button.js";
|