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,7 +1,7 @@
|
|
|
1
1
|
import { Skeleton } from "../../../feedback/Skeleton/Skeleton.js";
|
|
2
2
|
import { Pagination } from "../../../navigation/Pagination/Pagination.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/data-display/DataTable/components/DataTablePagination.tsx
|
|
5
5
|
function DataTablePagination({ table, total, pageSize, currentPage, totalPages, onPageChange, isLoading, labels = {} }) {
|
|
6
6
|
const { showing = "Showing", of = "of", results = "results", previousPage = "", nextPage = "", pageLabel = "Page {number}" } = labels;
|
|
7
7
|
const isBackendPagination = !!onPageChange;
|
|
@@ -16,22 +16,22 @@ function DataTablePagination({ table, total, pageSize, currentPage, totalPages,
|
|
|
16
16
|
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-43.75 max-sm:hidden" }), /* @__PURE__ */ jsxs("div", {
|
|
17
17
|
className: "flex items-center gap-2",
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
20
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
21
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
22
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
23
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
19
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }),
|
|
20
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }),
|
|
21
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }),
|
|
22
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" }),
|
|
23
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "size-8" })
|
|
24
24
|
]
|
|
25
25
|
})]
|
|
26
26
|
});
|
|
27
27
|
return /* @__PURE__ */ jsxs("div", {
|
|
28
28
|
className: "flex w-full items-center justify-between gap-2 control-touch-40",
|
|
29
29
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
30
|
-
className: "text-
|
|
30
|
+
className: "text-body-md whitespace-nowrap text-secondary max-sm:hidden",
|
|
31
31
|
children: [
|
|
32
32
|
/* @__PURE__ */ jsx("span", { children: showing }),
|
|
33
33
|
/* @__PURE__ */ jsxs("span", {
|
|
34
|
-
className: "mx-1 font-medium text-
|
|
34
|
+
className: "mx-1 font-medium text-primary",
|
|
35
35
|
children: [
|
|
36
36
|
rangeStart,
|
|
37
37
|
"–",
|
|
@@ -40,7 +40,7 @@ function DataTablePagination({ table, total, pageSize, currentPage, totalPages,
|
|
|
40
40
|
}),
|
|
41
41
|
/* @__PURE__ */ jsx("span", { children: of }),
|
|
42
42
|
/* @__PURE__ */ jsx("span", {
|
|
43
|
-
className: "mx-1 font-medium text-
|
|
43
|
+
className: "mx-1 font-medium text-primary",
|
|
44
44
|
children: total
|
|
45
45
|
}),
|
|
46
46
|
/* @__PURE__ */ jsx("span", { children: results })
|
|
@@ -58,7 +58,6 @@ function DataTablePagination({ table, total, pageSize, currentPage, totalPages,
|
|
|
58
58
|
})]
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { DataTablePagination };
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=DataTablePagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTablePagination.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/DataTablePagination.tsx"],"sourcesContent":["import { Table } from '@tanstack/react-table'\n\nimport { Skeleton } from '../../../feedback/Skeleton'\nimport { Pagination } from '../../../navigation/Pagination'\nimport { BasePaginationProps } from '../types'\n\ntype DataTablePaginationProps<TData> = {\n table: Table<TData>\n total: number\n pageSize: number\n currentPage: number\n totalPages: number\n onPageChange?: (page: number) => void\n isLoading?: boolean\n labels: BasePaginationProps['labels']\n}\n\nexport function DataTablePagination<TData>({\n table,\n total,\n pageSize,\n currentPage,\n totalPages,\n onPageChange,\n isLoading,\n labels = {},\n}: Readonly<DataTablePaginationProps<TData>>) {\n const {\n showing = 'Showing',\n of = 'of',\n results = 'results',\n previousPage = '',\n nextPage = '',\n pageLabel = 'Page {number}',\n } = labels\n\n const isBackendPagination = !!onPageChange\n\n const rangeStart = total === 0 ? 0 : (currentPage - 1) * pageSize + 1\n const rangeEnd = Math.min(currentPage * pageSize, total)\n\n const handlePageChange = (newPage: number) => {\n if (isBackendPagination) {\n onPageChange(newPage)\n } else {\n table.setPageIndex(newPage - 1)\n }\n }\n\n if (isLoading) {\n return (\n <div className=\"flex w-full items-center justify-between control-touch-40\">\n <Skeleton className=\"h-5 w-43.75 max-sm:hidden\" />\n <div className=\"flex items-center gap-2\">\n <Skeleton className=\"
|
|
1
|
+
{"version":3,"file":"DataTablePagination.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/DataTablePagination.tsx"],"sourcesContent":["import { Table } from '@tanstack/react-table'\n\nimport { Skeleton } from '../../../feedback/Skeleton'\nimport { Pagination } from '../../../navigation/Pagination'\nimport { BasePaginationProps } from '../types'\n\ntype DataTablePaginationProps<TData> = {\n table: Table<TData>\n total: number\n pageSize: number\n currentPage: number\n totalPages: number\n onPageChange?: (page: number) => void\n isLoading?: boolean\n labels: BasePaginationProps['labels']\n}\n\nexport function DataTablePagination<TData>({\n table,\n total,\n pageSize,\n currentPage,\n totalPages,\n onPageChange,\n isLoading,\n labels = {},\n}: Readonly<DataTablePaginationProps<TData>>) {\n const {\n showing = 'Showing',\n of = 'of',\n results = 'results',\n previousPage = '',\n nextPage = '',\n pageLabel = 'Page {number}',\n } = labels\n\n const isBackendPagination = !!onPageChange\n\n const rangeStart = total === 0 ? 0 : (currentPage - 1) * pageSize + 1\n const rangeEnd = Math.min(currentPage * pageSize, total)\n\n const handlePageChange = (newPage: number) => {\n if (isBackendPagination) {\n onPageChange(newPage)\n } else {\n table.setPageIndex(newPage - 1)\n }\n }\n\n if (isLoading) {\n return (\n <div className=\"flex w-full items-center justify-between control-touch-40\">\n <Skeleton className=\"h-5 w-43.75 max-sm:hidden\" />\n <div className=\"flex items-center gap-2\">\n <Skeleton className=\"size-8\" />\n <Skeleton className=\"size-8\" />\n <Skeleton className=\"size-8\" />\n <Skeleton className=\"size-8\" />\n <Skeleton className=\"size-8\" />\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"flex w-full items-center justify-between gap-2 control-touch-40\">\n <div className=\"text-body-md whitespace-nowrap text-secondary max-sm:hidden\">\n <span>{showing}</span>\n <span className=\"mx-1 font-medium text-primary\">\n {rangeStart}–{rangeEnd}\n </span>\n <span>{of}</span>\n <span className=\"mx-1 font-medium text-primary\">{total}</span>\n <span>{results}</span>\n </div>\n\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n onPageChange={handlePageChange}\n mode=\"button\"\n labels={{\n previous: previousPage,\n next: nextPage,\n page: pageLabel,\n }}\n />\n </div>\n )\n}\n"],"mappings":";;;;AAiBA,SAAgB,oBAA2B,EACzC,OACA,OACA,UACA,aACA,YACA,cACA,WACA,SAAS,CAAC,KACkC;CAC5C,MAAM,EACJ,UAAU,WACV,KAAK,MACL,UAAU,WACV,eAAe,IACf,WAAW,IACX,YAAY,oBACV;CAEJ,MAAM,sBAAsB,CAAC,CAAC;CAE9B,MAAM,aAAa,UAAU,IAAI,KAAK,cAAc,KAAK,WAAW;CACpE,MAAM,WAAW,KAAK,IAAI,cAAc,UAAU,KAAK;CAEvD,MAAM,oBAAoB,YAAoB;EAC5C,IAAI,qBACF,aAAa,OAAO;OAEpB,MAAM,aAAa,UAAU,CAAC;CAElC;CAEA,IAAI,WACF,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,UAAD,EAAU,WAAU,4BAA6B,CAAA,GACjD,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,oBAAC,UAAD,EAAU,WAAU,SAAU,CAAA;IAC9B,oBAAC,UAAD,EAAU,WAAU,SAAU,CAAA;IAC9B,oBAAC,UAAD,EAAU,WAAU,SAAU,CAAA;IAC9B,oBAAC,UAAD,EAAU,WAAU,SAAU,CAAA;IAC9B,oBAAC,UAAD,EAAU,WAAU,SAAU,CAAA;GAC3B;EACF,CAAA,CAAA;;CAIT,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,oBAAC,QAAD,EAAA,UAAO,QAAc,CAAA;IACrB,qBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA;MACG;MAAW;MAAE;KACV;;IACN,oBAAC,QAAD,EAAA,UAAO,GAAS,CAAA;IAChB,oBAAC,QAAD;KAAM,WAAU;KAAiC,UAAA;IAAY,CAAA;IAC7D,oBAAC,QAAD,EAAA,UAAO,QAAc,CAAA;GAClB;EAEL,CAAA,GAAA,oBAAC,YAAD;GACe;GACD;GACZ,cAAc;GACd,MAAK;GACL,QAAQ;IACN,UAAU;IACV,MAAM;IACN,MAAM;GACR;EACD,CAAA,CACE;;AAET"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTableCheckbox } from "./DataTableCheckbox.js";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/data-display/DataTable/components/DataTableSelectCells.tsx
|
|
5
5
|
var DataTableSelectionContext = createContext(null);
|
|
6
6
|
function useDataTableSelection() {
|
|
7
7
|
const value = useContext(DataTableSelectionContext);
|
|
@@ -31,7 +31,6 @@ function GroupSelectCell({ row }) {
|
|
|
31
31
|
...group
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { DataTableSelectionContext, GroupSelectCell, SelectColumnCell, SelectColumnHeader };
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=DataTableSelectCells.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Typography } from "../../Typography/Typography.js";
|
|
2
|
-
import { PopoverContent, PopoverRoot, PopoverTrigger } from "../../Popover/Popover.js";
|
|
3
|
-
import { TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from "../../Tooltip/Tooltip.js";
|
|
4
|
-
import { useIsMobile } from "../../../../lib/useMobile.js";
|
|
5
1
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../navigation/DropdownMenu/DropdownMenu.js";
|
|
6
2
|
import { NotificationBadge } from "../../NotificationBadge/NotificationBadge.js";
|
|
3
|
+
import { PopoverContent, PopoverRoot, PopoverTrigger } from "../../Popover/Popover.js";
|
|
4
|
+
import { Typography } from "../../Typography/Typography.js";
|
|
7
5
|
import { DataTableToolbarButton } from "./DataTableToolbarButton.js";
|
|
6
|
+
import { TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from "../../Tooltip/Tooltip.js";
|
|
7
|
+
import { useIsMobile } from "../../../../lib/useMobile.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { XIcon } from "@phosphor-icons/react/dist/ssr/X";
|
|
11
11
|
import { FunnelSimpleIcon } from "@phosphor-icons/react/dist/ssr/FunnelSimple";
|
|
12
12
|
import { SelectionAllIcon } from "@phosphor-icons/react/dist/ssr/SelectionAll";
|
|
13
13
|
import { TableIcon } from "@phosphor-icons/react/dist/ssr/Table";
|
|
14
|
-
|
|
14
|
+
// src/components/data-display/DataTable/components/DataTableToolbar.tsx
|
|
15
15
|
var defaultLabels = {
|
|
16
16
|
filters: "Filters",
|
|
17
17
|
moreFilters: "More filters"
|
|
@@ -48,7 +48,7 @@ function DataTableToolbar({ table, columnVisibility, primaryFilters, secondaryFi
|
|
|
48
48
|
const filtersButtonLabel = !hasPrimaryFilters || isMobile ? labels.filters : labels.moreFilters;
|
|
49
49
|
if (!showColumnVisibilityControls && !primaryFilters && !secondaryFilters && !selection && !toolbarActions) return null;
|
|
50
50
|
return /* @__PURE__ */ jsxs("div", {
|
|
51
|
-
className: "flex shrink-0 flex-col gap-2
|
|
51
|
+
className: "flex shrink-0 flex-col gap-2",
|
|
52
52
|
children: [!isMobile && primaryFilters && /* @__PURE__ */ jsx("div", {
|
|
53
53
|
className: "flex flex-wrap items-center gap-2",
|
|
54
54
|
children: primaryFilters
|
|
@@ -64,7 +64,7 @@ function DataTableToolbar({ table, columnVisibility, primaryFilters, secondaryFi
|
|
|
64
64
|
children: selectionLabels.cancelSelection
|
|
65
65
|
}), selection.selectionSummary && !isMobile && /* @__PURE__ */ jsx(Typography, {
|
|
66
66
|
variant: "body-sm",
|
|
67
|
-
className: "text-
|
|
67
|
+
className: "text-secondary",
|
|
68
68
|
children: selection.selectionSummary
|
|
69
69
|
})] }) : /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(TooltipRoot, {
|
|
70
70
|
delayDuration: 200,
|
|
@@ -123,7 +123,7 @@ function DataTableToolbar({ table, columnVisibility, primaryFilters, secondaryFi
|
|
|
123
123
|
onCheckedChange: (value) => table.getAllColumns().filter((column) => column.getCanHide()).forEach((column) => column.toggleVisibility(!!value)),
|
|
124
124
|
children: columnVisibilityLabels.selectAll
|
|
125
125
|
}, "all-columns"),
|
|
126
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "bg-
|
|
126
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "bg-surface-tertiary" }),
|
|
127
127
|
table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
|
|
128
128
|
return /* @__PURE__ */ jsx(DropdownMenuCheckboxItem, {
|
|
129
129
|
className: "capitalize",
|
|
@@ -141,7 +141,6 @@ function DataTableToolbar({ table, columnVisibility, primaryFilters, secondaryFi
|
|
|
141
141
|
})]
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
//#endregion
|
|
145
144
|
export { DataTableToolbar };
|
|
146
145
|
|
|
147
146
|
//# sourceMappingURL=DataTableToolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableToolbar.js","names":["_Fragment"],"sources":["../../../../../src/components/data-display/DataTable/components/DataTableToolbar.tsx"],"sourcesContent":["import { FunnelSimpleIcon } from '@phosphor-icons/react/dist/ssr/FunnelSimple'\nimport { SelectionAllIcon } from '@phosphor-icons/react/dist/ssr/SelectionAll'\nimport { TableIcon } from '@phosphor-icons/react/dist/ssr/Table'\nimport { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport { Table } from '@tanstack/react-table'\nimport * as React from 'react'\n\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../../../navigation/DropdownMenu'\nimport { NotificationBadge } from '../../NotificationBadge'\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from '../../Popover'\nimport { Typography } from '../../Typography'\nimport { ColumnVisibilityConfig } from '../types'\n\nimport { DataTableToolbarButton } from './DataTableToolbarButton'\n\nimport { TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from '@/components/data-display/Tooltip'\nimport { useIsMobile } from '@/lib/useMobile'\n\ntype DataTableToolbarProps<TData> = {\n table: Table<TData>\n columnVisibility?: ColumnVisibilityConfig\n primaryFilters?: React.ReactNode\n secondaryFilters?: React.ReactNode\n toolbarActions?: React.ReactNode\n activePrimaryFiltersCount?: number\n activeSecondaryFiltersCount?: number\n labels?: {\n filters?: string\n moreFilters?: string\n }\n selection?: {\n isSelectionStarted?: boolean\n onSelectionStart?: () => void\n onSelectionCancel?: () => void\n selectionSummary?: string | null\n isSelectionDisabled?: boolean\n labels?: {\n startSelection?: string\n cancelSelection?: string\n selectionSummary?: string\n selectionDisabledTooltip?: string\n }\n }\n}\n\nconst defaultLabels = {\n filters: 'Filters',\n moreFilters: 'More filters',\n}\n\nconst defaultColumnVisibilityLabels = {\n button: 'Columns',\n selectAll: 'Select all',\n}\n\nconst defaultSelectionLabels = {\n startSelection: 'Start selection',\n cancelSelection: 'Cancel selection',\n}\n\nexport function DataTableToolbar<TData>({\n table,\n columnVisibility,\n primaryFilters,\n secondaryFilters,\n toolbarActions,\n activePrimaryFiltersCount = 0,\n activeSecondaryFiltersCount = 0,\n selection,\n labels: labelsProp,\n}: Readonly<DataTableToolbarProps<TData>>) {\n const isMobile = useIsMobile()\n\n const labels = {\n ...defaultLabels,\n ...labelsProp,\n }\n\n const columnVisibilityLabels = {\n ...defaultColumnVisibilityLabels,\n ...columnVisibility?.labels,\n }\n\n const selectionLabels = {\n ...defaultSelectionLabels,\n ...selection?.labels,\n }\n\n const showColumnVisibilityControls = columnVisibility?.showControls ?? true\n\n const hasPrimaryFilters = !!primaryFilters\n const hasSecondaryFilters = !!secondaryFilters\n\n const showFiltersButton = isMobile ? hasPrimaryFilters || hasSecondaryFilters : hasSecondaryFilters\n\n const totalActiveFiltersCount = activePrimaryFiltersCount + activeSecondaryFiltersCount\n const activeFiltersCount = isMobile ? totalActiveFiltersCount : activeSecondaryFiltersCount\n const showBadge = activeFiltersCount > 0\n\n const filtersButtonLabel = !hasPrimaryFilters || isMobile ? labels.filters : labels.moreFilters\n\n if (!showColumnVisibilityControls && !primaryFilters && !secondaryFilters && !selection && !toolbarActions) {\n return null\n }\n\n return (\n <div className=\"flex shrink-0 flex-col gap-2 p-1\">\n {!isMobile && primaryFilters && <div className=\"flex flex-wrap items-center gap-2\">{primaryFilters}</div>}\n\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n {selection && (\n <div className=\"flex items-center gap-2\">\n {selection.isSelectionStarted ? (\n <>\n <DataTableToolbarButton StartIcon={XIcon} onClick={selection.onSelectionCancel}>\n {selectionLabels.cancelSelection}\n </DataTableToolbarButton>\n {selection.selectionSummary && !isMobile && (\n <Typography variant=\"body-sm\" className=\"text-neutral-700\">\n {selection.selectionSummary}\n </Typography>\n )}\n </>\n ) : (\n <TooltipProvider>\n <TooltipRoot delayDuration={200}>\n <TooltipTrigger asChild>\n <div>\n <DataTableToolbarButton\n StartIcon={SelectionAllIcon}\n onClick={selection.onSelectionStart}\n disabled={selection.isSelectionDisabled}\n >\n {selectionLabels.startSelection}\n </DataTableToolbarButton>\n </div>\n </TooltipTrigger>\n {selection.labels?.selectionDisabledTooltip && selection.isSelectionDisabled && (\n <TooltipContent>{selection.labels.selectionDisabledTooltip}</TooltipContent>\n )}\n </TooltipRoot>\n </TooltipProvider>\n )}\n </div>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {showFiltersButton && (\n <PopoverRoot>\n <span className=\"relative inline-flex\">\n <PopoverTrigger asChild>\n <DataTableToolbarButton StartIcon={FunnelSimpleIcon}>{filtersButtonLabel}</DataTableToolbarButton>\n </PopoverTrigger>\n {showBadge && (\n <NotificationBadge\n count={activeFiltersCount}\n color=\"primary\"\n ping={false}\n className=\"pointer-events-none absolute -top-1 -right-1\"\n />\n )}\n </span>\n <PopoverContent\n align=\"center\"\n collisionPadding={12}\n className={\n isMobile ? 'max-h-[80vh] w-[calc(100vw-1.5rem)] scrollbar-subtle overflow-y-auto p-4' : 'w-fit p-4'\n }\n >\n <div className=\"flex flex-col gap-4\">\n {isMobile && primaryFilters}\n {secondaryFilters}\n </div>\n </PopoverContent>\n </PopoverRoot>\n )}\n {showColumnVisibilityControls && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <DataTableToolbarButton StartIcon={TableIcon}>{columnVisibilityLabels.button}</DataTableToolbarButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"end\"\n collisionPadding={12}\n className=\"max-h-(--radix-dropdown-menu-content-available-height) scrollbar-subtle overflow-y-auto\"\n >\n <DropdownMenuCheckboxItem\n key={'all-columns'}\n className=\"capitalize\"\n checked={table\n .getAllColumns()\n .filter((column) => column.getCanHide())\n .every((column) => column.getIsVisible())}\n onSelect={(event) => event.preventDefault()}\n onCheckedChange={(value) =>\n table\n .getAllColumns()\n .filter((column) => column.getCanHide())\n .forEach((column) => column.toggleVisibility(!!value))\n }\n >\n {columnVisibilityLabels.selectAll}\n </DropdownMenuCheckboxItem>\n <DropdownMenuSeparator className=\"bg-neutral-100\" />\n {table\n .getAllColumns()\n .filter((column) => column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onSelect={(event) => event.preventDefault()}\n onCheckedChange={(value) => column.toggleVisibility(!!value)}\n >\n {column.columnDef.header?.toString()}\n </DropdownMenuCheckboxItem>\n )\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {toolbarActions}\n </div>\n </div>\n </div>\n )\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"DataTableToolbar.js","names":["_Fragment"],"sources":["../../../../../src/components/data-display/DataTable/components/DataTableToolbar.tsx"],"sourcesContent":["import { FunnelSimpleIcon } from '@phosphor-icons/react/dist/ssr/FunnelSimple'\nimport { SelectionAllIcon } from '@phosphor-icons/react/dist/ssr/SelectionAll'\nimport { TableIcon } from '@phosphor-icons/react/dist/ssr/Table'\nimport { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport { Table } from '@tanstack/react-table'\nimport * as React from 'react'\n\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../../../navigation/DropdownMenu'\nimport { NotificationBadge } from '../../NotificationBadge'\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from '../../Popover'\nimport { Typography } from '../../Typography'\nimport { ColumnVisibilityConfig } from '../types'\n\nimport { DataTableToolbarButton } from './DataTableToolbarButton'\n\nimport { TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from '@/components/data-display/Tooltip'\nimport { useIsMobile } from '@/lib/useMobile'\n\ntype DataTableToolbarProps<TData> = {\n table: Table<TData>\n columnVisibility?: ColumnVisibilityConfig\n primaryFilters?: React.ReactNode\n secondaryFilters?: React.ReactNode\n toolbarActions?: React.ReactNode\n activePrimaryFiltersCount?: number\n activeSecondaryFiltersCount?: number\n labels?: {\n filters?: string\n moreFilters?: string\n }\n selection?: {\n isSelectionStarted?: boolean\n onSelectionStart?: () => void\n onSelectionCancel?: () => void\n selectionSummary?: string | null\n isSelectionDisabled?: boolean\n labels?: {\n startSelection?: string\n cancelSelection?: string\n selectionSummary?: string\n selectionDisabledTooltip?: string\n }\n }\n}\n\nconst defaultLabels = {\n filters: 'Filters',\n moreFilters: 'More filters',\n}\n\nconst defaultColumnVisibilityLabels = {\n button: 'Columns',\n selectAll: 'Select all',\n}\n\nconst defaultSelectionLabels = {\n startSelection: 'Start selection',\n cancelSelection: 'Cancel selection',\n}\n\nexport function DataTableToolbar<TData>({\n table,\n columnVisibility,\n primaryFilters,\n secondaryFilters,\n toolbarActions,\n activePrimaryFiltersCount = 0,\n activeSecondaryFiltersCount = 0,\n selection,\n labels: labelsProp,\n}: Readonly<DataTableToolbarProps<TData>>) {\n const isMobile = useIsMobile()\n\n const labels = {\n ...defaultLabels,\n ...labelsProp,\n }\n\n const columnVisibilityLabels = {\n ...defaultColumnVisibilityLabels,\n ...columnVisibility?.labels,\n }\n\n const selectionLabels = {\n ...defaultSelectionLabels,\n ...selection?.labels,\n }\n\n const showColumnVisibilityControls = columnVisibility?.showControls ?? true\n\n const hasPrimaryFilters = !!primaryFilters\n const hasSecondaryFilters = !!secondaryFilters\n\n const showFiltersButton = isMobile ? hasPrimaryFilters || hasSecondaryFilters : hasSecondaryFilters\n\n const totalActiveFiltersCount = activePrimaryFiltersCount + activeSecondaryFiltersCount\n const activeFiltersCount = isMobile ? totalActiveFiltersCount : activeSecondaryFiltersCount\n const showBadge = activeFiltersCount > 0\n\n const filtersButtonLabel = !hasPrimaryFilters || isMobile ? labels.filters : labels.moreFilters\n\n if (!showColumnVisibilityControls && !primaryFilters && !secondaryFilters && !selection && !toolbarActions) {\n return null\n }\n\n return (\n <div className=\"flex shrink-0 flex-col gap-2\">\n {!isMobile && primaryFilters && <div className=\"flex flex-wrap items-center gap-2\">{primaryFilters}</div>}\n\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n {selection && (\n <div className=\"flex items-center gap-2\">\n {selection.isSelectionStarted ? (\n <>\n <DataTableToolbarButton StartIcon={XIcon} onClick={selection.onSelectionCancel}>\n {selectionLabels.cancelSelection}\n </DataTableToolbarButton>\n {selection.selectionSummary && !isMobile && (\n <Typography variant=\"body-sm\" className=\"text-secondary\">\n {selection.selectionSummary}\n </Typography>\n )}\n </>\n ) : (\n <TooltipProvider>\n <TooltipRoot delayDuration={200}>\n <TooltipTrigger asChild>\n <div>\n <DataTableToolbarButton\n StartIcon={SelectionAllIcon}\n onClick={selection.onSelectionStart}\n disabled={selection.isSelectionDisabled}\n >\n {selectionLabels.startSelection}\n </DataTableToolbarButton>\n </div>\n </TooltipTrigger>\n {selection.labels?.selectionDisabledTooltip && selection.isSelectionDisabled && (\n <TooltipContent>{selection.labels.selectionDisabledTooltip}</TooltipContent>\n )}\n </TooltipRoot>\n </TooltipProvider>\n )}\n </div>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {showFiltersButton && (\n <PopoverRoot>\n <span className=\"relative inline-flex\">\n <PopoverTrigger asChild>\n <DataTableToolbarButton StartIcon={FunnelSimpleIcon}>{filtersButtonLabel}</DataTableToolbarButton>\n </PopoverTrigger>\n {showBadge && (\n <NotificationBadge\n count={activeFiltersCount}\n color=\"primary\"\n ping={false}\n className=\"pointer-events-none absolute -top-1 -right-1\"\n />\n )}\n </span>\n <PopoverContent\n align=\"center\"\n collisionPadding={12}\n className={\n isMobile ? 'max-h-[80vh] w-[calc(100vw-1.5rem)] scrollbar-subtle overflow-y-auto p-4' : 'w-fit p-4'\n }\n >\n <div className=\"flex flex-col gap-4\">\n {isMobile && primaryFilters}\n {secondaryFilters}\n </div>\n </PopoverContent>\n </PopoverRoot>\n )}\n {showColumnVisibilityControls && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <DataTableToolbarButton StartIcon={TableIcon}>{columnVisibilityLabels.button}</DataTableToolbarButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"end\"\n collisionPadding={12}\n className=\"max-h-(--radix-dropdown-menu-content-available-height) scrollbar-subtle overflow-y-auto\"\n >\n <DropdownMenuCheckboxItem\n key={'all-columns'}\n className=\"capitalize\"\n checked={table\n .getAllColumns()\n .filter((column) => column.getCanHide())\n .every((column) => column.getIsVisible())}\n onSelect={(event) => event.preventDefault()}\n onCheckedChange={(value) =>\n table\n .getAllColumns()\n .filter((column) => column.getCanHide())\n .forEach((column) => column.toggleVisibility(!!value))\n }\n >\n {columnVisibilityLabels.selectAll}\n </DropdownMenuCheckboxItem>\n <DropdownMenuSeparator className=\"bg-surface-tertiary\" />\n {table\n .getAllColumns()\n .filter((column) => column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onSelect={(event) => event.preventDefault()}\n onCheckedChange={(value) => column.toggleVisibility(!!value)}\n >\n {column.columnDef.header?.toString()}\n </DropdownMenuCheckboxItem>\n )\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {toolbarActions}\n </div>\n </div>\n </div>\n )\n}\n"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { cn } from "../../../../lib/utils.js";
|
|
2
1
|
import { Button } from "../../../inputs/Button/Button.js";
|
|
2
|
+
import { cn } from "../../../../lib/utils.js";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/data-display/DataTable/components/DataTableToolbarButton.tsx
|
|
6
6
|
/**
|
|
7
7
|
* A toolbar button: ghost, 40px high with its label on desktop, a 48x48 icon-only button below `md` (the label stays
|
|
8
8
|
* for screen readers, so pass `StartIcon`). Use it for the buttons you add with `toolbarActions`.
|
|
@@ -19,7 +19,6 @@ var DataTableToolbarButton = React$1.forwardRef(({ className, children, ...props
|
|
|
19
19
|
})
|
|
20
20
|
}));
|
|
21
21
|
DataTableToolbarButton.displayName = "DataTableToolbarButton";
|
|
22
|
-
//#endregion
|
|
23
22
|
export { DataTableToolbarButton };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=DataTableToolbarButton.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cn } from "../../../../lib/utils.js";
|
|
2
1
|
import { typographyVariants } from "../../Typography/Typography.js";
|
|
3
|
-
|
|
2
|
+
import { cn } from "../../../../lib/utils.js";
|
|
3
|
+
// src/components/data-display/DataTable/components/dataTableCellStyles.ts
|
|
4
4
|
var SELECT_COLUMN_ID = "select";
|
|
5
5
|
var ACTIONS_COLUMN_ID = "actions";
|
|
6
6
|
var getColumnWidth = (columnId, size) => columnId === "actions" ? 1 : size;
|
|
@@ -12,7 +12,7 @@ var getStickyColumnClassName = (columnId) => {
|
|
|
12
12
|
var ACTIONS_CELL_ATTRIBUTE = "data-actions-cell";
|
|
13
13
|
var NO_ROW_CLICK_ATTRIBUTE = "data-no-row-click";
|
|
14
14
|
function getDataTableCellClassName(columnId, kind) {
|
|
15
|
-
const cell = kind === "header" ? "box-border flex h-11.25 items-center border-b border-(--row-border,var(--
|
|
15
|
+
const cell = kind === "header" ? "box-border flex h-11.25 items-center border-b border-(--row-border,var(--ds-border-subtle)) px-4 whitespace-nowrap" : "box-border flex h-12 items-center border-t border-(--row-border,var(--ds-border-subtle)) px-4 whitespace-nowrap in-[tbody>tr:first-child]:border-t-0";
|
|
16
16
|
if (columnId === "select") return cell;
|
|
17
17
|
if (columnId === "actions") return `${cell} justify-end`;
|
|
18
18
|
return cn(cell, typographyVariants({
|
|
@@ -20,7 +20,6 @@ function getDataTableCellClassName(columnId, kind) {
|
|
|
20
20
|
weight: kind === "header" ? "semibold" : "regular"
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { ACTIONS_CELL_ATTRIBUTE, ACTIONS_COLUMN_ID, NO_ROW_CLICK_ATTRIBUTE, SELECT_COLUMN_ID, getColumnWidth, getDataTableCellClassName, getStickyColumnClassName };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=dataTableCellStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataTableCellStyles.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/dataTableCellStyles.ts"],"sourcesContent":["import { typographyVariants } from '../../Typography'\n\nimport { cn } from '@/lib/utils'\n\nexport const SELECT_COLUMN_ID = 'select'\nexport const ACTIONS_COLUMN_ID = 'actions'\n\nexport const getColumnWidth = (columnId: string, size?: number) => (columnId === ACTIONS_COLUMN_ID ? 1 : size)\n\nexport const getStickyColumnClassName = (columnId: string) => {\n if (columnId === ACTIONS_COLUMN_ID) return 'sticky-column-end'\n if (columnId === SELECT_COLUMN_ID) return 'sticky-column-start'\n return ''\n}\n\nexport const ACTIONS_CELL_ATTRIBUTE = 'data-actions-cell'\nexport const NO_ROW_CLICK_ATTRIBUTE = 'data-no-row-click'\n\nexport function getDataTableCellClassName(columnId: string, kind: 'header' | 'body') {\n const cell =\n kind === 'header'\n ? 'box-border flex h-11.25 items-center border-b border-(--row-border,var(--
|
|
1
|
+
{"version":3,"file":"dataTableCellStyles.js","names":[],"sources":["../../../../../src/components/data-display/DataTable/components/dataTableCellStyles.ts"],"sourcesContent":["import { typographyVariants } from '../../Typography'\n\nimport { cn } from '@/lib/utils'\n\nexport const SELECT_COLUMN_ID = 'select'\nexport const ACTIONS_COLUMN_ID = 'actions'\n\nexport const getColumnWidth = (columnId: string, size?: number) => (columnId === ACTIONS_COLUMN_ID ? 1 : size)\n\nexport const getStickyColumnClassName = (columnId: string) => {\n if (columnId === ACTIONS_COLUMN_ID) return 'sticky-column-end'\n if (columnId === SELECT_COLUMN_ID) return 'sticky-column-start'\n return ''\n}\n\nexport const ACTIONS_CELL_ATTRIBUTE = 'data-actions-cell'\nexport const NO_ROW_CLICK_ATTRIBUTE = 'data-no-row-click'\n\nexport function getDataTableCellClassName(columnId: string, kind: 'header' | 'body') {\n const cell =\n kind === 'header'\n ? 'box-border flex h-11.25 items-center border-b border-(--row-border,var(--ds-border-subtle)) px-4 whitespace-nowrap'\n : 'box-border flex h-12 items-center border-t border-(--row-border,var(--ds-border-subtle)) px-4 whitespace-nowrap in-[tbody>tr:first-child]:border-t-0'\n if (columnId === SELECT_COLUMN_ID) return cell\n if (columnId === ACTIONS_COLUMN_ID) return `${cell} justify-end`\n return cn(cell, typographyVariants({ variant: 'body-md', weight: kind === 'header' ? 'semibold' : 'regular' }))\n}\n"],"mappings":";;;AAIA,IAAa,mBAAmB;AAChC,IAAa,oBAAoB;AAEjC,IAAa,kBAAkB,UAAkB,SAAmB,aAAA,YAAiC,IAAI;AAEzG,IAAa,4BAA4B,aAAqB;CAC5D,IAAI,aAAA,WAAgC,OAAO;CAC3C,IAAI,aAAA,UAA+B,OAAO;CAC1C,OAAO;AACT;AAEA,IAAa,yBAAyB;AACtC,IAAa,yBAAyB;AAEtC,SAAgB,0BAA0B,UAAkB,MAAyB;CACnF,MAAM,OACJ,SAAS,WACL,uHACA;CACN,IAAI,aAAA,UAA+B,OAAO;CAC1C,IAAI,aAAA,WAAgC,OAAO,GAAG,KAAK;CACnD,OAAO,GAAG,MAAM,mBAAmB;EAAE,SAAS;EAAW,QAAQ,SAAS,WAAW,aAAa;CAAU,CAAC,CAAC;AAChH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Badge } from "../Badge/Badge.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/data-display/DataTable/data.tsx
|
|
4
4
|
var STATUS_COLORS = {
|
|
5
5
|
active: "success",
|
|
6
6
|
pending: "warning",
|
|
@@ -474,7 +474,6 @@ var users = [
|
|
|
474
474
|
status: "active"
|
|
475
475
|
}
|
|
476
476
|
];
|
|
477
|
-
//#endregion
|
|
478
477
|
export { userColumns, userExtendedColumns, users, usersExtended };
|
|
479
478
|
|
|
480
479
|
//# sourceMappingURL=data.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/data-display/DataTable/hooks/useGroupExpansion.ts
|
|
3
3
|
/**
|
|
4
4
|
* Encapsulates the expanded-state bookkeeping for grouped tables: tracks which
|
|
5
5
|
* groups are open (supporting both controlled and uncontrolled modes) and
|
|
@@ -27,7 +27,6 @@ function useGroupExpansion({ grouping, data, getRowId }) {
|
|
|
27
27
|
}, [setExpandedState, groupIds])
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { useGroupExpansion };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=useGroupExpansion.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SELECT_COLUMN_ID } from "../components/dataTableCellStyles.js";
|
|
2
2
|
import { GroupSelectCell, SelectColumnCell, SelectColumnHeader } from "../components/DataTableSelectCells.js";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
-
|
|
4
|
+
// src/components/data-display/DataTable/hooks/useSelectColumn.tsx
|
|
5
5
|
function useSelectColumn({ selection, selectedIds, selectionData, getRowId, handleRowSelect, handleSelectAll, isBackendPagination, isLoading }) {
|
|
6
6
|
const contextValue = useMemo(() => ({
|
|
7
7
|
header: {
|
|
@@ -50,7 +50,6 @@ function useSelectColumn({ selection, selectedIds, selectionData, getRowId, hand
|
|
|
50
50
|
contextValue
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { useSelectColumn };
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=useSelectColumn.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/data-display/DataTable/hooks/useSelection.ts
|
|
3
3
|
function useSelection({ data, getRowId, selection }) {
|
|
4
4
|
return {
|
|
5
5
|
selectedIds: useMemo(() => {
|
|
@@ -27,7 +27,6 @@ function useSelection({ data, getRowId, selection }) {
|
|
|
27
27
|
}, [selection])
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { useSelection };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=useSelection.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/data-display/DataTable/hooks/useSorting.ts
|
|
3
3
|
function useSorting(sorting) {
|
|
4
4
|
const isBackendSorting = sorting !== void 0 && "onSortChange" in sorting;
|
|
5
5
|
const [clientSort, setClientSort] = React$1.useState(sorting ?? {});
|
|
@@ -26,7 +26,6 @@ function useSorting(sorting) {
|
|
|
26
26
|
toggleSort
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { useSorting };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=useSorting.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/data-display/DataTable/utils.ts
|
|
2
2
|
/**
|
|
3
3
|
* Recursively flattens a sub-row tree into its leaf items, discarding group
|
|
4
4
|
* nodes. Used so selection (counts, select-all, ids) operates over the actual
|
|
@@ -13,7 +13,6 @@ function flattenLeaves(data, getSubRows) {
|
|
|
13
13
|
}
|
|
14
14
|
return leaves;
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { flattenLeaves };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.js";
|
|
2
1
|
import { getCachedFlagSvg, hasFlagSvg, loadFlagSvg } from "../../../lib/flagSvg.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
|
-
|
|
7
|
-
var flagVariants = cva("inline-flex shrink-0 items-center justify-center border border-
|
|
6
|
+
// src/components/data-display/Flag/Flag.tsx
|
|
7
|
+
var flagVariants = cva("inline-flex shrink-0 items-center justify-center border border-disabled", {
|
|
8
8
|
variants: { size: {
|
|
9
9
|
sm: "h-3.5 w-4.5 rounded-sm",
|
|
10
10
|
md: "h-4.25 w-5.5 rounded-[5px]",
|
|
@@ -71,7 +71,6 @@ var Flag = React$1.forwardRef(({ iso, size = "md", className, ...props }, ref) =
|
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
Flag.displayName = "Flag";
|
|
74
|
-
//#endregion
|
|
75
74
|
export { Flag, flagVariants };
|
|
76
75
|
|
|
77
76
|
//# sourceMappingURL=Flag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flag.js","names":["React"],"sources":["../../../../src/components/data-display/Flag/Flag.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { getCachedFlagSvg, hasFlagSvg, loadFlagSvg } from '@/lib/flagSvg'\nimport { cn } from '@/lib/utils'\n\nconst flagVariants = cva('inline-flex shrink-0 items-center justify-center border border-
|
|
1
|
+
{"version":3,"file":"Flag.js","names":["React"],"sources":["../../../../src/components/data-display/Flag/Flag.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { getCachedFlagSvg, hasFlagSvg, loadFlagSvg } from '@/lib/flagSvg'\nimport { cn } from '@/lib/utils'\n\nconst flagVariants = cva('inline-flex shrink-0 items-center justify-center border border-disabled', {\n variants: {\n size: {\n sm: 'h-3.5 w-4.5 rounded-sm',\n md: 'h-4.25 w-5.5 rounded-[5px]',\n lg: 'h-5 w-6.5 rounded-md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n})\n\nfunction FlagSvg({ markup }: Readonly<{ markup: string }>) {\n const ref = React.useRef<HTMLSpanElement>(null)\n\n React.useLayoutEffect(() => {\n const svg = ref.current?.firstElementChild\n if (!(svg instanceof SVGElement)) return\n\n svg.setAttribute('aria-hidden', 'true')\n svg.setAttribute('preserveAspectRatio', 'xMidYMid slice')\n svg.setAttribute('class', 'block rounded-[inherit] object-cover')\n // Inline wins over an ancestor's `[&_svg]:size-4`-style reset; a class wouldn't.\n svg.style.width = '100%'\n svg.style.height = '100%'\n }, [markup])\n\n // `markup` is always our own vendored SVG, never user input.\n return <span ref={ref} className=\"contents\" dangerouslySetInnerHTML={{ __html: markup }} />\n}\n\nexport type FlagProps = {\n /** ISO 3166-1 alpha-2 country code (case-insensitive). Renders nothing when unknown. */\n iso: string\n /**\n * The size of the flag, matched to the `body-sm`/`body-md`/`body-lg` typography sizes.\n * @default 'md'\n */\n size?: NonNullable<VariantProps<typeof flagVariants>['size']>\n} & React.HTMLAttributes<HTMLSpanElement>\n\n/**\n * A country flag in a 4:3 aspect ratio, sized to line up with body text. Purely decorative and\n * always hidden from assistive tech (`aria-hidden`) — real usage always places it next to text\n * that already names the country, so it never carries its own accessible name.\n *\n * @example\n * ```tsx\n * <Flag iso=\"ES\" />\n * ```\n */\nconst Flag = React.forwardRef<HTMLSpanElement, Readonly<FlagProps>>(\n ({ iso, size = 'md', className, ...props }, ref) => {\n const code = iso.toUpperCase()\n const [loaded, setLoaded] = React.useState<{ code: string; svg: string } | undefined>(undefined)\n const svg = loaded?.code === code ? loaded.svg : getCachedFlagSvg(code)\n\n React.useEffect(() => {\n let cancelled = false\n loadFlagSvg(code)\n ?.then((svg) => {\n if (!cancelled) setLoaded({ code, svg })\n })\n .catch(() => {})\n return () => {\n cancelled = true\n }\n }, [code])\n\n if (!hasFlagSvg(code)) return null\n\n return (\n <span {...props} ref={ref} data-testid=\"flag\" aria-hidden className={cn(flagVariants({ size }), className)}>\n <span\n data-testid=\"flag-box\"\n data-size={size}\n className=\"\n block transform-gpu overflow-hidden\n data-[size=lg]:h-4.5 data-[size=lg]:w-6 data-[size=lg]:rounded-[5px]\n data-[size=md]:h-3.75 data-[size=md]:w-5 data-[size=md]:rounded-sm\n data-[size=sm]:h-3 data-[size=sm]:w-4 data-[size=sm]:rounded-[3px]\n \"\n >\n {svg && <FlagSvg markup={svg} />}\n </span>\n </span>\n )\n },\n)\n\nFlag.displayName = 'Flag'\n\nexport { Flag, flagVariants }\n"],"mappings":";;;;;;AAMA,IAAM,eAAe,IAAI,2EAA2E;CAClG,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC;AAED,SAAS,QAAQ,EAAE,UAAwC;CACzD,MAAM,MAAMA,QAAM,OAAwB,IAAI;CAE9C,QAAM,sBAAsB;EAC1B,MAAM,MAAM,IAAI,SAAS;EACzB,IAAI,EAAE,eAAe,aAAa;EAElC,IAAI,aAAa,eAAe,MAAM;EACtC,IAAI,aAAa,uBAAuB,gBAAgB;EACxD,IAAI,aAAa,SAAS,sCAAsC;EAEhE,IAAI,MAAM,QAAQ;EAClB,IAAI,MAAM,SAAS;CACrB,GAAG,CAAC,MAAM,CAAC;CAGX,OAAO,oBAAC,QAAD;EAAW;EAAK,WAAU;EAAW,yBAAyB,EAAE,QAAQ,OAAO;CAAI,CAAA;AAC5F;;;;;;;;;;;AAsBA,IAAM,OAAOA,QAAM,YAChB,EAAE,KAAK,OAAO,MAAM,WAAW,GAAG,SAAS,QAAQ;CAClD,MAAM,OAAO,IAAI,YAAY;CAC7B,MAAM,CAAC,QAAQ,aAAaA,QAAM,SAAoD,KAAA,CAAS;CAC/F,MAAM,MAAM,QAAQ,SAAS,OAAO,OAAO,MAAM,iBAAiB,IAAI;CAEtE,QAAM,gBAAgB;EACpB,IAAI,YAAY;EAChB,YAAY,IAAI,CAAC,EACb,MAAM,QAAQ;GACd,IAAI,CAAC,WAAW,UAAU;IAAE;IAAM;GAAI,CAAC;EACzC,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;EACjB,aAAa;GACX,YAAY;EACd;CACF,GAAG,CAAC,IAAI,CAAC;CAET,IAAI,CAAC,WAAW,IAAI,GAAG,OAAO;CAE9B,OACE,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,eAAY;EAAO,eAAA;EAAY,WAAW,GAAG,aAAa,EAAE,KAAK,CAAC,GAAG,SAAS;EACvG,UAAA,oBAAC,QAAD;GACE,eAAY;GACZ,aAAW;GACX,WAAU;GAOT,UAAA,OAAO,oBAAC,SAAD,EAAS,QAAQ,IAAM,CAAA;EAC3B,CAAA;CACF,CAAA;AAEV,CACF;AAEA,KAAK,cAAc"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Flag, flagVariants };
|
|
1
|
+
export { Flag, flagVariants } from "./Flag.js";
|
|
@@ -3,15 +3,14 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
6
|
-
|
|
7
|
-
var labelVariants = cva("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:
|
|
6
|
+
// src/components/data-display/Label/Label.tsx
|
|
7
|
+
var labelVariants = cva("text-title-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:text-tertiary");
|
|
8
8
|
var Label = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(LabelPrimitive.Root, {
|
|
9
9
|
ref,
|
|
10
10
|
className: cn(labelVariants(), className),
|
|
11
11
|
...props
|
|
12
12
|
}));
|
|
13
13
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
14
|
-
//#endregion
|
|
15
14
|
export { Label };
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=Label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","names":["React"],"sources":["../../../../src/components/data-display/Label/Label.tsx"],"sourcesContent":["import * as LabelPrimitive from '@radix-ui/react-label'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst labelVariants = cva('text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:
|
|
1
|
+
{"version":3,"file":"Label.js","names":["React"],"sources":["../../../../src/components/data-display/Label/Label.tsx"],"sourcesContent":["import * as LabelPrimitive from '@radix-ui/react-label'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst labelVariants = cva(\n 'text-title-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:text-tertiary',\n)\n\nconst Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n Readonly<React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"],"mappings":";;;;;;AAMA,IAAM,gBAAgB,IACpB,qGACF;AAEA,IAAM,QAAQA,QAAM,YAGjB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,MAAhB;CAA0B;CAAK,WAAW,GAAG,cAAc,GAAG,SAAS;CAAG,GAAI;AAAQ,CAAA,CACvF;AACD,MAAM,cAAc,eAAe,KAAK"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Label };
|
|
1
|
+
export { Label } from "./Label.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/data-display/Marquee/Marquee.tsx
|
|
4
4
|
function Marquee({ className, reverse = false, pauseOnHover = false, children, vertical = false, repeat = 4, duration = "40s", ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("div", {
|
|
6
6
|
...props,
|
|
@@ -9,13 +9,12 @@ function Marquee({ className, reverse = false, pauseOnHover = false, children, v
|
|
|
9
9
|
"data-reverse": reverse || void 0,
|
|
10
10
|
className: cn("group flex gap-(--gap) overflow-hidden p-2 [--gap:1rem]", vertical ? "flex-col" : "flex-row", className),
|
|
11
11
|
children: new Array(repeat).fill(0).map((_unused, index) => /* @__PURE__ */ jsx("div", {
|
|
12
|
-
className: "\n flex shrink-0
|
|
12
|
+
className: "\n flex shrink-0 motion-marquee flex-row justify-around gap-(--gap)\n group-data-pause-on-hover:group-hover:paused\n group-data-reverse:direction-[reverse]\n group-data-vertical:motion-marquee-vertical group-data-vertical:flex-col\n ",
|
|
13
13
|
style: { animationDuration: duration },
|
|
14
14
|
children
|
|
15
15
|
}, `marquee-element-${index}`))
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { Marquee };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=Marquee.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marquee.js","names":[],"sources":["../../../../src/components/data-display/Marquee/Marquee.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype MarqueeProps = {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n /**\n * Animation duration (e.g., \"40s\", \"2000ms\")\n * @default \"40s\"\n */\n duration?: string\n} & ComponentPropsWithoutRef<'div'>\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n duration = '40s',\n ...props\n}: Readonly<MarqueeProps>) {\n return (\n <div\n {...props}\n data-vertical={vertical || undefined}\n data-pause-on-hover={pauseOnHover || undefined}\n data-reverse={reverse || undefined}\n className={cn(\n 'group flex gap-(--gap) overflow-hidden p-2 [--gap:1rem]',\n vertical ? 'flex-col' : 'flex-row',\n className,\n )}\n >\n {new Array(repeat).fill(0).map((_unused, index) => (\n <div\n key={`marquee-element-${index}`} // NOSONAR: fixed-length list of unnamed, unreorderable stars; index is the only stable identity there is\n className=\"\n flex shrink-0
|
|
1
|
+
{"version":3,"file":"Marquee.js","names":[],"sources":["../../../../src/components/data-display/Marquee/Marquee.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ntype MarqueeProps = {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n /**\n * Animation duration (e.g., \"40s\", \"2000ms\")\n * @default \"40s\"\n */\n duration?: string\n} & ComponentPropsWithoutRef<'div'>\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n duration = '40s',\n ...props\n}: Readonly<MarqueeProps>) {\n return (\n <div\n {...props}\n data-vertical={vertical || undefined}\n data-pause-on-hover={pauseOnHover || undefined}\n data-reverse={reverse || undefined}\n className={cn(\n 'group flex gap-(--gap) overflow-hidden p-2 [--gap:1rem]',\n vertical ? 'flex-col' : 'flex-row',\n className,\n )}\n >\n {new Array(repeat).fill(0).map((_unused, index) => (\n <div\n key={`marquee-element-${index}`} // NOSONAR: fixed-length list of unnamed, unreorderable stars; index is the only stable identity there is\n className=\"\n flex shrink-0 motion-marquee flex-row justify-around gap-(--gap)\n group-data-pause-on-hover:group-hover:paused\n group-data-reverse:direction-[reverse]\n group-data-vertical:motion-marquee-vertical group-data-vertical:flex-col\n \"\n style={{ animationDuration: duration }}\n >\n {children}\n </div>\n ))}\n </div>\n )\n}\n"],"mappings":";;;AAwCA,SAAgB,QAAQ,EACtB,WACA,UAAU,OACV,eAAe,OACf,UACA,WAAW,OACX,SAAS,GACT,WAAW,OACX,GAAG,SACsB;CACzB,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,iBAAe,YAAY,KAAA;EAC3B,uBAAqB,gBAAgB,KAAA;EACrC,gBAAc,WAAW,KAAA;EACzB,WAAW,GACT,2DACA,WAAW,aAAa,YACxB,SACF;EAEC,UAAA,IAAI,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,UACvC,oBAAC,OAAD;GAEE,WAAU;GAMV,OAAO,EAAE,mBAAmB,SAAS;GAEpC;EACE,GAVE,mBAAmB,OAUrB,CACN;CACE,CAAA;AAET"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Marquee };
|
|
1
|
+
export { Marquee } from "./Marquee.js";
|
|
@@ -2,21 +2,21 @@ import { cn } from "../../../lib/utils.js";
|
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/data-display/NotificationBadge/NotificationBadge.tsx
|
|
6
6
|
var notificationBadgeVariants = cva("rounded-full", {
|
|
7
7
|
variants: {
|
|
8
8
|
color: {
|
|
9
|
-
neutral: "bg-neutral text-
|
|
10
|
-
accent: "bg-
|
|
11
|
-
primary: "bg-
|
|
12
|
-
success: "bg-success text-
|
|
13
|
-
warning: "bg-warning text-
|
|
14
|
-
error: "bg-
|
|
9
|
+
neutral: "bg-surface-neutral-strong-pressed text-inverse",
|
|
10
|
+
accent: "bg-illustration-brand text-on-brand",
|
|
11
|
+
primary: "bg-surface-brand-strong text-on-brand",
|
|
12
|
+
success: "bg-surface-success-strong text-on-strong",
|
|
13
|
+
warning: "bg-icon-warning text-on-strong",
|
|
14
|
+
error: "bg-surface-danger-strong text-on-strong"
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
|
-
sm: "
|
|
18
|
-
md: "
|
|
19
|
-
lg: "
|
|
17
|
+
sm: "size-2",
|
|
18
|
+
md: "size-3",
|
|
19
|
+
lg: "size-4"
|
|
20
20
|
},
|
|
21
21
|
position: {
|
|
22
22
|
"top-right": "top-0 right-0",
|
|
@@ -25,7 +25,7 @@ var notificationBadgeVariants = cva("rounded-full", {
|
|
|
25
25
|
"bottom-left": "bottom-0 left-0"
|
|
26
26
|
},
|
|
27
27
|
numeric: {
|
|
28
|
-
true: "flex h-4 min-w-4 items-center justify-center px-1 text-
|
|
28
|
+
true: "flex h-4 min-w-4 items-center justify-center px-1 text-label-sm font-medium",
|
|
29
29
|
false: ""
|
|
30
30
|
}
|
|
31
31
|
},
|
|
@@ -75,21 +75,19 @@ var NotificationBadge = React$1.forwardRef(({ className, color = "accent", size
|
|
|
75
75
|
color,
|
|
76
76
|
size: null
|
|
77
77
|
})}
|
|
78
|
-
absolute inline-flex
|
|
79
|
-
motion-reduce:animate-none
|
|
78
|
+
absolute inline-flex size-full motion-ping
|
|
80
79
|
` }), /* @__PURE__ */ jsx("span", {
|
|
81
80
|
className: `${notificationBadgeVariants({
|
|
82
81
|
color,
|
|
83
82
|
size: null
|
|
84
83
|
})}
|
|
85
|
-
relative inline-flex
|
|
84
|
+
relative inline-flex size-full items-center justify-center
|
|
86
85
|
`,
|
|
87
86
|
children: count
|
|
88
87
|
})]
|
|
89
88
|
});
|
|
90
89
|
});
|
|
91
90
|
NotificationBadge.displayName = "NotificationBadge";
|
|
92
|
-
//#endregion
|
|
93
91
|
export { NotificationBadge, notificationBadgeVariants };
|
|
94
92
|
|
|
95
93
|
//# sourceMappingURL=NotificationBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBadge.js","names":["React"],"sources":["../../../../src/components/data-display/NotificationBadge/NotificationBadge.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../../lib/utils'\n\nconst notificationBadgeVariants = cva('rounded-full', {\n variants: {\n color: {\n neutral: 'bg-neutral text-
|
|
1
|
+
{"version":3,"file":"NotificationBadge.js","names":["React"],"sources":["../../../../src/components/data-display/NotificationBadge/NotificationBadge.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../../lib/utils'\n\nconst notificationBadgeVariants = cva('rounded-full', {\n variants: {\n color: {\n neutral: 'bg-surface-neutral-strong-pressed text-inverse',\n accent: 'bg-illustration-brand text-on-brand',\n primary: 'bg-surface-brand-strong text-on-brand',\n success: 'bg-surface-success-strong text-on-strong',\n warning: 'bg-icon-warning text-on-strong',\n error: 'bg-surface-danger-strong text-on-strong',\n },\n size: {\n sm: 'size-2',\n md: 'size-3',\n lg: 'size-4',\n },\n position: {\n 'top-right': 'top-0 right-0',\n 'top-left': 'top-0 left-0',\n 'bottom-right': 'right-0 bottom-0',\n 'bottom-left': 'bottom-0 left-0',\n },\n numeric: {\n true: 'flex h-4 min-w-4 items-center justify-center px-1 text-label-sm font-medium',\n false: '',\n },\n },\n defaultVariants: {\n color: 'primary',\n size: 'md',\n position: 'top-right',\n numeric: false,\n },\n})\n\nexport type NotificationBadgeProps = {\n /**\n * Controls the visibility of the pulsing animation effect\n * @default true\n */\n ping?: boolean\n\n /**\n * The color variant of the badge\n * @default 'accent'\n */\n color?: 'neutral' | 'accent' | 'primary' | 'success' | 'warning' | 'error'\n\n /**\n * The size of the badge\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg'\n\n /**\n * The position of the badge relative to its container\n * @default 'top-right'\n */\n position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'\n\n /**\n * The number to display in the badge\n */\n count?: number\n} & React.HTMLAttributes<HTMLElement>\n\n/**\n * A dot or counter positioned absolutely over an icon or avatar, used to\n * show a notification, status, or draw attention to an element.\n *\n * @example\n * ```tsx\n * // Simple notification badge\n * <div className=\"relative\">\n * <Bell className=\"h-6 w-6\" />\n * <NotificationBadge color=\"error\" />\n * </div>\n *\n * // Custom size and position\n * <div className=\"relative\">\n * <Avatar />\n * <NotificationBadge\n * color=\"success\"\n * size=\"sm\"\n * position=\"bottom-right\"\n * ping={false}\n * />\n * </div>\n * ```\n */\nconst NotificationBadge = React.forwardRef<HTMLSpanElement, Readonly<NotificationBadgeProps>>(\n ({ className, color = 'accent', size = 'md', position = 'top-right', ping = true, count, ...props }, ref) => {\n return (\n <span\n data-testid=\"notification-badge\"\n className={cn(\n 'absolute flex',\n notificationBadgeVariants({ color, size, position, numeric: !!count }),\n className,\n )}\n ref={ref}\n {...props}\n >\n {ping && (\n <span\n className={`${notificationBadgeVariants({ color, size: null })}\n absolute inline-flex size-full motion-ping\n `}\n />\n )}\n <span\n className={`${notificationBadgeVariants({ color, size: null })}\n relative inline-flex size-full items-center justify-center\n `}\n >\n {count}\n </span>\n </span>\n )\n },\n)\n\nNotificationBadge.displayName = 'NotificationBadge'\n\nexport { NotificationBadge, notificationBadgeVariants }\n"],"mappings":";;;;;AAKA,IAAM,4BAA4B,IAAI,gBAAgB;CACpD,UAAU;EACR,OAAO;GACL,SAAS;GACT,QAAQ;GACR,SAAS;GACT,SAAS;GACT,SAAS;GACT,OAAO;EACT;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,UAAU;GACR,aAAa;GACb,YAAY;GACZ,gBAAgB;GAChB,eAAe;EACjB;EACA,SAAS;GACP,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,UAAU;EACV,SAAS;CACX;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAyDD,IAAM,oBAAoBA,QAAM,YAC7B,EAAE,WAAW,QAAQ,UAAU,OAAO,MAAM,WAAW,aAAa,OAAO,MAAM,OAAO,GAAG,SAAS,QAAQ;CAC3G,OACE,qBAAC,QAAD;EACE,eAAY;EACZ,WAAW,GACT,iBACA,0BAA0B;GAAE;GAAO;GAAM;GAAU,SAAS,CAAC,CAAC;EAAM,CAAC,GACrE,SACF;EACK;EACL,GAAI;EARN,UAAA,CAUG,QACC,oBAAC,QAAD,EACE,WAAW,GAAG,0BAA0B;GAAE;GAAO,MAAM;EAAK,CAAC,EAAE;;cAGhE,CAAA,GAEH,oBAAC,QAAD;GACE,WAAW,GAAG,0BAA0B;IAAE;IAAO,MAAM;GAAK,CAAC,EAAE;;;GAI9D,UAAA;EACG,CAAA,CACF;;AAEV,CACF;AAEA,kBAAkB,cAAc"}
|