@flipdish/ui-library 0.54.0 → 0.55.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/components/forms/Form/hooks/{useSaveForm/useSaveForm.cjs → useSaveForm.cjs} +1 -1
- package/dist/components/forms/Form/hooks/useSaveForm.cjs.map +1 -0
- package/dist/components/forms/Form/hooks/useSaveForm.d.ts.map +1 -0
- package/dist/components/forms/Form/hooks/{useSaveForm/useSaveForm.js → useSaveForm.js} +1 -1
- package/dist/components/forms/Form/hooks/useSaveForm.js.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn.cjs.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn.d.ts.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn.js.map +1 -0
- package/dist/components/forms/Form/index.cjs +2 -2
- package/dist/components/forms/Form/index.d.ts +2 -2
- package/dist/components/forms/Form/index.d.ts.map +1 -1
- package/dist/components/forms/Form/index.js +2 -2
- package/dist/components/forms/fields/FormMultiSelect/index.cjs +3 -3
- package/dist/components/forms/fields/FormMultiSelect/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormMultiSelect/index.d.ts +1 -1
- package/dist/components/forms/fields/FormMultiSelect/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormMultiSelect/index.js +2 -2
- package/dist/components/forms/fields/FormSelect/index.cjs +2 -2
- package/dist/components/forms/fields/FormSelect/index.d.ts +1 -1
- package/dist/components/forms/fields/FormSelect/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormSelect/index.js +1 -1
- package/dist/components/layouts/PageHubLayout/index.cjs +3 -3
- package/dist/components/layouts/PageHubLayout/index.cjs.map +1 -1
- package/dist/components/layouts/PageHubLayout/index.js +1 -1
- package/dist/components/molecules/Alerts/Alert/Alert.cjs.map +1 -0
- package/dist/components/molecules/Alerts/Alert/Alert.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/Alert/Alert.js.map +1 -0
- package/dist/components/molecules/Alerts/{components → SaveErrorAlert}/SaveErrorAlert.cjs +1 -1
- package/dist/components/molecules/Alerts/SaveErrorAlert/SaveErrorAlert.cjs.map +1 -0
- package/dist/components/molecules/Alerts/SaveErrorAlert/SaveErrorAlert.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/{components → SaveErrorAlert}/SaveErrorAlert.js +1 -1
- package/dist/components/molecules/Alerts/SaveErrorAlert/SaveErrorAlert.js.map +1 -0
- package/dist/components/molecules/Alerts/index.cjs +2 -2
- package/dist/components/molecules/Alerts/index.d.ts +7 -5
- package/dist/components/molecules/Alerts/index.d.ts.map +1 -1
- package/dist/components/molecules/Alerts/index.js +2 -2
- package/dist/components/molecules/Modals/{components → ConfirmationModal}/ConfirmationModal.cjs +1 -1
- package/dist/components/molecules/Modals/ConfirmationModal/ConfirmationModal.cjs.map +1 -0
- package/dist/components/molecules/Modals/ConfirmationModal/ConfirmationModal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/{components → ConfirmationModal}/ConfirmationModal.js +1 -1
- package/dist/components/molecules/Modals/ConfirmationModal/ConfirmationModal.js.map +1 -0
- package/dist/components/molecules/Modals/Modal/Modal.cjs.map +1 -0
- package/dist/components/molecules/Modals/Modal/Modal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/Modal/Modal.js.map +1 -0
- package/dist/components/molecules/Modals/{components → UnsavedChangesModal}/UnsavedChangesModal.cjs +1 -1
- package/dist/components/molecules/Modals/UnsavedChangesModal/UnsavedChangesModal.cjs.map +1 -0
- package/dist/components/molecules/Modals/UnsavedChangesModal/UnsavedChangesModal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/{components → UnsavedChangesModal}/UnsavedChangesModal.js +1 -1
- package/dist/components/molecules/Modals/UnsavedChangesModal/UnsavedChangesModal.js.map +1 -0
- package/dist/components/molecules/Modals/index.cjs +3 -3
- package/dist/components/molecules/Modals/index.d.ts +9 -7
- package/dist/components/molecules/Modals/index.d.ts.map +1 -1
- package/dist/components/molecules/Modals/index.js +3 -3
- package/dist/components/molecules/Pagination/index.cjs +9 -65
- package/dist/components/molecules/Pagination/index.cjs.map +1 -1
- package/dist/components/molecules/Pagination/index.d.ts +9 -35
- package/dist/components/molecules/Pagination/index.d.ts.map +1 -1
- package/dist/components/molecules/Pagination/index.js +8 -64
- package/dist/components/molecules/Pagination/index.js.map +1 -1
- package/dist/components/molecules/{Pagination/components → Paginations/Indicators}/PaginationDot.cjs +1 -1
- package/dist/components/molecules/Paginations/Indicators/PaginationDot.cjs.map +1 -0
- package/dist/components/molecules/{Pagination/components → Paginations/Indicators}/PaginationDot.d.ts +2 -3
- package/dist/components/molecules/Paginations/Indicators/PaginationDot.d.ts.map +1 -0
- package/dist/components/molecules/{Pagination/components → Paginations/Indicators}/PaginationDot.js +1 -1
- package/dist/components/molecules/Paginations/Indicators/PaginationDot.js.map +1 -0
- package/dist/components/molecules/{Pagination/components → Paginations/Indicators}/PaginationLine.cjs +2 -1
- package/dist/components/molecules/Paginations/Indicators/PaginationLine.cjs.map +1 -0
- package/dist/components/molecules/Paginations/Indicators/PaginationLine.d.ts +10 -0
- package/dist/components/molecules/Paginations/Indicators/PaginationLine.d.ts.map +1 -0
- package/dist/components/molecules/{Pagination/components → Paginations/Indicators}/PaginationLine.js +2 -1
- package/dist/components/molecules/Paginations/Indicators/PaginationLine.js.map +1 -0
- package/dist/components/molecules/Paginations/Pagination/Pagination.cjs +67 -0
- package/dist/components/molecules/Paginations/Pagination/Pagination.cjs.map +1 -0
- package/dist/components/molecules/Paginations/Pagination/Pagination.d.ts +34 -0
- package/dist/components/molecules/Paginations/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/molecules/Paginations/Pagination/Pagination.js +65 -0
- package/dist/components/molecules/Paginations/Pagination/Pagination.js.map +1 -0
- package/dist/components/molecules/{Pagination → Paginations}/components/PaginationBase.cjs +1 -1
- package/dist/components/molecules/Paginations/components/PaginationBase.cjs.map +1 -0
- package/dist/components/molecules/{Pagination → Paginations}/components/PaginationBase.d.ts +1 -1
- package/dist/components/molecules/Paginations/components/PaginationBase.d.ts.map +1 -0
- package/dist/components/molecules/{Pagination → Paginations}/components/PaginationBase.js +1 -1
- package/dist/components/molecules/Paginations/components/PaginationBase.js.map +1 -0
- package/dist/components/molecules/Paginations/index.cjs +12 -0
- package/dist/components/molecules/Paginations/index.cjs.map +1 -0
- package/dist/components/molecules/Paginations/index.d.ts +16 -0
- package/dist/components/molecules/Paginations/index.d.ts.map +1 -0
- package/dist/components/molecules/Paginations/index.js +4 -0
- package/dist/components/molecules/Paginations/index.js.map +1 -0
- package/dist/components/molecules/Paginations/utilities/pagination.utils.cjs.map +1 -0
- package/dist/components/molecules/Paginations/utilities/pagination.utils.d.ts.map +1 -0
- package/dist/components/molecules/Paginations/utilities/pagination.utils.js.map +1 -0
- package/dist/components/molecules/Select/index.cjs +15 -51
- package/dist/components/molecules/Select/index.cjs.map +1 -1
- package/dist/components/molecules/Select/index.d.ts +52 -28
- package/dist/components/molecules/Select/index.d.ts.map +1 -1
- package/dist/components/molecules/Select/index.js +12 -48
- package/dist/components/molecules/Select/index.js.map +1 -1
- package/dist/components/molecules/{Select/components → Selects/MultiSelect}/MultiSelect.cjs +5 -4
- package/dist/components/molecules/Selects/MultiSelect/MultiSelect.cjs.map +1 -0
- package/dist/components/molecules/{Select/components → Selects/MultiSelect}/MultiSelect.d.ts +2 -2
- package/dist/components/molecules/Selects/MultiSelect/MultiSelect.d.ts.map +1 -0
- package/dist/components/molecules/{Select/components → Selects/MultiSelect}/MultiSelect.js +5 -4
- package/dist/components/molecules/Selects/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/components/molecules/{Select/hooks → Selects/MultiSelect}/useMultiSelectSelection.cjs +1 -1
- package/dist/components/molecules/Selects/MultiSelect/useMultiSelectSelection.cjs.map +1 -0
- package/dist/components/molecules/{Select/hooks → Selects/MultiSelect}/useMultiSelectSelection.d.ts +1 -1
- package/dist/components/molecules/Selects/MultiSelect/useMultiSelectSelection.d.ts.map +1 -0
- package/dist/components/molecules/{Select/hooks → Selects/MultiSelect}/useMultiSelectSelection.js +1 -1
- package/dist/components/molecules/Selects/MultiSelect/useMultiSelectSelection.js.map +1 -0
- package/dist/components/molecules/{Select → Selects/MultiSelect/utilities}/multiSelect.utils.cjs +1 -1
- package/dist/components/molecules/Selects/MultiSelect/utilities/multiSelect.utils.cjs.map +1 -0
- package/dist/components/molecules/{Select → Selects/MultiSelect/utilities}/multiSelect.utils.d.ts +1 -1
- package/dist/components/molecules/Selects/MultiSelect/utilities/multiSelect.utils.d.ts.map +1 -0
- package/dist/components/molecules/{Select → Selects/MultiSelect/utilities}/multiSelect.utils.js +1 -1
- package/dist/components/molecules/Selects/MultiSelect/utilities/multiSelect.utils.js.map +1 -0
- package/dist/components/molecules/{Select/components → Selects/Select}/Combobox.cjs +5 -4
- package/dist/components/molecules/Selects/Select/Combobox.cjs.map +1 -0
- package/dist/components/molecules/{Select/components → Selects/Select}/Combobox.d.ts +1 -1
- package/dist/components/molecules/Selects/Select/Combobox.d.ts.map +1 -0
- package/dist/components/molecules/{Select/components → Selects/Select}/Combobox.js +4 -3
- package/dist/components/molecules/Selects/Select/Combobox.js.map +1 -0
- package/dist/components/molecules/Selects/Select/Popover.cjs.map +1 -0
- package/dist/components/molecules/Selects/Select/Popover.d.ts.map +1 -0
- package/dist/components/molecules/Selects/Select/Popover.js.map +1 -0
- package/dist/components/molecules/Selects/Select/Select.cjs +55 -0
- package/dist/components/molecules/Selects/Select/Select.cjs.map +1 -0
- package/dist/components/molecules/Selects/Select/Select.d.ts +30 -0
- package/dist/components/molecules/Selects/Select/Select.d.ts.map +1 -0
- package/dist/components/molecules/Selects/Select/Select.js +53 -0
- package/dist/components/molecules/Selects/Select/Select.js.map +1 -0
- package/dist/components/molecules/Selects/Selects.styles.cjs +19 -0
- package/dist/components/molecules/Selects/Selects.styles.cjs.map +1 -0
- package/dist/components/molecules/Selects/Selects.styles.d.ts +27 -0
- package/dist/components/molecules/Selects/Selects.styles.d.ts.map +1 -0
- package/dist/components/molecules/Selects/Selects.styles.js +17 -0
- package/dist/components/molecules/Selects/Selects.styles.js.map +1 -0
- package/dist/components/molecules/{Select → Selects}/components/SelectItem.cjs +2 -2
- package/dist/components/molecules/Selects/components/SelectItem.cjs.map +1 -0
- package/dist/components/molecules/{Select → Selects}/components/SelectItem.d.ts +1 -1
- package/dist/components/molecules/Selects/components/SelectItem.d.ts.map +1 -0
- package/dist/components/molecules/{Select → Selects}/components/SelectItem.js +1 -1
- package/dist/components/molecules/Selects/components/SelectItem.js.map +1 -0
- package/dist/components/molecules/Selects/index.cjs +10 -0
- package/dist/components/molecules/Selects/index.cjs.map +1 -0
- package/dist/components/molecules/Selects/index.d.ts +15 -0
- package/dist/components/molecules/Selects/index.d.ts.map +1 -0
- package/dist/components/molecules/Selects/index.js +3 -0
- package/dist/components/molecules/Selects/index.js.map +1 -0
- package/dist/components/molecules/Selects/providers/Select.context.cjs +9 -0
- package/dist/components/molecules/Selects/providers/Select.context.cjs.map +1 -0
- package/dist/components/molecules/Selects/providers/Select.context.d.ts +6 -0
- package/dist/components/molecules/Selects/providers/Select.context.d.ts.map +1 -0
- package/dist/components/molecules/Selects/providers/Select.context.js +7 -0
- package/dist/components/molecules/Selects/providers/Select.context.js.map +1 -0
- package/dist/components/molecules/{Select/components/SelectShared.d.ts → Selects/selects.types.d.ts} +1 -28
- package/dist/components/molecules/Selects/selects.types.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/Tag.cjs +58 -0
- package/dist/components/molecules/Tags/Tag/Tag.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/Tag.d.ts +43 -0
- package/dist/components/molecules/Tags/Tag/Tag.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/Tag.js +56 -0
- package/dist/components/molecules/Tags/Tag/Tag.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.cjs +17 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.d.ts +6 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.js +15 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCheckbox.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCheckbox.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCheckbox.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCloseX.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCloseX.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCloseX.js.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.cjs +23 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.cjs.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts +25 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.js +20 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.js.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts +10 -0
- package/dist/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tags.styles.cjs +1 -1
- package/dist/components/molecules/Tags/Tags.styles.d.ts +1 -1
- package/dist/components/molecules/Tags/Tags.styles.js +1 -1
- package/dist/components/molecules/Tags/index.cjs +8 -64
- package/dist/components/molecules/Tags/index.cjs.map +1 -1
- package/dist/components/molecules/Tags/index.d.ts +13 -54
- package/dist/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/components/molecules/Tags/index.js +3 -63
- package/dist/components/molecules/Tags/index.js.map +1 -1
- package/dist/components/molecules/Tags/providers/TagGroup.context.cjs +12 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.cjs.map +1 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.d.ts +7 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.d.ts.map +1 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.js +10 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.js.map +1 -0
- package/dist/components/organisms/Charts/{components → ActivityGauge}/ActivityGauge.cjs +1 -1
- package/dist/components/organisms/Charts/ActivityGauge/ActivityGauge.cjs.map +1 -0
- package/dist/components/organisms/Charts/ActivityGauge/ActivityGauge.d.ts.map +1 -0
- package/dist/components/organisms/Charts/{components → ActivityGauge}/ActivityGauge.js +1 -1
- package/dist/components/organisms/Charts/ActivityGauge/ActivityGauge.js.map +1 -0
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.cjs +1 -1
- package/dist/components/organisms/Charts/BarChart/BarChart.cjs.map +1 -0
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.d.ts +1 -1
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.d.ts.map +1 -1
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.js +1 -1
- package/dist/components/organisms/Charts/BarChart/BarChart.js.map +1 -0
- package/dist/components/organisms/Charts/{components → LineChart}/LineChart.cjs +1 -1
- package/dist/components/organisms/Charts/LineChart/LineChart.cjs.map +1 -0
- package/dist/components/organisms/Charts/{components → LineChart}/LineChart.d.ts +1 -1
- package/dist/components/organisms/Charts/LineChart/LineChart.d.ts.map +1 -0
- package/dist/components/organisms/Charts/{components → LineChart}/LineChart.js +1 -1
- package/dist/components/organisms/Charts/LineChart/LineChart.js.map +1 -0
- package/dist/components/organisms/Charts/Metrics/Metrics.cjs.map +1 -0
- package/dist/components/organisms/Charts/Metrics/Metrics.d.ts.map +1 -0
- package/dist/components/organisms/Charts/Metrics/Metrics.js.map +1 -0
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.cjs +1 -1
- package/dist/components/organisms/Charts/PieChart/PieChart.cjs.map +1 -0
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.d.ts +1 -1
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.d.ts.map +1 -1
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.js +1 -1
- package/dist/components/organisms/Charts/PieChart/PieChart.js.map +1 -0
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.cjs +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.cjs.map +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.d.ts.map +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.js +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.js.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.cjs +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.js +1 -1
- package/dist/components/organisms/Charts/index.cjs +6 -6
- package/dist/components/organisms/Charts/index.d.ts +16 -14
- package/dist/components/organisms/Charts/index.d.ts.map +1 -1
- package/dist/components/organisms/Charts/index.js +6 -6
- package/dist/components/organisms/Charts/utilities/chartTooltip.utils.cjs.map +1 -0
- package/dist/components/organisms/Charts/utilities/chartTooltip.utils.d.ts.map +1 -0
- package/dist/components/organisms/Charts/utilities/chartTooltip.utils.js.map +1 -0
- package/dist/components/organisms/ColorPicker/index.cjs +2 -2
- package/dist/components/organisms/ColorPicker/index.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/index.d.ts +1 -1
- package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.js +1 -1
- package/dist/components/organisms/PageHeader/index.cjs +2 -2
- package/dist/components/organisms/PageHeader/index.cjs.map +1 -1
- package/dist/components/organisms/PageHeader/index.js +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs +3 -3
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.js +1 -1
- package/dist/native/components/molecules/Paginations/index.d.ts +12 -0
- package/dist/native/components/molecules/Selects/index.d.ts +12 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.d.ts +62 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.js +78 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.js.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.d.ts +45 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.js +36 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.js.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts +10 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.js +23 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.js.map +1 -0
- package/dist/native/components/molecules/Tags/Tags.styles.d.ts +1 -1
- package/dist/native/components/molecules/Tags/Tags.styles.js +1 -1
- package/dist/native/components/molecules/Tags/index.d.ts +5 -96
- package/dist/native/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/native/components/molecules/Tags/index.js +2 -104
- package/dist/native/components/molecules/Tags/index.js.map +1 -1
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.d.ts +13 -0
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.js +12 -0
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.js.map +1 -0
- package/package.json +2 -2
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.cjs.map +0 -1
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.d.ts.map +0 -1
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.js.map +0 -1
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.cjs.map +0 -1
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts.map +0 -1
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js.map +0 -1
- package/dist/components/molecules/Alerts/components/Alert.cjs.map +0 -1
- package/dist/components/molecules/Alerts/components/Alert.d.ts.map +0 -1
- package/dist/components/molecules/Alerts/components/Alert.js.map +0 -1
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.cjs.map +0 -1
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.d.ts.map +0 -1
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.js.map +0 -1
- package/dist/components/molecules/Modals/components/ConfirmationModal.cjs.map +0 -1
- package/dist/components/molecules/Modals/components/ConfirmationModal.d.ts.map +0 -1
- package/dist/components/molecules/Modals/components/ConfirmationModal.js.map +0 -1
- package/dist/components/molecules/Modals/components/Modal.cjs.map +0 -1
- package/dist/components/molecules/Modals/components/Modal.d.ts.map +0 -1
- package/dist/components/molecules/Modals/components/Modal.js.map +0 -1
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.cjs.map +0 -1
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.d.ts.map +0 -1
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.js.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationBase.cjs.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationBase.d.ts.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationBase.js.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationDot.cjs.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationDot.d.ts.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationDot.js.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationLine.cjs.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationLine.d.ts +0 -10
- package/dist/components/molecules/Pagination/components/PaginationLine.d.ts.map +0 -1
- package/dist/components/molecules/Pagination/components/PaginationLine.js.map +0 -1
- package/dist/components/molecules/Pagination/pagination.utils.cjs.map +0 -1
- package/dist/components/molecules/Pagination/pagination.utils.d.ts.map +0 -1
- package/dist/components/molecules/Pagination/pagination.utils.js.map +0 -1
- package/dist/components/molecules/Select/components/Combobox.cjs.map +0 -1
- package/dist/components/molecules/Select/components/Combobox.d.ts.map +0 -1
- package/dist/components/molecules/Select/components/Combobox.js.map +0 -1
- package/dist/components/molecules/Select/components/MultiSelect.cjs.map +0 -1
- package/dist/components/molecules/Select/components/MultiSelect.d.ts.map +0 -1
- package/dist/components/molecules/Select/components/MultiSelect.js.map +0 -1
- package/dist/components/molecules/Select/components/Popover.cjs.map +0 -1
- package/dist/components/molecules/Select/components/Popover.d.ts.map +0 -1
- package/dist/components/molecules/Select/components/Popover.js.map +0 -1
- package/dist/components/molecules/Select/components/SelectItem.cjs.map +0 -1
- package/dist/components/molecules/Select/components/SelectItem.d.ts.map +0 -1
- package/dist/components/molecules/Select/components/SelectItem.js.map +0 -1
- package/dist/components/molecules/Select/components/SelectShared.cjs +0 -20
- package/dist/components/molecules/Select/components/SelectShared.cjs.map +0 -1
- package/dist/components/molecules/Select/components/SelectShared.d.ts.map +0 -1
- package/dist/components/molecules/Select/components/SelectShared.js +0 -17
- package/dist/components/molecules/Select/components/SelectShared.js.map +0 -1
- package/dist/components/molecules/Select/hooks/useMultiSelectSelection.cjs.map +0 -1
- package/dist/components/molecules/Select/hooks/useMultiSelectSelection.d.ts.map +0 -1
- package/dist/components/molecules/Select/hooks/useMultiSelectSelection.js.map +0 -1
- package/dist/components/molecules/Select/multiSelect.utils.cjs.map +0 -1
- package/dist/components/molecules/Select/multiSelect.utils.d.ts.map +0 -1
- package/dist/components/molecules/Select/multiSelect.utils.js.map +0 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.cjs.map +0 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.d.ts.map +0 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.js.map +0 -1
- package/dist/components/molecules/Tags/components/TagCloseX.cjs.map +0 -1
- package/dist/components/molecules/Tags/components/TagCloseX.d.ts.map +0 -1
- package/dist/components/molecules/Tags/components/TagCloseX.js.map +0 -1
- package/dist/components/organisms/Charts/chartTooltip.utils.cjs.map +0 -1
- package/dist/components/organisms/Charts/chartTooltip.utils.d.ts.map +0 -1
- package/dist/components/organisms/Charts/chartTooltip.utils.js.map +0 -1
- package/dist/components/organisms/Charts/components/ActivityGauge.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/ActivityGauge.d.ts.map +0 -1
- package/dist/components/organisms/Charts/components/ActivityGauge.js.map +0 -1
- package/dist/components/organisms/Charts/components/BarChart.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/BarChart.js.map +0 -1
- package/dist/components/organisms/Charts/components/LineChart.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/LineChart.d.ts.map +0 -1
- package/dist/components/organisms/Charts/components/LineChart.js.map +0 -1
- package/dist/components/organisms/Charts/components/Metrics.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/Metrics.d.ts.map +0 -1
- package/dist/components/organisms/Charts/components/Metrics.js.map +0 -1
- package/dist/components/organisms/Charts/components/PieChart.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/PieChart.js.map +0 -1
- /package/dist/components/forms/Form/hooks/{useSaveForm/useSaveForm.d.ts → useSaveForm.d.ts} +0 -0
- /package/dist/components/forms/Form/hooks/{useSubmitInTurn/useSubmitInTurn.cjs → useSubmitInTurn.cjs} +0 -0
- /package/dist/components/forms/Form/hooks/{useSubmitInTurn/useSubmitInTurn.d.ts → useSubmitInTurn.d.ts} +0 -0
- /package/dist/components/forms/Form/hooks/{useSubmitInTurn/useSubmitInTurn.js → useSubmitInTurn.js} +0 -0
- /package/dist/components/molecules/Alerts/{components → Alert}/Alert.cjs +0 -0
- /package/dist/components/molecules/Alerts/{components → Alert}/Alert.d.ts +0 -0
- /package/dist/components/molecules/Alerts/{components → Alert}/Alert.js +0 -0
- /package/dist/components/molecules/Alerts/{components → SaveErrorAlert}/SaveErrorAlert.d.ts +0 -0
- /package/dist/components/molecules/Modals/{components → ConfirmationModal}/ConfirmationModal.d.ts +0 -0
- /package/dist/components/molecules/Modals/{components → Modal}/Modal.cjs +0 -0
- /package/dist/components/molecules/Modals/{components → Modal}/Modal.d.ts +0 -0
- /package/dist/components/molecules/Modals/{components → Modal}/Modal.js +0 -0
- /package/dist/components/molecules/Modals/{components → UnsavedChangesModal}/UnsavedChangesModal.d.ts +0 -0
- /package/dist/components/molecules/{Pagination → Paginations/utilities}/pagination.utils.cjs +0 -0
- /package/dist/components/molecules/{Pagination → Paginations/utilities}/pagination.utils.d.ts +0 -0
- /package/dist/components/molecules/{Pagination → Paginations/utilities}/pagination.utils.js +0 -0
- /package/dist/components/molecules/{Select/components → Selects/Select}/Popover.cjs +0 -0
- /package/dist/components/molecules/{Select/components → Selects/Select}/Popover.d.ts +0 -0
- /package/dist/components/molecules/{Select/components → Selects/Select}/Popover.js +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCheckbox.cjs +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCheckbox.d.ts +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCheckbox.js +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCloseX.cjs +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCloseX.d.ts +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCloseX.js +0 -0
- /package/dist/components/organisms/Charts/{components → ActivityGauge}/ActivityGauge.d.ts +0 -0
- /package/dist/components/organisms/Charts/{components → Metrics}/Metrics.cjs +0 -0
- /package/dist/components/organisms/Charts/{components → Metrics}/Metrics.d.ts +0 -0
- /package/dist/components/organisms/Charts/{components → Metrics}/Metrics.js +0 -0
- /package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.d.ts +0 -0
- /package/dist/components/organisms/Charts/{chartTooltip.utils.cjs → utilities/chartTooltip.utils.cjs} +0 -0
- /package/dist/components/organisms/Charts/{chartTooltip.utils.d.ts → utilities/chartTooltip.utils.d.ts} +0 -0
- /package/dist/components/organisms/Charts/{chartTooltip.utils.js → utilities/chartTooltip.utils.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selects.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Selects/selects.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG;IAC3B,sCAAsC;IACtC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,SAAS,CAAC;CAC3D,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Dot = require('@flipdish/ui-library/components/atoms/Dot');
|
|
5
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactAriaComponents = require('react-aria-components');
|
|
9
|
+
var TagGroup_context = require('../providers/TagGroup.context.cjs');
|
|
10
|
+
var Tags_styles = require('../Tags.styles.cjs');
|
|
11
|
+
var TagAvatar = require('./TagAvatar.cjs');
|
|
12
|
+
var TagCheckbox = require('./TagCheckbox.cjs');
|
|
13
|
+
var TagCloseX = require('./TagCloseX.cjs');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A single tag inside a `TagList`, with an optional avatar or dot, count, selection checkbox and remove button.
|
|
17
|
+
* Use one per value in a `TagGroup`, which sets its size and whether it can be selected.
|
|
18
|
+
*
|
|
19
|
+
* @summary single tag with optional adornments and selection
|
|
20
|
+
*/
|
|
21
|
+
const Tag = ({ id, avatarSrc, avatarContrastBorder = true, dot, dotColor = 'fg-success-secondary', dotClassName, isDisabled, count, className, children, onClose, textValue, 'data-testid': dataTestId, ...otherProps }) => {
|
|
22
|
+
const context = React.useContext(TagGroup_context.TagGroupContext);
|
|
23
|
+
const prefix = testIdUtils.useTestIdPrefix();
|
|
24
|
+
const idPart = id !== undefined ? testIdUtils.slugifyTestId(String(id)) : 'tag';
|
|
25
|
+
const tagTestId = dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, `tag-${idPart}`) : undefined);
|
|
26
|
+
const closeTestId = tagTestId ? `${tagTestId}-close` : undefined;
|
|
27
|
+
const renderLeadingContent = () => {
|
|
28
|
+
if (avatarSrc)
|
|
29
|
+
return jsxRuntime.jsx(TagAvatar.TagAvatar, { src: avatarSrc, alt: "Avatar", contrastBorder: avatarContrastBorder });
|
|
30
|
+
if (dot)
|
|
31
|
+
return jsxRuntime.jsx(Dot.Dot, { color: dotColor, className: dotClassName, size: "sm" });
|
|
32
|
+
return null;
|
|
33
|
+
};
|
|
34
|
+
const leadingContent = renderLeadingContent();
|
|
35
|
+
return (jsxRuntime.jsx(reactAriaComponents.Tag, { ...otherProps, id: id, isDisabled: isDisabled,
|
|
36
|
+
// A given `textValue` wins: it is how a tag whose children are not plain text gets its accessible text.
|
|
37
|
+
textValue: textValue ?? (typeof children === 'string' ? children : undefined), "data-testid": tagTestId, className: (state) => cx.cx(Tags_styles.styles.root, Tags_styles.styles.sizes[context.size].root.base,
|
|
38
|
+
// With avatar
|
|
39
|
+
avatarSrc && Tags_styles.styles.sizes[context.size].root.withAvatar,
|
|
40
|
+
// With X button
|
|
41
|
+
(onClose || state.allowsRemoving) && Tags_styles.styles.sizes[context.size].root.withClose,
|
|
42
|
+
// With dot
|
|
43
|
+
dot && Tags_styles.styles.sizes[context.size].root.withDot,
|
|
44
|
+
// With count
|
|
45
|
+
typeof count === 'number' && Tags_styles.styles.sizes[context.size].root.withCount,
|
|
46
|
+
// With checkbox
|
|
47
|
+
context.selectionMode !== 'none' && Tags_styles.styles.sizes[context.size].root.withCheckbox,
|
|
48
|
+
// Disabled
|
|
49
|
+
isDisabled && 'cursor-not-allowed', typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, allowsRemoving }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex items-center gap-1', Tags_styles.styles.sizes[context.size].content), children: [context.selectionMode !== 'none' && jsxRuntime.jsx(TagCheckbox.TagCheckbox, { size: context.size, isSelected: isSelected, isDisabled: isDisabled }), leadingContent, children, typeof count === 'number' && jsxRuntime.jsx("span", { className: cx.cx(Tags_styles.styles.count, Tags_styles.styles.sizes[context.size].count), children: count })] }), (onClose || allowsRemoving) && (jsxRuntime.jsx(TagCloseX.TagCloseX, { size: context.size, excludeFromTabOrder: allowsRemoving,
|
|
50
|
+
// Compared with `undefined`, not by truthiness: `0` and `''` are valid keys.
|
|
51
|
+
onPress: () => {
|
|
52
|
+
if (id !== undefined)
|
|
53
|
+
onClose?.(String(id));
|
|
54
|
+
}, "data-testid": closeTestId }))] })) }));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.Tag = Tag;
|
|
58
|
+
//# sourceMappingURL=Tag.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.cjs","sources":["../../../../../src/components/molecules/Tags/Tag/Tag.tsx"],"sourcesContent":[null],"names":["useContext","TagGroupContext","useTestIdPrefix","slugifyTestId","joinTestId","_jsx","TagAvatar","Dot","AriaTag","cx","styles","_jsxs","_Fragment","TagCheckbox","TagCloseX"],"mappings":";;;;;;;;;;;;;;AAgDA;;;;;AAKG;AACI,MAAM,GAAG,GAAG,CAAC,EAClB,EAAE,EACF,SAAS,EACT,oBAAoB,GAAG,IAAI,EAC3B,GAAG,EACH,QAAQ,GAAG,sBAAsB,EACjC,YAAY,EACZ,UAAU,EACV,KAAK,EACL,SAAS,EACT,QAAQ,EACR,OAAO,EACP,SAAS,EACT,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACe,KAAI;AAChC,IAAA,MAAM,OAAO,GAAGA,gBAAU,CAACC,gCAAe,CAAC;AAC3C,IAAA,MAAM,MAAM,GAAGC,2BAAe,EAAE;AAChC,IAAA,MAAM,MAAM,GAAG,EAAE,KAAK,SAAS,GAAGC,yBAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK;IACnE,MAAM,SAAS,GAAG,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,CAAA,IAAA,EAAO,MAAM,CAAA,CAAE,CAAC,GAAG,SAAS,CAAC;AAC1F,IAAA,MAAM,WAAW,GAAG,SAAS,GAAG,CAAA,EAAG,SAAS,CAAA,MAAA,CAAQ,GAAG,SAAS;IAEhE,MAAM,oBAAoB,GAAG,MAAK;AAChC,QAAA,IAAI,SAAS;AAAE,YAAA,OAAOC,cAAA,CAACC,mBAAS,E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DotColor } from '@flipdish/ui-library/components/atoms/Dot';
|
|
2
|
+
import { type PropsWithChildren, type RefAttributes } from 'react';
|
|
3
|
+
import { type TagProps as AriaTagProps } from 'react-aria-components';
|
|
4
|
+
export interface TagItem {
|
|
5
|
+
/** Stable key for the tag: selection, removal and the derived test id all read it. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Text of the tag. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Number shown after the label, such as how many items the tag stands for. */
|
|
10
|
+
count?: number;
|
|
11
|
+
/** Image URL for a leading avatar; a user icon shows when it is missing or fails to load. */
|
|
12
|
+
avatarSrc?: string;
|
|
13
|
+
/** Thin dark outline that keeps the avatar visible on a light surface. */
|
|
14
|
+
avatarContrastBorder?: boolean;
|
|
15
|
+
/** Shows a leading status dot; an avatar takes its place when `avatarSrc` is set. */
|
|
16
|
+
dot?: boolean;
|
|
17
|
+
/** Semantic fill for the status dot; same tokens as `Dot`'s `color`. Defaults to `fg-success-secondary`. */
|
|
18
|
+
dotColor?: DotColor;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Prefer `dotColor`. Web-only `text-*` class merged onto the status `Dot` via
|
|
21
|
+
* `currentColor` — not available on React Native.
|
|
22
|
+
*/
|
|
23
|
+
dotClassName?: string;
|
|
24
|
+
/** Mutes the tag and stops it being selected or removed. */
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
/** Shows a close button and is called with the tag id when it is pressed. */
|
|
27
|
+
onClose?: (id: string) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface TagProps extends AriaTagProps, RefAttributes<HTMLDivElement>, Omit<TagItem, 'label' | 'id'> {
|
|
30
|
+
/**
|
|
31
|
+
* Overrides the derived `data-testid` for this tag (defaults to
|
|
32
|
+
* `<root>--tag-<slug>`, slugified from `id`).
|
|
33
|
+
*/
|
|
34
|
+
'data-testid'?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A single tag inside a `TagList`, with an optional avatar or dot, count, selection checkbox and remove button.
|
|
38
|
+
* Use one per value in a `TagGroup`, which sets its size and whether it can be selected.
|
|
39
|
+
*
|
|
40
|
+
* @summary single tag with optional adornments and selection
|
|
41
|
+
*/
|
|
42
|
+
export declare const Tag: ({ id, avatarSrc, avatarContrastBorder, dot, dotColor, dotClassName, isDisabled, count, className, children, onClose, textValue, "data-testid": dataTestId, ...otherProps }: PropsWithChildren<TagProps>) => import("react").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=Tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Tags/Tag/Tag.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAc,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAkB,KAAK,QAAQ,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAOtF,MAAM,WAAW,OAAO;IACtB,sFAAsF;IACtF,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qFAAqF;IACrF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAGD,MAAM,WAAW,QAAS,SAAQ,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1G;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,4KAejB,iBAAiB,CAAC,QAAQ,CAAC,gCAuE7B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { Dot } from '@flipdish/ui-library/components/atoms/Dot';
|
|
3
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
+
import { useTestIdPrefix, slugifyTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
5
|
+
import { useContext } from 'react';
|
|
6
|
+
import { Tag as Tag$1 } from 'react-aria-components';
|
|
7
|
+
import { TagGroupContext } from '../providers/TagGroup.context.js';
|
|
8
|
+
import { styles } from '../Tags.styles.js';
|
|
9
|
+
import { TagAvatar } from './TagAvatar.js';
|
|
10
|
+
import { TagCheckbox } from './TagCheckbox.js';
|
|
11
|
+
import { TagCloseX } from './TagCloseX.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A single tag inside a `TagList`, with an optional avatar or dot, count, selection checkbox and remove button.
|
|
15
|
+
* Use one per value in a `TagGroup`, which sets its size and whether it can be selected.
|
|
16
|
+
*
|
|
17
|
+
* @summary single tag with optional adornments and selection
|
|
18
|
+
*/
|
|
19
|
+
const Tag = ({ id, avatarSrc, avatarContrastBorder = true, dot, dotColor = 'fg-success-secondary', dotClassName, isDisabled, count, className, children, onClose, textValue, 'data-testid': dataTestId, ...otherProps }) => {
|
|
20
|
+
const context = useContext(TagGroupContext);
|
|
21
|
+
const prefix = useTestIdPrefix();
|
|
22
|
+
const idPart = id !== undefined ? slugifyTestId(String(id)) : 'tag';
|
|
23
|
+
const tagTestId = dataTestId ?? (prefix ? joinTestId(prefix, `tag-${idPart}`) : undefined);
|
|
24
|
+
const closeTestId = tagTestId ? `${tagTestId}-close` : undefined;
|
|
25
|
+
const renderLeadingContent = () => {
|
|
26
|
+
if (avatarSrc)
|
|
27
|
+
return jsx(TagAvatar, { src: avatarSrc, alt: "Avatar", contrastBorder: avatarContrastBorder });
|
|
28
|
+
if (dot)
|
|
29
|
+
return jsx(Dot, { color: dotColor, className: dotClassName, size: "sm" });
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
const leadingContent = renderLeadingContent();
|
|
33
|
+
return (jsx(Tag$1, { ...otherProps, id: id, isDisabled: isDisabled,
|
|
34
|
+
// A given `textValue` wins: it is how a tag whose children are not plain text gets its accessible text.
|
|
35
|
+
textValue: textValue ?? (typeof children === 'string' ? children : undefined), "data-testid": tagTestId, className: (state) => cx(styles.root, styles.sizes[context.size].root.base,
|
|
36
|
+
// With avatar
|
|
37
|
+
avatarSrc && styles.sizes[context.size].root.withAvatar,
|
|
38
|
+
// With X button
|
|
39
|
+
(onClose || state.allowsRemoving) && styles.sizes[context.size].root.withClose,
|
|
40
|
+
// With dot
|
|
41
|
+
dot && styles.sizes[context.size].root.withDot,
|
|
42
|
+
// With count
|
|
43
|
+
typeof count === 'number' && styles.sizes[context.size].root.withCount,
|
|
44
|
+
// With checkbox
|
|
45
|
+
context.selectionMode !== 'none' && styles.sizes[context.size].root.withCheckbox,
|
|
46
|
+
// Disabled
|
|
47
|
+
isDisabled && 'cursor-not-allowed', typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, allowsRemoving }) => (jsxs(Fragment, { children: [jsxs("div", { className: cx('flex items-center gap-1', styles.sizes[context.size].content), children: [context.selectionMode !== 'none' && jsx(TagCheckbox, { size: context.size, isSelected: isSelected, isDisabled: isDisabled }), leadingContent, children, typeof count === 'number' && jsx("span", { className: cx(styles.count, styles.sizes[context.size].count), children: count })] }), (onClose || allowsRemoving) && (jsx(TagCloseX, { size: context.size, excludeFromTabOrder: allowsRemoving,
|
|
48
|
+
// Compared with `undefined`, not by truthiness: `0` and `''` are valid keys.
|
|
49
|
+
onPress: () => {
|
|
50
|
+
if (id !== undefined)
|
|
51
|
+
onClose?.(String(id));
|
|
52
|
+
}, "data-testid": closeTestId }))] })) }));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { Tag };
|
|
56
|
+
//# sourceMappingURL=Tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.js","sources":["../../../../../src/components/molecules/Tags/Tag/Tag.tsx"],"sourcesContent":[null],"names":["_jsx","AriaTag","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;AAgDA;;;;;AAKG;AACI,MAAM,GAAG,GAAG,CAAC,EAClB,EAAE,EACF,SAAS,EACT,oBAAoB,GAAG,IAAI,EAC3B,GAAG,EACH,QAAQ,GAAG,sBAAsB,EACjC,YAAY,EACZ,UAAU,EACV,KAAK,EACL,SAAS,EACT,QAAQ,EACR,OAAO,EACP,SAAS,EACT,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACe,KAAI;AAChC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC;AAC3C,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAChC,IAAA,MAAM,MAAM,GAAG,EAAE,KAAK,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK;IACnE,MAAM,SAAS,GAAG,UAAU,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,CAAA,IAAA,EAAO,MAAM,CAAA,CAAE,CAAC,GAAG,SAAS,CAAC;AAC1F,IAAA,MAAM,WAAW,GAAG,SAAS,GAAG,CAAA,EAAG,SAAS,CAAA,MAAA,CAAQ,GAAG,SAAS;IAEhE,MAAM,oBAAoB,GAAG,MAAK;AAChC,QAAA,IAAI,SAAS;AAAE,YAAA,OAAOA,GAAA,CAAC,SAAS,EAAA,EAAC,GAAG,EAAE,SAAS,EAAE,GA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Icons = require('@flipdish/ui-icons');
|
|
5
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var Tags_styles = require('../Tags.styles.cjs');
|
|
8
|
+
|
|
9
|
+
/** Small round avatar shown at the start of a `Tag`, falling back to a user icon when the image is missing or fails. */
|
|
10
|
+
const TagAvatar = ({ src, alt, contrastBorder = true, className }) => {
|
|
11
|
+
// Holds the source that failed, not a flag, so a new `src` is tried instead of staying on the fallback.
|
|
12
|
+
const [failedSrc, setFailedSrc] = React.useState();
|
|
13
|
+
return (jsxRuntime.jsx("div", { className: cx.cx(Tags_styles.styles.avatar, contrastBorder && 'outline-[0.5px] -outline-offset-[0.5px] outline-black/16', className), children: src && src !== failedSrc ? (jsxRuntime.jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src: src, alt: alt, onError: () => setFailedSrc(src) })) : (jsxRuntime.jsx(uiIcons.User01, { className: "size-3 stroke-[2.25px] text-fg-quaternary" })) }));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.TagAvatar = TagAvatar;
|
|
17
|
+
//# sourceMappingURL=TagAvatar.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagAvatar.cjs","sources":["../../../../../src/components/molecules/Tags/Tag/TagAvatar.tsx"],"sourcesContent":[null],"names":["useState","_jsx","cx","styles","User01"],"mappings":";;;;;;;;AAOA;AACO,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,EAAE,SAAS,EAAsE,KAAI;;IAE9I,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,EAAU;AAEpD,IAAA,QACEC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,KAAE,CAACC,kBAAM,CAAC,MAAM,EAAE,cAAc,IAAI,0DAA0D,EAAE,SAAS,CAAC,EAAA,QAAA,EACvH,GAAG,IAAI,GAAG,KAAK,SAAS,IACvBF,cAAA,CAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAqB,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC,GAAG,CAAC,EAAA,CAAI,KAEhHA,cAAA,CAACG,cAAM,EAAA,EAAC,SAAS,EAAC,2CAA2C,EAAA,CAAG,CACjE,EAAA,CACG;AAEV;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ImgHTMLAttributes } from 'react';
|
|
2
|
+
/** Small round avatar shown at the start of a `Tag`, falling back to a user icon when the image is missing or fails. */
|
|
3
|
+
export declare const TagAvatar: ({ src, alt, contrastBorder, className }: ImgHTMLAttributes<HTMLImageElement> & {
|
|
4
|
+
contrastBorder?: boolean;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=TagAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagAvatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Tags/Tag/TagAvatar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAGzD,wHAAwH;AACxH,eAAO,MAAM,SAAS,GAAI,yCAAgD,iBAAiB,CAAC,gBAAgB,CAAC,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,gCAa3I,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { User01 } from '@flipdish/ui-icons';
|
|
3
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { styles } from '../Tags.styles.js';
|
|
6
|
+
|
|
7
|
+
/** Small round avatar shown at the start of a `Tag`, falling back to a user icon when the image is missing or fails. */
|
|
8
|
+
const TagAvatar = ({ src, alt, contrastBorder = true, className }) => {
|
|
9
|
+
// Holds the source that failed, not a flag, so a new `src` is tried instead of staying on the fallback.
|
|
10
|
+
const [failedSrc, setFailedSrc] = useState();
|
|
11
|
+
return (jsx("div", { className: cx(styles.avatar, contrastBorder && 'outline-[0.5px] -outline-offset-[0.5px] outline-black/16', className), children: src && src !== failedSrc ? (jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src: src, alt: alt, onError: () => setFailedSrc(src) })) : (jsx(User01, { className: "size-3 stroke-[2.25px] text-fg-quaternary" })) }));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { TagAvatar };
|
|
15
|
+
//# sourceMappingURL=TagAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagAvatar.js","sources":["../../../../../src/components/molecules/Tags/Tag/TagAvatar.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;AAOA;AACO,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,EAAE,SAAS,EAAsE,KAAI;;IAE9I,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAU;AAEpD,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,IAAI,0DAA0D,EAAE,SAAS,CAAC,EAAA,QAAA,EACvH,GAAG,IAAI,GAAG,KAAK,SAAS,IACvBA,GAAA,CAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAqB,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC,GAAG,CAAC,EAAA,CAAI,KAEhHA,GAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,2CAA2C,EAAA,CAAG,CACjE,EAAA,CACG;AAEV;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagCheckbox.cjs","sources":["../../../../../src/components/molecules/Tags/Tag/TagCheckbox.tsx"],"sourcesContent":[null],"names":["_jsx","cx","styles"],"mappings":";;;;;;AAaO,MAAM,WAAW,GAAG,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,EAAoB,KAAI;IAC7G,QACEA,wBACE,SAAS,EAAEC,KAAE,CACX,mHAAmH,EACnHC,kBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAC1B,UAAU,IAAI,iCAAiC,EAC/C,UAAU,IAAI,+BAA+B,EAC7C,UAAU,IAAI,CAAC,UAAU,IAAI,aAAa,EAC1C,SAAS,IAAI,+CAA+C,EAC5D,SAAS,CACV,EAAA,QAAA,EAEDF,cAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EACc,MAAM,EAClB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,SAAS,EAAEC,KAAE,CACX,6EAA6E,EAC7EC,kBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAC1B,UAAU,IAAI,aAAa,CAC5B,EAAA,QAAA,EAEDF,cAAA,CAAA,MAAA,EAAA,EAAM,CAAC,EAAC,wCAAwC,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAA,CAAG,EAAA,CAClI,EAAA,CACF;AAEV;AACA,WAAW,CAAC,WAAW,GAAG,aAAa;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagCheckbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Tags/Tag/TagCheckbox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEtD,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE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@
|
|
|
1
|
+
{"version":3,"file":"TagCloseX.cjs","sources":["../../../../../src/components/molecules/Tags/Tag/TagCloseX.tsx"],"sourcesContent":[null],"names":["_jsx","AriaButton","cx","styles","XClose"],"mappings":";;;;;;;;AAaO,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,EAAkB,KAAI;IACrF,QACEA,eAACC,0BAAU,EAAA,EACT,IAAI,EAAC,QAAQ,EAAA,YAAA,EACF,iBAAiB,EAC5B,SAAS,EAAEC,KAAE,CACX,wRAAwR,EACxRC,kBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EACvB,SAAS,CACV,EAAA,GACG,UAAU,EAAA,QAAA,EAEdH,cAAA,CAACI,cAAM,IAAC,SAAS,EAAEF,KAAE,CAAC,wBAAwB,EAAEC,kBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAA,CAAI,EAAA,CACjE;AAEjB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagCloseX.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Tags/Tag/TagCloseX.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAwB,KAAK,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEtD,UAAU,cAAe,SAAQ,eAAe,EAAE,aAAa,CAAC,iBAAiB,CAAC;IAChF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,GAAI,oCAA2C,cAAc,gCAelF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagCloseX.js","sources":["../../../../../src/components/molecules/Tags/Tag/TagCloseX.tsx"],"sourcesContent":[null],"names":["_jsx","AriaButton"],"mappings":";;;;;;AAaO,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,EAAkB,KAAI;IACrF,QACEA,IAACC,MAAU,EAAA,EACT,IAAI,EAAC,QAAQ,EAAA,YAAA,EACF,iBAAiB,EAC5B,SAAS,EAAE,EAAE,CACX,wRAAwR,EACxR,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EACvB,SAAS,CACV,EAAA,GACG,UAAU,EAAA,QAAA,EAEdD,GAAA,CAAC,MAAM,IAAC,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAA,CAAI,EAAA,CACjE;AAEjB;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
5
|
+
var reactAriaComponents = require('react-aria-components');
|
|
6
|
+
var TagGroup_context = require('../providers/TagGroup.context.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Root container for a group of tags. Composes with `TagList` and `Tag` to support
|
|
10
|
+
* display-only, single-select, multi-select, and removable modes.
|
|
11
|
+
*
|
|
12
|
+
* @summary group of tags for filtering, selection or categorisation
|
|
13
|
+
*/
|
|
14
|
+
const TagGroup = ({ label, selectionMode = 'none', size = 'sm', children, 'data-testid': dataTestId, ...otherProps }) => {
|
|
15
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'tag-group', rootName: 'tag-group' });
|
|
16
|
+
return (jsxRuntime.jsx(TagGroup_context.TagGroupContext.Provider, { value: { selectionMode, size }, children: jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(reactAriaComponents.TagGroup, { "aria-label": label, selectionMode: selectionMode, disallowEmptySelection: selectionMode === 'single', ...otherProps, "data-testid": rootTestId, children: children }) }) }));
|
|
17
|
+
};
|
|
18
|
+
/** Container for the `Tag` items inside a `TagGroup`; a plain alias of react-aria-components' `TagList`. */
|
|
19
|
+
const TagList = reactAriaComponents.TagList;
|
|
20
|
+
|
|
21
|
+
exports.TagGroup = TagGroup;
|
|
22
|
+
exports.TagList = TagList;
|
|
23
|
+
//# sourceMappingURL=TagGroup.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagGroup.cjs","sources":["../../../../../src/components/molecules/Tags/TagGroup/TagGroup.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","_jsx","TagGroupContext","TestIdProvider","AriaTagGroup","AriaTagList"],"mappings":";;;;;;;AAqBA;;;;;AAKG;AACI,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,UAAU,EAAiB,KAAI;AAC5I,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IAEzG,QACEC,eAACC,gCAAe,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,YACtDD,cAAA,CAACE,0BAAc,IAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAC/BF,cAAA,CAACG,4BAAY,EAAA,EAAA,YAAA,EACC,KAAK,EACjB,aAAa,EAAE,aAAa,EAC5B,sBAAsB,EAAE,aAAa,KAAK,QAAQ,EAAA,GAC9C,UAAU,iBACD,UAAU,EAAA,QAAA,EAEtB,QAAQ,EAAA,CACI,EAAA,CACA,EAAA,CACQ;AAE/B;AAEA;AACO,MAAM,OAAO,GAAGC;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RefAttributes } from 'react';
|
|
2
|
+
import { type TagGroupProps as AriaTagGroupProps } from 'react-aria-components';
|
|
3
|
+
import type { TagSize } from '../Tags.styles';
|
|
4
|
+
export interface TagGroupProps extends AriaTagGroupProps, RefAttributes<HTMLDivElement> {
|
|
5
|
+
/** Accessible name of the group, applied as its `aria-label`. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Size of every `Tag` in the group, shared through context. */
|
|
8
|
+
size?: TagSize;
|
|
9
|
+
/**
|
|
10
|
+
* Overrides the derived root `data-testid` (defaults to `fd-tag-group`).
|
|
11
|
+
* Tags derive their ids from this prefix, so overriding it re-roots every
|
|
12
|
+
* non-overridden `Tag` beneath it.
|
|
13
|
+
*/
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Root container for a group of tags. Composes with `TagList` and `Tag` to support
|
|
18
|
+
* display-only, single-select, multi-select, and removable modes.
|
|
19
|
+
*
|
|
20
|
+
* @summary group of tags for filtering, selection or categorisation
|
|
21
|
+
*/
|
|
22
|
+
export declare const TagGroup: ({ label, selectionMode, size, children, "data-testid": dataTestId, ...otherProps }: TagGroupProps) => import("react").JSX.Element;
|
|
23
|
+
/** Container for the `Tag` items inside a `TagGroup`; a plain alias of react-aria-components' `TagList`. */
|
|
24
|
+
export declare const TagList: <T>(props: import("react-aria-components").TagListProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
25
|
+
//# sourceMappingURL=TagGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagGroup.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/Tags/TagGroup/TagGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAA4B,KAAK,aAAa,IAAI,iBAAiB,EAA0B,MAAM,uBAAuB,CAAC;AAElI,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,aAAa,CAAC,cAAc,CAAC;IACrF,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,oFAAoG,aAAa,gCAkBzI,CAAC;AAEF,4GAA4G;AAC5G,eAAO,MAAM,OAAO,oLAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useResolvedTestId, TestIdProvider } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
3
|
+
import { TagList as TagList$1, TagGroup as TagGroup$1 } from 'react-aria-components';
|
|
4
|
+
import { TagGroupContext } from '../providers/TagGroup.context.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Root container for a group of tags. Composes with `TagList` and `Tag` to support
|
|
8
|
+
* display-only, single-select, multi-select, and removable modes.
|
|
9
|
+
*
|
|
10
|
+
* @summary group of tags for filtering, selection or categorisation
|
|
11
|
+
*/
|
|
12
|
+
const TagGroup = ({ label, selectionMode = 'none', size = 'sm', children, 'data-testid': dataTestId, ...otherProps }) => {
|
|
13
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'tag-group', rootName: 'tag-group' });
|
|
14
|
+
return (jsx(TagGroupContext.Provider, { value: { selectionMode, size }, children: jsx(TestIdProvider, { value: rootTestId, children: jsx(TagGroup$1, { "aria-label": label, selectionMode: selectionMode, disallowEmptySelection: selectionMode === 'single', ...otherProps, "data-testid": rootTestId, children: children }) }) }));
|
|
15
|
+
};
|
|
16
|
+
/** Container for the `Tag` items inside a `TagGroup`; a plain alias of react-aria-components' `TagList`. */
|
|
17
|
+
const TagList = TagList$1;
|
|
18
|
+
|
|
19
|
+
export { TagGroup, TagList };
|
|
20
|
+
//# sourceMappingURL=TagGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagGroup.js","sources":["../../../../../src/components/molecules/Tags/TagGroup/TagGroup.tsx"],"sourcesContent":[null],"names":["_jsx","AriaTagGroup","AriaTagList"],"mappings":";;;;;AAqBA;;;;;AAKG;AACI,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,UAAU,EAAiB,KAAI;AAC5I,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IAEzG,QACEA,IAAC,eAAe,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,YACtDA,GAAA,CAAC,cAAc,IAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAC/BA,GAAA,CAACC,UAAY,EAAA,EAAA,YAAA,EACC,KAAK,EACjB,aAAa,EAAE,aAAa,EAC5B,sBAAsB,EAAE,aAAa,KAAK,QAAQ,EAAA,GAC9C,UAAU,iBACD,UAAU,EAAA,QAAA,EAEtB,QAAQ,EAAA,CACI,EAAA,CACA,EAAA,CACQ;AAE/B;AAEA;AACO,MAAM,OAAO,GAAGC;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Works out the selection after a tag is pressed, as the native `TagGroup` applies it.
|
|
3
|
+
*
|
|
4
|
+
* @param selectedKeys The keys selected before the press; never mutated.
|
|
5
|
+
* @param id The key of the pressed tag.
|
|
6
|
+
* @param selectionMode `'single'` swaps the selection to the pressed tag and never empties it; `'multiple'` toggles the pressed tag.
|
|
7
|
+
* @returns The new selection, or `undefined` when the press changes nothing.
|
|
8
|
+
*/
|
|
9
|
+
export declare const selectionAfterPress: <Key>(selectedKeys: ReadonlySet<Key>, id: Key, selectionMode: "none" | "single" | "multiple") => Set<Key> | undefined;
|
|
10
|
+
//# sourceMappingURL=tagSelection.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tagSelection.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,GAAG,EACrC,cAAc,WAAW,CAAC,GAAG,CAAC,EAC9B,IAAI,GAAG,EACP,eAAe,MAAM,GAAG,QAAQ,GAAG,UAAU,KAC5C,GAAG,CAAC,GAAG,CAAC,GAAG,SAWb,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Shared `Tags` style config, read by
|
|
4
|
+
* Shared `Tags` style config, read by `Tag` and `TagGroup` on web and React Native.
|
|
5
5
|
*
|
|
6
6
|
* Complete literal class names only — Tailwind scans source for whole candidates.
|
|
7
7
|
* `native` holds pixel sizes and light-mode hex colours that React Native needs as
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared `Tags` style config, read by
|
|
2
|
+
* Shared `Tags` style config, read by `Tag` and `TagGroup` on web and React Native.
|
|
3
3
|
*
|
|
4
4
|
* Complete literal class names only — Tailwind scans source for whole candidates.
|
|
5
5
|
* `native` holds pixel sizes and light-mode hex colours that React Native needs as
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared `Tags` style config, read by
|
|
2
|
+
* Shared `Tags` style config, read by `Tag` and `TagGroup` on web and React Native.
|
|
3
3
|
*
|
|
4
4
|
* Complete literal class names only — Tailwind scans source for whole candidates.
|
|
5
5
|
* `native` holds pixel sizes and light-mode hex colours that React Native needs as
|
|
@@ -1,69 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
|
-
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
8
|
-
var React = require('react');
|
|
9
|
-
var reactAriaComponents = require('react-aria-components');
|
|
10
|
-
var TagCheckbox = require('./components/TagCheckbox.cjs');
|
|
11
|
-
var TagCloseX = require('./components/TagCloseX.cjs');
|
|
12
|
-
var Tags_styles = require('./Tags.styles.cjs');
|
|
3
|
+
var Tag = require('./Tag/Tag.cjs');
|
|
4
|
+
var TagAvatar = require('./Tag/TagAvatar.cjs');
|
|
5
|
+
var TagGroup = require('./TagGroup/TagGroup.cjs');
|
|
13
6
|
|
|
14
|
-
/** Small round avatar shown at the start of a `Tag`, falling back to a user icon when the image is missing or fails. */
|
|
15
|
-
const TagAvatar = ({ src, alt, contrastBorder = true, className }) => {
|
|
16
|
-
const [isFailed, setIsFailed] = React.useState(false);
|
|
17
|
-
return (jsxRuntime.jsx("div", { className: cx.cx(Tags_styles.styles.avatar, contrastBorder && 'outline-[0.5px] -outline-offset-[0.5px] outline-black/16', className), children: src && !isFailed ? (jsxRuntime.jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src: src, alt: alt, onError: () => setIsFailed(true) })) : (jsxRuntime.jsx(uiIcons.User01, { className: "size-3 stroke-[2.25px] text-fg-quaternary" })) }));
|
|
18
|
-
};
|
|
19
|
-
const TagGroupContext = React.createContext({
|
|
20
|
-
selectionMode: 'none',
|
|
21
|
-
size: 'sm',
|
|
22
|
-
});
|
|
23
|
-
/**
|
|
24
|
-
* Root container for a group of tags. Composes with `TagList` and `Tag` to support
|
|
25
|
-
* display-only, single-select, multi-select, and removable modes.
|
|
26
|
-
*
|
|
27
|
-
* @summary group of tags for filtering, selection or categorisation
|
|
28
|
-
*/
|
|
29
|
-
const TagGroup = ({ label, selectionMode = 'none', size = 'sm', children, 'data-testid': dataTestId, ...otherProps }) => {
|
|
30
|
-
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'tag-group', rootName: 'tag-group' });
|
|
31
|
-
return (jsxRuntime.jsx(TagGroupContext.Provider, { value: { selectionMode, size }, children: jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(reactAriaComponents.TagGroup, { "aria-label": label, selectionMode: selectionMode, disallowEmptySelection: selectionMode === 'single', ...otherProps, "data-testid": rootTestId, children: children }) }) }));
|
|
32
|
-
};
|
|
33
|
-
/** Container for the `Tag` items inside a `TagGroup`; a plain alias of react-aria-components' `TagList`. */
|
|
34
|
-
const TagList = reactAriaComponents.TagList;
|
|
35
|
-
/** A single tag inside a `TagList`, with an optional avatar or dot, count, selection checkbox and remove button. */
|
|
36
|
-
const Tag = ({ id, avatarSrc, avatarContrastBorder = true, dot, dotColor = 'fg-success-secondary', dotClassName, isDisabled, count, className, children, onClose, 'data-testid': dataTestId, }) => {
|
|
37
|
-
const context = React.useContext(TagGroupContext);
|
|
38
|
-
const prefix = testIdUtils.useTestIdPrefix();
|
|
39
|
-
const idPart = id !== undefined ? testIdUtils.slugifyTestId(String(id)) : 'tag';
|
|
40
|
-
const tagTestId = dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, `tag-${idPart}`) : undefined);
|
|
41
|
-
const closeTestId = tagTestId ? `${tagTestId}-close` : undefined;
|
|
42
|
-
const renderLeadingContent = () => {
|
|
43
|
-
if (avatarSrc)
|
|
44
|
-
return jsxRuntime.jsx(TagAvatar, { src: avatarSrc, alt: "Avatar", contrastBorder: avatarContrastBorder });
|
|
45
|
-
if (dot)
|
|
46
|
-
return jsxRuntime.jsx(Dot.Dot, { color: dotColor, className: dotClassName, size: "sm" });
|
|
47
|
-
return null;
|
|
48
|
-
};
|
|
49
|
-
const leadingContent = renderLeadingContent();
|
|
50
|
-
return (jsxRuntime.jsx(reactAriaComponents.Tag, { id: id, isDisabled: isDisabled, textValue: typeof children === 'string' ? children : undefined, "data-testid": tagTestId, className: (state) => cx.cx(Tags_styles.styles.root, Tags_styles.styles.sizes[context.size].root.base,
|
|
51
|
-
// With avatar
|
|
52
|
-
avatarSrc && Tags_styles.styles.sizes[context.size].root.withAvatar,
|
|
53
|
-
// With X button
|
|
54
|
-
(onClose || state.allowsRemoving) && Tags_styles.styles.sizes[context.size].root.withClose,
|
|
55
|
-
// With dot
|
|
56
|
-
dot && Tags_styles.styles.sizes[context.size].root.withDot,
|
|
57
|
-
// With count
|
|
58
|
-
typeof count === 'number' && Tags_styles.styles.sizes[context.size].root.withCount,
|
|
59
|
-
// With checkbox
|
|
60
|
-
context.selectionMode !== 'none' && Tags_styles.styles.sizes[context.size].root.withCheckbox,
|
|
61
|
-
// Disabled
|
|
62
|
-
isDisabled && 'cursor-not-allowed', typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, allowsRemoving }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex items-center gap-1', Tags_styles.styles.sizes[context.size].content), children: [context.selectionMode !== 'none' && jsxRuntime.jsx(TagCheckbox.TagCheckbox, { size: context.size, isSelected: isSelected, isDisabled: isDisabled }), leadingContent, children, typeof count === 'number' && jsxRuntime.jsx("span", { className: cx.cx(Tags_styles.styles.count, Tags_styles.styles.sizes[context.size].count), children: count })] }), (onClose || allowsRemoving) && (jsxRuntime.jsx(TagCloseX.TagCloseX, { size: context.size, excludeFromTabOrder: allowsRemoving, onPress: () => id && onClose?.(id.toString()), "data-testid": closeTestId }))] })) }));
|
|
63
|
-
};
|
|
64
7
|
|
|
65
|
-
|
|
66
|
-
exports.
|
|
67
|
-
exports.
|
|
68
|
-
exports.
|
|
8
|
+
|
|
9
|
+
exports.Tag = Tag.Tag;
|
|
10
|
+
exports.TagAvatar = TagAvatar.TagAvatar;
|
|
11
|
+
exports.TagGroup = TagGroup.TagGroup;
|
|
12
|
+
exports.TagList = TagGroup.TagList;
|
|
69
13
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,58 +1,17 @@
|
|
|
1
|
-
import { type DotColor } from '@flipdish/ui-library/components/atoms/Dot';
|
|
2
|
-
import { type ImgHTMLAttributes, type PropsWithChildren, type RefAttributes } from 'react';
|
|
3
|
-
import { type TagGroupProps as AriaTagGroupProps, type TagProps as AriaTagProps } from 'react-aria-components';
|
|
4
|
-
import { type TagSize } from './Tags.styles';
|
|
5
|
-
export type { DotColor } from '@flipdish/ui-library/components/atoms/Dot';
|
|
6
|
-
export type { TagSize } from './Tags.styles';
|
|
7
|
-
/** Small round avatar shown at the start of a `Tag`, falling back to a user icon when the image is missing or fails. */
|
|
8
|
-
export declare const TagAvatar: ({ src, alt, contrastBorder, className }: ImgHTMLAttributes<HTMLImageElement> & {
|
|
9
|
-
contrastBorder?: boolean;
|
|
10
|
-
}) => import("react").JSX.Element;
|
|
11
|
-
export interface TagItem {
|
|
12
|
-
id: string;
|
|
13
|
-
label: string;
|
|
14
|
-
count?: number;
|
|
15
|
-
avatarSrc?: string;
|
|
16
|
-
avatarContrastBorder?: boolean;
|
|
17
|
-
dot?: boolean;
|
|
18
|
-
/** Semantic fill for the status dot; same tokens as `Dot`'s `color`. Defaults to `fg-success-secondary`. */
|
|
19
|
-
dotColor?: DotColor;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Prefer `dotColor`. Web-only `text-*` class merged onto the status `Dot` via
|
|
22
|
-
* `currentColor` — not available on React Native.
|
|
23
|
-
*/
|
|
24
|
-
dotClassName?: string;
|
|
25
|
-
isDisabled?: boolean;
|
|
26
|
-
onClose?: (id: string) => void;
|
|
27
|
-
}
|
|
28
|
-
export interface TagGroupProps extends AriaTagGroupProps, RefAttributes<HTMLDivElement> {
|
|
29
|
-
/** Accessible name of the group, applied as its `aria-label`. */
|
|
30
|
-
label: string;
|
|
31
|
-
/** Size of every `Tag` in the group, shared through context. */
|
|
32
|
-
size?: TagSize;
|
|
33
|
-
/**
|
|
34
|
-
* Overrides the derived root `data-testid` (defaults to `fd-tag-group`).
|
|
35
|
-
* Tags derive their ids from this prefix, so overriding it re-roots every
|
|
36
|
-
* non-overridden `Tag` beneath it.
|
|
37
|
-
*/
|
|
38
|
-
'data-testid'?: string;
|
|
39
|
-
}
|
|
40
1
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
2
|
+
* Tags for filtering, selection and categorisation: `TagGroup` and `TagList` for the set, and `Tag` with its
|
|
3
|
+
* `TagAvatar` for one item in it.
|
|
43
4
|
*
|
|
44
|
-
*
|
|
5
|
+
* Explicit named re-exports on purpose: `export *` would publish every symbol of every private file (import paths are
|
|
6
|
+
* the public API here), so this list is the single source of truth for what Tags exposes.
|
|
7
|
+
* Each member's implementation, stories and docs live in its own folder (`Tag/Tag.tsx`), never as `index.tsx`: the
|
|
8
|
+
* `exports` wildcard would make that folder a public path.
|
|
45
9
|
*/
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*/
|
|
54
|
-
'data-testid'?: string;
|
|
55
|
-
}
|
|
56
|
-
/** A single tag inside a `TagList`, with an optional avatar or dot, count, selection checkbox and remove button. */
|
|
57
|
-
export declare const Tag: ({ id, avatarSrc, avatarContrastBorder, dot, dotColor, dotClassName, isDisabled, count, className, children, onClose, "data-testid": dataTestId, }: PropsWithChildren<TagProps>) => import("react").JSX.Element;
|
|
10
|
+
export type { DotColor } from '@flipdish/ui-library/components/atoms/Dot';
|
|
11
|
+
export type { TagItem } from './Tag/Tag';
|
|
12
|
+
export { Tag } from './Tag/Tag';
|
|
13
|
+
export { TagAvatar } from './Tag/TagAvatar';
|
|
14
|
+
export type { TagGroupProps } from './TagGroup/TagGroup';
|
|
15
|
+
export { TagGroup, TagList } from './TagGroup/TagGroup';
|
|
16
|
+
export type { TagSize } from './Tags.styles';
|
|
58
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Tags/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Tags/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|