@indico-data/design-system 3.18.0 → 3.20.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/.eslintrc.js +87 -2
- package/.husky/pre-commit +2 -0
- package/.vscode/settings.json +10 -1
- package/lib/components/badge/Badge.d.ts +1 -1
- package/lib/components/badge/Badge.stories.d.ts +1 -1
- package/lib/components/button/Button.d.ts +2 -2
- package/lib/components/button/Button.stories.d.ts +1 -1
- package/lib/components/button/types.d.ts +1 -1
- package/lib/components/card/Card.d.ts +1 -1
- package/lib/components/card/Card.stories.d.ts +1 -1
- package/lib/components/floatUI/FloatUI.d.ts +1 -1
- package/lib/components/floatUI/FloatUI.stories.d.ts +2 -2
- package/lib/components/floatUI/types.d.ts +2 -2
- package/lib/components/forms/checkbox/Checkbox.stories.d.ts +1 -1
- package/lib/components/forms/date/datePicker/DatePicker.d.ts +1 -1
- package/lib/components/forms/date/datePicker/DatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/datePicker/contants.d.ts +1 -1
- package/lib/components/forms/date/datePicker/types.d.ts +8 -1
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +7 -4
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/iconTriggerDatePicker/types.d.ts +5 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +4 -3
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +7 -4
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/inputDateRangePicker/types.d.ts +7 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +4 -3
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.d.ts +1 -1
- package/lib/components/forms/form/Form.d.ts +1 -1
- package/lib/components/forms/form/Form.stories.d.ts +1 -1
- package/lib/components/forms/input/Input.d.ts +2 -2
- package/lib/components/forms/input/Input.stories.d.ts +1 -1
- package/lib/components/forms/numberInput/NumberInput.d.ts +2 -2
- package/lib/components/forms/numberInput/NumberInput.stories.d.ts +1 -1
- package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -1
- package/lib/components/forms/passwordInput/PasswordInput.stories.d.ts +1 -1
- package/lib/components/forms/radio/Radio.stories.d.ts +1 -1
- package/lib/components/forms/select/Select.d.ts +4 -2
- package/lib/components/forms/select/Select.stories.d.ts +4 -4
- package/lib/components/forms/select/types.d.ts +11 -1
- package/lib/components/forms/subcomponents/Label.d.ts +5 -1
- package/lib/components/forms/subcomponents/types.d.ts +5 -0
- package/lib/components/forms/textarea/Textarea.d.ts +1 -1
- package/lib/components/forms/textarea/Textarea.stories.d.ts +1 -1
- package/lib/components/forms/timePicker/TimePicker.d.ts +4 -1
- package/lib/components/forms/timePicker/types.d.ts +5 -0
- package/lib/components/forms/toggle/Toggle.stories.d.ts +1 -1
- package/lib/components/grid/col/Col.d.ts +1 -1
- package/lib/components/grid/col/Col.stories.d.ts +1 -1
- package/lib/components/grid/container/Container.d.ts +1 -1
- package/lib/components/grid/container/Container.stories.d.ts +1 -1
- package/lib/components/grid/row/Row.d.ts +1 -1
- package/lib/components/grid/row/Row.stories.d.ts +1 -1
- package/lib/components/icons/Icon.d.ts +1 -1
- package/lib/components/icons/Icon.stories.d.ts +2 -2
- package/lib/components/icons/indicons.d.ts +1 -1
- package/lib/components/icons/types.d.ts +4 -4
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +1 -1
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +1 -1
- package/lib/components/menu/Menu.stories.d.ts +2 -2
- package/lib/components/modal/ConfirmationModal.d.ts +2 -2
- package/lib/components/modal/Modal.d.ts +2 -2
- package/lib/components/modal/Modal.stories.d.ts +6 -2
- package/lib/components/modal/types.d.ts +21 -7
- package/lib/components/pagination/Pagination.d.ts +2 -2
- package/lib/components/pagination/Pagination.stories.d.ts +1 -1
- package/lib/components/pagination/index.d.ts +1 -0
- package/lib/components/pagination/types.d.ts +13 -0
- package/lib/components/pill/Pill.d.ts +1 -1
- package/lib/components/pill/Pill.stories.d.ts +1 -1
- package/lib/components/pill/types.d.ts +2 -2
- package/lib/components/skeleton/Skeleton.stories.d.ts +1 -1
- package/lib/components/stepper/Stepper.d.ts +2 -2
- package/lib/components/stepper/Stepper.stories.d.ts +1 -1
- package/lib/components/stepper/components/BackNavigation.d.ts +2 -1
- package/lib/components/stepper/components/Legend.d.ts +1 -1
- package/lib/components/stepper/components/NextNavigation.d.ts +3 -1
- package/lib/components/stepper/types.d.ts +12 -1
- package/lib/components/table/LoadingComponent.d.ts +5 -1
- package/lib/components/table/Table.d.ts +1 -1
- package/lib/components/table/Table.stories.d.ts +2 -2
- package/lib/components/table/components/HorizontalStickyHeader.d.ts +4 -1
- package/lib/components/table/components/helpers.d.ts +1 -1
- package/lib/components/table/hooks/usePinnedColumnsManager.d.ts +2 -2
- package/lib/components/table/sampleData.d.ts +1 -1
- package/lib/components/table/types.d.ts +20 -2
- package/lib/components/table/utils/processColumns.d.ts +2 -2
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +20 -3
- package/lib/components/tanstackTable/TanstackTable.d.ts +2 -2
- package/lib/components/tanstackTable/TanstackTable.stories.d.ts +2 -2
- package/lib/components/tanstackTable/__tests__/__mocks__/test-mock-data.d.ts +1 -1
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +2 -2
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.stories.d.ts +1 -1
- package/lib/components/tanstackTable/components/NoResults/NoResults.d.ts +2 -1
- package/lib/components/tanstackTable/components/TableBody/TableBody.d.ts +1 -1
- package/lib/components/tanstackTable/components/TableHeader/TableHeader.d.ts +1 -1
- package/lib/components/tanstackTable/components/TableLoading/TableLoading.d.ts +1 -1
- package/lib/components/tanstackTable/components/TablePagination/TablePagination.d.ts +3 -1
- package/lib/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.d.ts +2 -2
- package/lib/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.d.ts +2 -2
- package/lib/components/tanstackTable/docs/withRowClick/WithRowClick.stories.d.ts +2 -2
- package/lib/components/tanstackTable/helpers.d.ts +2 -2
- package/lib/components/tanstackTable/mock-data/table-configuration.d.ts +2 -2
- package/lib/components/tanstackTable/useTanstackTable.d.ts +1 -1
- package/lib/components/toast/Toast.stories.d.ts +1 -1
- package/lib/components/tooltip/Tooltip.d.ts +2 -2
- package/lib/components/tooltip/Tooltip.stories.d.ts +1 -1
- package/lib/components/truncate/Truncate.d.ts +1 -1
- package/lib/components/truncate/Truncate.stories.d.ts +2 -2
- package/lib/components/truncate/types.d.ts +1 -1
- package/lib/docs/BaseColorPalette/BaseColorsPalette.stories.d.ts +1 -1
- package/lib/docs/SemanticTokens/ColorSwatch.d.ts +1 -1
- package/lib/docs/SemanticTokens/SemanticTokens.stories.d.ts +1 -1
- package/lib/index.d.ts +165 -45
- package/lib/index.esm.js +253 -170
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +253 -170
- package/lib/index.js.map +1 -1
- package/lib/setup/setupIcons.d.ts +1 -1
- package/lib/storybook/formArgTypes.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderColor.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderRadius.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderStyles.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderThickness.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/colors/UtilityClasses.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/sizing/Sizing.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/typography/Typography.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.d.ts +1 -1
- package/lib/types.d.ts +4 -4
- package/package.json +8 -2
- package/src/components/badge/Badge.stories.tsx +4 -3
- package/src/components/badge/Badge.tsx +2 -1
- package/src/components/badge/__tests__/Badge.test.tsx +1 -0
- package/src/components/button/Button.stories.tsx +5 -4
- package/src/components/button/Button.tsx +12 -22
- package/src/components/button/__tests__/Button.test.tsx +31 -28
- package/src/components/button/types.ts +1 -1
- package/src/components/card/Card.stories.tsx +2 -1
- package/src/components/card/Card.tsx +2 -1
- package/src/components/card/__tests__/Card.test.tsx +1 -0
- package/src/components/floatUI/FloatUI.stories.tsx +3 -2
- package/src/components/floatUI/FloatUI.tsx +6 -7
- package/src/components/floatUI/__tests__/FloatUI.test.tsx +5 -3
- package/src/components/floatUI/types.ts +2 -2
- package/src/components/forms/checkbox/Checkbox.stories.tsx +3 -2
- package/src/components/forms/checkbox/Checkbox.tsx +1 -1
- package/src/components/forms/checkbox/__tests__/Checkbox.test.tsx +2 -1
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +12 -1
- package/src/components/forms/date/datePicker/DatePicker.tsx +35 -25
- package/src/components/forms/date/datePicker/__tests__/DatePicker.test.tsx +1 -0
- package/src/components/forms/date/datePicker/contants.ts +1 -1
- package/src/components/forms/date/datePicker/types.ts +16 -8
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +16 -2
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +21 -8
- package/src/components/forms/date/iconTriggerDatePicker/__tests__/IconTriggerDatePicker.test.tsx +2 -1
- package/src/components/forms/date/iconTriggerDatePicker/types.ts +5 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +4 -2
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +18 -13
- package/src/components/forms/date/inputDatePicker/__tests__/SingleInputDatePicker.test.tsx +4 -2
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +15 -4
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +29 -23
- package/src/components/forms/date/inputDateRangePicker/__tests__/InputDateRangePicker.test.tsx +2 -2
- package/src/components/forms/date/inputDateRangePicker/types.ts +7 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +9 -5
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +18 -13
- package/src/components/forms/form/Form.stories.tsx +7 -6
- package/src/components/forms/form/Form.tsx +1 -1
- package/src/components/forms/form/__tests__/Form.test.tsx +7 -4
- package/src/components/forms/input/Input.stories.tsx +6 -3
- package/src/components/forms/input/Input.tsx +4 -3
- package/src/components/forms/input/__tests__/Input.test.tsx +5 -3
- package/src/components/forms/numberInput/NumberInput.stories.tsx +5 -2
- package/src/components/forms/numberInput/NumberInput.tsx +6 -3
- package/src/components/forms/numberInput/__tests__/NumberInput.test.tsx +2 -1
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +6 -3
- package/src/components/forms/passwordInput/PasswordInput.tsx +12 -3
- package/src/components/forms/passwordInput/__tests__/PasswordInput.test.tsx +3 -4
- package/src/components/forms/radio/Radio.stories.tsx +5 -2
- package/src/components/forms/radio/__tests__/Radio.test.tsx +3 -2
- package/src/components/forms/select/Select.stories.tsx +11 -9
- package/src/components/forms/select/Select.tsx +21 -6
- package/src/components/forms/select/__tests__/Select.test.tsx +2 -2
- package/src/components/forms/select/types.ts +13 -1
- package/src/components/forms/subcomponents/Label.tsx +24 -4
- package/src/components/forms/subcomponents/__tests__/Label.test.tsx +1 -0
- package/src/components/forms/subcomponents/types.ts +5 -0
- package/src/components/forms/textarea/Textarea.stories.tsx +5 -2
- package/src/components/forms/textarea/Textarea.tsx +5 -4
- package/src/components/forms/textarea/__tests__/Textarea.test.tsx +3 -3
- package/src/components/forms/timePicker/TimePicker.stories.tsx +14 -2
- package/src/components/forms/timePicker/TimePicker.tsx +15 -5
- package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +2 -1
- package/src/components/forms/timePicker/types.ts +5 -0
- package/src/components/forms/toggle/Toggle.stories.tsx +3 -2
- package/src/components/forms/toggle/__tests__/Toggle.test.tsx +3 -2
- package/src/components/grid/col/Col.stories.tsx +2 -1
- package/src/components/grid/col/Col.tsx +1 -1
- package/src/components/grid/container/Container.stories.tsx +2 -1
- package/src/components/grid/container/Container.tsx +1 -1
- package/src/components/grid/row/Row.stories.tsx +2 -1
- package/src/components/grid/row/Row.tsx +1 -1
- package/src/components/icons/Icon.stories.tsx +11 -4
- package/src/components/icons/Icon.tsx +4 -3
- package/src/components/icons/__tests__/Icon.test.tsx +1 -0
- package/src/components/icons/indicons.tsx +3 -3
- package/src/components/icons/types.ts +5 -4
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +2 -1
- package/src/components/loading-indicators/BarSpinner/__tests__/BarSpinner.test.tsx +1 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +2 -1
- package/src/components/menu/Menu.stories.tsx +3 -2
- package/src/components/menu/Menu.test.tsx +1 -1
- package/src/components/menu/Menu.tsx +1 -1
- package/src/components/modal/ConfirmationModal.tsx +25 -18
- package/src/components/modal/Modal.stories.tsx +62 -28
- package/src/components/modal/Modal.tsx +9 -2
- package/src/components/modal/__tests__/Modal.test.tsx +1 -0
- package/src/components/modal/types.ts +23 -7
- package/src/components/pagination/Pagination.stories.tsx +14 -2
- package/src/components/pagination/Pagination.tsx +18 -8
- package/src/components/pagination/__tests__/Pagination.test.tsx +1 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pagination/types.ts +14 -0
- package/src/components/pill/Pill.stories.tsx +10 -6
- package/src/components/pill/Pill.tsx +2 -1
- package/src/components/pill/__tests__/Pill.test.tsx +4 -1
- package/src/components/pill/types.ts +4 -2
- package/src/components/skeleton/Skeleton.stories.tsx +2 -1
- package/src/components/skeleton/__tests__/Skeleton.test.tsx +1 -0
- package/src/components/stepper/Stepper.stories.tsx +20 -7
- package/src/components/stepper/Stepper.tsx +18 -3
- package/src/components/stepper/__tests__/Stepper.tests.tsx +5 -4
- package/src/components/stepper/components/BackNavigation.tsx +5 -3
- package/src/components/stepper/components/Legend.tsx +4 -3
- package/src/components/stepper/components/NextNavigation.tsx +15 -5
- package/src/components/stepper/examples/MixedExample.tsx +4 -3
- package/src/components/stepper/examples/OptionalStepsExample.tsx +4 -3
- package/src/components/stepper/examples/RequiredStepsExample.tsx +4 -3
- package/src/components/stepper/examples/commonExample/CommonExample.tsx +4 -3
- package/src/components/stepper/examples/commonExample/steps/StepOne.tsx +1 -0
- package/src/components/stepper/examples/commonExample/steps/StepThree.tsx +1 -0
- package/src/components/stepper/examples/commonExample/steps/StepTwo.tsx +1 -0
- package/src/components/stepper/types.ts +13 -1
- package/src/components/table/LoadingComponent.tsx +6 -2
- package/src/components/table/Table.stories.tsx +19 -5
- package/src/components/table/Table.tsx +16 -5
- package/src/components/table/__tests__/Table.test.tsx +2 -1
- package/src/components/table/components/HorizontalStickyHeader.tsx +14 -2
- package/src/components/table/components/TablePagination.tsx +1 -1
- package/src/components/table/components/__tests__/HorizontalStickyHeader.test.tsx +3 -3
- package/src/components/table/components/__tests__/TablePagination.test.tsx +1 -0
- package/src/components/table/components/helpers.ts +1 -1
- package/src/components/table/hooks/usePinnedColumnsManager.ts +7 -2
- package/src/components/table/sampleData.tsx +1 -3
- package/src/components/table/types.ts +25 -6
- package/src/components/table/utils/processColumns.tsx +4 -2
- package/src/components/tanstackTable/TankstackTable.types.ts +21 -3
- package/src/components/tanstackTable/TanstackTable.stories.tsx +14 -11
- package/src/components/tanstackTable/TanstackTable.tsx +28 -18
- package/src/components/tanstackTable/__tests__/TanstackTable.test.tsx +2 -1
- package/src/components/tanstackTable/__tests__/__mocks__/test-mock-data.tsx +2 -1
- package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +6 -3
- package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +7 -3
- package/src/components/tanstackTable/components/ActionBar/__tests__/ActionBar.test.tsx +4 -1
- package/src/components/tanstackTable/components/NoResults/NoResults.tsx +9 -3
- package/src/components/tanstackTable/components/NoResults/__tests__/NoResult.test.tsx +1 -0
- package/src/components/tanstackTable/components/TableBody/TableBody.tsx +2 -1
- package/src/components/tanstackTable/components/TableHeader/TableHeader.tsx +3 -2
- package/src/components/tanstackTable/components/TableLoading/TableLoading.tsx +2 -1
- package/src/components/tanstackTable/components/TablePagination/TablePagination.tsx +4 -1
- package/src/components/tanstackTable/components/TablePagination/__tests__/TablePagination.test.tsx +1 -0
- package/src/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.tsx +5 -5
- package/src/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.tsx +5 -4
- package/src/components/tanstackTable/docs/withRowClick/WithRowClick.stories.tsx +5 -4
- package/src/components/tanstackTable/helpers.ts +2 -2
- package/src/components/tanstackTable/mock-data/table-configuration.tsx +7 -4
- package/src/components/tanstackTable/useTanstackTable.tsx +1 -2
- package/src/components/toast/Toast.stories.tsx +2 -1
- package/src/components/tooltip/Tooltip.stories.tsx +3 -2
- package/src/components/tooltip/Tooltip.tsx +2 -2
- package/src/components/truncate/Truncate.stories.tsx +3 -2
- package/src/components/truncate/Truncate.tsx +5 -4
- package/src/components/truncate/__tests__/Truncate.test.tsx +1 -0
- package/src/components/truncate/types.ts +1 -1
- package/src/docs/BaseColorPalette/BaseColorPalette.tsx +1 -0
- package/src/docs/BaseColorPalette/BaseColorsPalette.stories.tsx +2 -1
- package/src/docs/BaseColorPalette/Swatch.tsx +2 -1
- package/src/docs/SemanticTokens/ColorSwatch.tsx +1 -1
- package/src/docs/SemanticTokens/SemanticTokens.stories.tsx +2 -2
- package/src/index.ts +1 -1
- package/src/setup/setupIcons.ts +2 -2
- package/src/storybook/formArgTypes.ts +12 -1
- package/src/storybook/iconNames.ts +1 -0
- package/src/storybookDocs/Permafrost.mdx +8 -0
- package/src/stylesAndAnimations/borders/BorderColor.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderColor.tsx +0 -1
- package/src/stylesAndAnimations/borders/BorderRadius.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderRadius.tsx +0 -1
- package/src/stylesAndAnimations/borders/BorderStyles.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderStyles.tsx +0 -1
- package/src/stylesAndAnimations/borders/BorderThickness.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderThickness.tsx +0 -1
- package/src/stylesAndAnimations/colors/UtilityClasses.stories.tsx +2 -1
- package/src/stylesAndAnimations/colors/UtilityClasses.tsx +1 -2
- package/src/stylesAndAnimations/sizing/Sizing.stories.tsx +2 -1
- package/src/stylesAndAnimations/sizing/Sizing.tsx +0 -1
- package/src/stylesAndAnimations/typography/Typography.stories.tsx +2 -1
- package/src/stylesAndAnimations/typography/Typography.tsx +0 -1
- package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.tsx +2 -1
- package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.tsx +6 -3
- package/src/types.ts +12 -6
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type IconName as FAIconName, findIconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
import { type IconProps } from './types';
|
|
5
6
|
|
|
6
7
|
export const Icon = ({
|
|
7
8
|
name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
3
|
|
|
4
4
|
const indicons = {
|
|
5
5
|
'indico-o-white': (
|
|
@@ -821,7 +821,7 @@ function indiconToIconDef([name, customIcon]: [string, ReactElement]): IconDefin
|
|
|
821
821
|
throw new Error(`Monotone indicon '${name}' must have a 'd' attribute.`);
|
|
822
822
|
|
|
823
823
|
if (pathElements.length === 2) {
|
|
824
|
-
|
|
824
|
+
const [primary, secondary] = pathElements;
|
|
825
825
|
|
|
826
826
|
if (!primary.props.d || !secondary.props.d)
|
|
827
827
|
throw new Error(`Duotone indicon '${name}' must have 'd' attributes on both paths.`);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { indicons } from './indicons';
|
|
1
|
+
import { type IconName as FAIconName, type IconPrefix } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { type MouseEventHandler, type CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
import { type indicons } from './indicons';
|
|
5
|
+
import { type PermafrostComponent } from '../../types';
|
|
5
6
|
|
|
6
7
|
export type IconSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
7
8
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { Menu, type MenuProps } from './Menu';
|
|
3
4
|
import { Button } from '../button';
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof Menu> = {
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Modal } from './Modal';
|
|
5
|
+
import { type ConfirmationModalProps, type ConfirmationModalText } from './types';
|
|
1
6
|
import { Button } from '../button/Button';
|
|
2
|
-
import { ButtonVariants } from '../button/types';
|
|
7
|
+
import { type ButtonVariants } from '../button/types';
|
|
3
8
|
import { Checkbox } from '../forms/checkbox/Checkbox';
|
|
4
9
|
import { Col, Row } from '../grid';
|
|
5
10
|
import { Icon } from '../icons/Icon';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const DEFAULT_TEXT: Required<ConfirmationModalText> = {
|
|
14
|
+
closeButton: 'Close',
|
|
15
|
+
dontShowAgain: "Don't display this again.",
|
|
16
|
+
confirm: 'Confirm',
|
|
17
|
+
cancel: 'Cancel',
|
|
18
|
+
};
|
|
10
19
|
|
|
11
20
|
const defaultFooter = ({
|
|
12
21
|
onCancelRequest,
|
|
13
22
|
onConfirmRequest,
|
|
14
|
-
|
|
23
|
+
text,
|
|
15
24
|
confirmationButtonVariant,
|
|
16
|
-
cancelButtonText,
|
|
17
25
|
hasDontShowAgainCheckbox,
|
|
18
26
|
isChecked,
|
|
19
27
|
onDontShowAgainChange,
|
|
@@ -24,9 +32,8 @@ const defaultFooter = ({
|
|
|
24
32
|
}: {
|
|
25
33
|
dontShowAgain?: boolean;
|
|
26
34
|
}) => void | Promise<void> | Promise<boolean>;
|
|
27
|
-
|
|
35
|
+
text: Required<ConfirmationModalText>;
|
|
28
36
|
confirmationButtonVariant?: ButtonVariants;
|
|
29
|
-
cancelButtonText?: string;
|
|
30
37
|
hasDontShowAgainCheckbox?: boolean;
|
|
31
38
|
isChecked?: boolean;
|
|
32
39
|
onDontShowAgainChange?: (checked: boolean) => void;
|
|
@@ -35,7 +42,7 @@ const defaultFooter = ({
|
|
|
35
42
|
{hasDontShowAgainCheckbox && (
|
|
36
43
|
<Col>
|
|
37
44
|
<Checkbox
|
|
38
|
-
label=
|
|
45
|
+
label={text.dontShowAgain}
|
|
39
46
|
onChange={(e) => onDontShowAgainChange?.(e.target.checked)}
|
|
40
47
|
isChecked={isChecked}
|
|
41
48
|
id="dont-show-again"
|
|
@@ -44,17 +51,17 @@ const defaultFooter = ({
|
|
|
44
51
|
</Col>
|
|
45
52
|
)}
|
|
46
53
|
<Col xs="content">
|
|
47
|
-
<Button onClick={onCancelRequest} ariaLabel={
|
|
48
|
-
{
|
|
54
|
+
<Button onClick={onCancelRequest} ariaLabel={text.cancel} variant="outline">
|
|
55
|
+
{text.cancel}
|
|
49
56
|
</Button>
|
|
50
57
|
</Col>
|
|
51
58
|
<Col xs="content">
|
|
52
59
|
<Button
|
|
53
60
|
onClick={() => onConfirmRequest?.({ dontShowAgain: isChecked })}
|
|
54
|
-
ariaLabel={
|
|
61
|
+
ariaLabel={text.confirm}
|
|
55
62
|
variant={confirmationButtonVariant}
|
|
56
63
|
>
|
|
57
|
-
{
|
|
64
|
+
{text.confirm}
|
|
58
65
|
</Button>
|
|
59
66
|
</Col>
|
|
60
67
|
</Row>
|
|
@@ -77,15 +84,15 @@ export const ConfirmationModal = ({
|
|
|
77
84
|
children,
|
|
78
85
|
onConfirmRequest,
|
|
79
86
|
onCancelRequest,
|
|
80
|
-
confirmationButtonText = 'Confirm',
|
|
81
|
-
cancelButtonText = 'Cancel',
|
|
82
87
|
confirmationButtonVariant = 'solid',
|
|
83
88
|
icon,
|
|
84
89
|
title,
|
|
85
90
|
status = 'info',
|
|
86
91
|
maxWidthInPixels,
|
|
87
92
|
hasDontShowAgainCheckbox,
|
|
93
|
+
text: textProp,
|
|
88
94
|
}: ConfirmationModalProps) => {
|
|
95
|
+
const text = { ...DEFAULT_TEXT, ...textProp };
|
|
89
96
|
const [dontShowAgain, setDontShowAgain] = useState(false);
|
|
90
97
|
|
|
91
98
|
const modalFooter =
|
|
@@ -93,8 +100,7 @@ export const ConfirmationModal = ({
|
|
|
93
100
|
defaultFooter({
|
|
94
101
|
onCancelRequest,
|
|
95
102
|
onConfirmRequest,
|
|
96
|
-
|
|
97
|
-
cancelButtonText,
|
|
103
|
+
text,
|
|
98
104
|
confirmationButtonVariant,
|
|
99
105
|
hasDontShowAgainCheckbox,
|
|
100
106
|
isChecked: dontShowAgain,
|
|
@@ -117,6 +123,7 @@ export const ConfirmationModal = ({
|
|
|
117
123
|
overlayElement={overlayElement}
|
|
118
124
|
footer={modalFooter}
|
|
119
125
|
maxWidthInPixels={maxWidthInPixels}
|
|
126
|
+
text={{ closeButton: text.closeButton }}
|
|
120
127
|
>
|
|
121
128
|
{icon && (
|
|
122
129
|
<Icon
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Col, Container, Row } from '../grid';
|
|
1
|
+
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
4
3
|
import { useState } from 'react';
|
|
5
|
-
|
|
6
|
-
import { registerFontAwesomeIcons } from '@/setup/setupIcons';
|
|
4
|
+
|
|
7
5
|
import { indiconDefinitions } from '@/components/icons/indicons';
|
|
8
|
-
import {
|
|
6
|
+
import { registerFontAwesomeIcons } from '@/setup/setupIcons';
|
|
7
|
+
|
|
9
8
|
import { ConfirmationModal } from './ConfirmationModal';
|
|
9
|
+
import { Modal } from './Modal';
|
|
10
|
+
import { Button } from '../button';
|
|
11
|
+
import { Col, Container, Row } from '../grid';
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
registerFontAwesomeIcons(...Object.values(fas), ...indiconDefinitions);
|
|
12
15
|
|
|
@@ -173,15 +176,6 @@ const meta: Meta = {
|
|
|
173
176
|
},
|
|
174
177
|
},
|
|
175
178
|
},
|
|
176
|
-
confirmationButtonText: {
|
|
177
|
-
control: 'text',
|
|
178
|
-
table: {
|
|
179
|
-
category: 'Confirmation Modal',
|
|
180
|
-
type: {
|
|
181
|
-
summary: 'string',
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
179
|
confirmationButtonVariant: {
|
|
186
180
|
control: 'select',
|
|
187
181
|
options: ['solid', 'outline', 'link', 'action', 'destructive', 'soft'],
|
|
@@ -192,15 +186,6 @@ const meta: Meta = {
|
|
|
192
186
|
},
|
|
193
187
|
},
|
|
194
188
|
},
|
|
195
|
-
cancelButtonText: {
|
|
196
|
-
control: 'text',
|
|
197
|
-
table: {
|
|
198
|
-
category: 'Confirmation Modal',
|
|
199
|
-
type: {
|
|
200
|
-
summary: 'string',
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
189
|
status: {
|
|
205
190
|
control: 'select',
|
|
206
191
|
options: ['info', 'success', 'error'],
|
|
@@ -230,6 +215,17 @@ const meta: Meta = {
|
|
|
230
215
|
},
|
|
231
216
|
},
|
|
232
217
|
},
|
|
218
|
+
text: {
|
|
219
|
+
control: 'object',
|
|
220
|
+
table: {
|
|
221
|
+
category: 'i18n Text',
|
|
222
|
+
type: {
|
|
223
|
+
summary:
|
|
224
|
+
'{ closeButton?: string; dontShowAgain?: string; confirm?: string; cancel?: string }',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
description: 'Customizable text.',
|
|
228
|
+
},
|
|
233
229
|
},
|
|
234
230
|
};
|
|
235
231
|
|
|
@@ -320,9 +316,8 @@ export const ConfirmationModalStory: StoryObj<typeof ConfirmationModal> = {
|
|
|
320
316
|
console.log('closed');
|
|
321
317
|
},
|
|
322
318
|
title: 'Disable User',
|
|
323
|
-
confirmationButtonText: 'Delete',
|
|
324
319
|
confirmationButtonVariant: 'destructive',
|
|
325
|
-
|
|
320
|
+
text: { confirm: 'Delete', cancel: 'Cancel' },
|
|
326
321
|
shouldCloseOnOverlayClick: true,
|
|
327
322
|
subtitle: '',
|
|
328
323
|
icon: 'trash',
|
|
@@ -371,9 +366,8 @@ export const ConfirmationModalStoryWithCheckbox: StoryObj<typeof ConfirmationMod
|
|
|
371
366
|
console.log('closed');
|
|
372
367
|
},
|
|
373
368
|
title: 'Disable User',
|
|
374
|
-
confirmationButtonText: 'Delete',
|
|
375
369
|
confirmationButtonVariant: 'destructive',
|
|
376
|
-
|
|
370
|
+
text: { confirm: 'Delete', cancel: 'Cancel' },
|
|
377
371
|
shouldCloseOnOverlayClick: true,
|
|
378
372
|
icon: 'trash',
|
|
379
373
|
status: 'error',
|
|
@@ -420,3 +414,43 @@ export const ConfirmationModalStoryWithCheckbox: StoryObj<typeof ConfirmationMod
|
|
|
420
414
|
);
|
|
421
415
|
},
|
|
422
416
|
};
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Use the `text` prop to customize displayed text.
|
|
420
|
+
*/
|
|
421
|
+
export const WithText: StoryObj<typeof ConfirmationModal> = {
|
|
422
|
+
args: {
|
|
423
|
+
title: 'Désactiver utilisateur',
|
|
424
|
+
confirmationButtonVariant: 'destructive',
|
|
425
|
+
icon: 'trash',
|
|
426
|
+
status: 'error',
|
|
427
|
+
maxWidthInPixels: 600,
|
|
428
|
+
hasDontShowAgainCheckbox: true,
|
|
429
|
+
parentSelector: () => document.body,
|
|
430
|
+
text: {
|
|
431
|
+
confirm: 'Supprimer',
|
|
432
|
+
cancel: 'Annuler',
|
|
433
|
+
closeButton: 'Fermer',
|
|
434
|
+
dontShowAgain: 'Ne plus afficher ce message',
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
|
|
438
|
+
render: (args) => {
|
|
439
|
+
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
440
|
+
|
|
441
|
+
return (
|
|
442
|
+
<Container>
|
|
443
|
+
<Row>
|
|
444
|
+
<Col sm={4}>
|
|
445
|
+
<ConfirmationModal {...args} isOpen={isOpen} onRequestClose={() => setIsOpen(false)}>
|
|
446
|
+
<p>French example with custom text.</p>
|
|
447
|
+
</ConfirmationModal>
|
|
448
|
+
<Button ariaLabel="open modal" onClick={() => setIsOpen(true)}>
|
|
449
|
+
Open French Modal
|
|
450
|
+
</Button>
|
|
451
|
+
</Col>
|
|
452
|
+
</Row>
|
|
453
|
+
</Container>
|
|
454
|
+
);
|
|
455
|
+
},
|
|
456
|
+
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import ReactModal from 'react-modal';
|
|
3
|
+
|
|
4
|
+
import { type ModalProps, type ModalText } from './types';
|
|
3
5
|
import { Button } from '../button/Button';
|
|
4
6
|
import { Col, Row } from '../grid';
|
|
5
|
-
|
|
7
|
+
|
|
8
|
+
const DEFAULT_TEXT: Required<ModalText> = {
|
|
9
|
+
closeButton: 'Close',
|
|
10
|
+
};
|
|
6
11
|
|
|
7
12
|
export const Modal = ({
|
|
8
13
|
className = '',
|
|
@@ -25,8 +30,10 @@ export const Modal = ({
|
|
|
25
30
|
subtitle,
|
|
26
31
|
footer,
|
|
27
32
|
maxWidthInPixels,
|
|
33
|
+
text: textProp,
|
|
28
34
|
...rest
|
|
29
35
|
}: ModalProps) => {
|
|
36
|
+
const text = { ...DEFAULT_TEXT, ...textProp };
|
|
30
37
|
const modalClasses = classNames('modal', `modal--${position}`, className);
|
|
31
38
|
const overlayClasses = classNames('modal-overlay', overlayClassName);
|
|
32
39
|
|
|
@@ -55,7 +62,7 @@ export const Modal = ({
|
|
|
55
62
|
variant="link"
|
|
56
63
|
size="md"
|
|
57
64
|
iconLeft="x-close"
|
|
58
|
-
ariaLabel=
|
|
65
|
+
ariaLabel={text.closeButton}
|
|
59
66
|
/>
|
|
60
67
|
{hasHeader && (
|
|
61
68
|
<div className="modal-header">
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { ButtonVariants } from '../button/types';
|
|
2
|
-
import { IconName } from '../icons/types';
|
|
1
|
+
import { type ButtonVariants } from '../button/types';
|
|
2
|
+
import { type IconName } from '../icons/types';
|
|
3
|
+
|
|
4
|
+
/** Customizable text for Modal. */
|
|
5
|
+
export interface ModalText {
|
|
6
|
+
/** Aria label for the close button. Default: "Close" */
|
|
7
|
+
closeButton?: string;
|
|
8
|
+
}
|
|
3
9
|
|
|
4
10
|
export interface ModalProps {
|
|
5
11
|
/** Additional classes for the badge component */
|
|
@@ -36,9 +42,21 @@ export interface ModalProps {
|
|
|
36
42
|
footer?: React.ReactNode;
|
|
37
43
|
/** The maximum width of the modal in pixels */
|
|
38
44
|
maxWidthInPixels?: number;
|
|
45
|
+
/** Customizable display text. */
|
|
46
|
+
text?: ModalText;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Customizable text for ConfirmationModal. Extends ModalText. */
|
|
50
|
+
export interface ConfirmationModalText extends ModalText {
|
|
51
|
+
/** Label for the "Don't show again" checkbox. Default: "Don't display this again." */
|
|
52
|
+
dontShowAgain?: string;
|
|
53
|
+
/** Text for the confirm button. Default: "Confirm" */
|
|
54
|
+
confirm?: string;
|
|
55
|
+
/** Text for the cancel button. Default: "Cancel" */
|
|
56
|
+
cancel?: string;
|
|
39
57
|
}
|
|
40
58
|
|
|
41
|
-
export interface ConfirmationModalProps extends ModalProps {
|
|
59
|
+
export interface ConfirmationModalProps extends Omit<ModalProps, 'text'> {
|
|
42
60
|
onConfirmRequest?: ({
|
|
43
61
|
dontShowAgain,
|
|
44
62
|
}: {
|
|
@@ -49,12 +67,10 @@ export interface ConfirmationModalProps extends ModalProps {
|
|
|
49
67
|
hasDontShowAgainCheckbox?: boolean;
|
|
50
68
|
/** The variant of the confirmation button. */
|
|
51
69
|
confirmationButtonVariant?: ButtonVariants;
|
|
52
|
-
/** The text of the confirmation button */
|
|
53
|
-
confirmationButtonText?: string;
|
|
54
|
-
/** The text of the cancel button */
|
|
55
|
-
cancelButtonText?: string;
|
|
56
70
|
/** The icon of the modal */
|
|
57
71
|
icon?: IconName;
|
|
58
72
|
/** The status of the modal. This will determine the color of the icon. */
|
|
59
73
|
status?: 'info' | 'success' | 'error';
|
|
74
|
+
/** Customizable display text. */
|
|
75
|
+
text?: ConfirmationModalText;
|
|
60
76
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
|
|
2
4
|
import { Pagination } from './Pagination';
|
|
3
5
|
import { Col, Container, Row } from '../grid';
|
|
4
|
-
import { useEffect, useState } from 'react';
|
|
5
6
|
|
|
6
7
|
const meta: Meta = {
|
|
7
8
|
title: 'Layout/Pagination',
|
|
@@ -43,6 +44,17 @@ const meta: Meta = {
|
|
|
43
44
|
},
|
|
44
45
|
},
|
|
45
46
|
},
|
|
47
|
+
text: {
|
|
48
|
+
control: 'object',
|
|
49
|
+
description: 'Customizable text.',
|
|
50
|
+
table: {
|
|
51
|
+
category: 'i18n Text',
|
|
52
|
+
type: {
|
|
53
|
+
summary:
|
|
54
|
+
'{ previousPage?: string; nextPage?: string; currentPage?: string; of?: string }',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
46
58
|
},
|
|
47
59
|
};
|
|
48
60
|
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
import { type PaginationProps, type PaginationText } from './types';
|
|
6
5
|
import { Button } from '../button';
|
|
6
|
+
import { Input } from '../forms/input';
|
|
7
|
+
import { Container, Row, Col } from '../grid';
|
|
8
|
+
|
|
9
|
+
const DEFAULT_TEXT: Required<PaginationText> = {
|
|
10
|
+
previousPage: 'Previous Page',
|
|
11
|
+
nextPage: 'Next Page',
|
|
12
|
+
currentPage: 'Current Page',
|
|
13
|
+
of: 'of',
|
|
14
|
+
};
|
|
7
15
|
|
|
8
16
|
export const Pagination = ({
|
|
9
17
|
totalPages,
|
|
10
18
|
currentPage = 1,
|
|
11
19
|
onChange,
|
|
12
20
|
className,
|
|
21
|
+
text: textProp,
|
|
13
22
|
...rest
|
|
14
23
|
}: PaginationProps) => {
|
|
24
|
+
const text = { ...DEFAULT_TEXT, ...textProp };
|
|
15
25
|
const [inputValue, setInputValue] = useState(currentPage.toString());
|
|
16
|
-
const totalPagesText =
|
|
26
|
+
const totalPagesText = `${text.of} ${totalPages}`;
|
|
17
27
|
const classes = classNames('pagination', className);
|
|
18
28
|
|
|
19
29
|
useEffect(() => {
|
|
@@ -60,7 +70,7 @@ export const Pagination = ({
|
|
|
60
70
|
<div className="pagination__previous">
|
|
61
71
|
<Button
|
|
62
72
|
data-testid="pagination-previous-button"
|
|
63
|
-
ariaLabel=
|
|
73
|
+
ariaLabel={text.previousPage}
|
|
64
74
|
variant="link"
|
|
65
75
|
onClick={handlePreviousPage}
|
|
66
76
|
iconLeft="chevron-left"
|
|
@@ -78,7 +88,7 @@ export const Pagination = ({
|
|
|
78
88
|
})}
|
|
79
89
|
value={totalPages === 0 ? '0' : inputValue}
|
|
80
90
|
name="currentPage"
|
|
81
|
-
label=
|
|
91
|
+
label={text.currentPage}
|
|
82
92
|
hasHiddenLabel
|
|
83
93
|
onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
84
94
|
if (e.key === 'Enter') {
|
|
@@ -103,7 +113,7 @@ export const Pagination = ({
|
|
|
103
113
|
<div className="pagination__next">
|
|
104
114
|
<Button
|
|
105
115
|
data-testid="pagination-next-button"
|
|
106
|
-
ariaLabel=
|
|
116
|
+
ariaLabel={text.nextPage}
|
|
107
117
|
variant="link"
|
|
108
118
|
onClick={handleNextPage}
|
|
109
119
|
iconLeft="chevron-right"
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/** Customizable text for Pagination. */
|
|
2
|
+
export interface PaginationText {
|
|
3
|
+
/** Aria label for previous page button. Default: "Previous Page" */
|
|
4
|
+
previousPage?: string;
|
|
5
|
+
/** Aria label for next page button. Default: "Next Page" */
|
|
6
|
+
nextPage?: string;
|
|
7
|
+
/** Label for current page input. Default: "Current Page" */
|
|
8
|
+
currentPage?: string;
|
|
9
|
+
/** Text between current page and total (e.g., "of"). Default: "of" */
|
|
10
|
+
of?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
1
13
|
export interface PaginationProps {
|
|
2
14
|
/** The total number of pages to be displayed */
|
|
3
15
|
totalPages: number;
|
|
@@ -7,4 +19,6 @@ export interface PaginationProps {
|
|
|
7
19
|
className?: string;
|
|
8
20
|
/** The callback function that is called when the page changes. */
|
|
9
21
|
onChange?: (value: number) => void;
|
|
22
|
+
/** Customizable display text. */
|
|
23
|
+
text?: PaginationText;
|
|
10
24
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Pill } from './Pill';
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
2
|
import { Container, Row, Col } from 'react-grid-system';
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
|
|
4
|
+
import { type ChromaticColor } from '@/types';
|
|
5
|
+
|
|
6
|
+
import { Pill } from './Pill';
|
|
7
|
+
import { type PillShade } from './types';
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
|
|
7
11
|
const CHROMATIC_COLORS: ChromaticColor[] = [
|
|
8
12
|
'blue',
|
|
@@ -120,7 +124,7 @@ export const AllDefaultColors: Story = {
|
|
|
120
124
|
<Container>
|
|
121
125
|
<Row justify="start">
|
|
122
126
|
{CHROMATIC_COLORS.map((color: ChromaticColor) => (
|
|
123
|
-
<Col xs="content" className="mb-2">
|
|
127
|
+
<Col key={color} xs="content" className="mb-2">
|
|
124
128
|
<Pill color={color} size="md">
|
|
125
129
|
{color}
|
|
126
130
|
</Pill>
|
|
@@ -139,7 +143,7 @@ export const AllShades: Story = {
|
|
|
139
143
|
{CHROMATIC_COLORS.map((color: ChromaticColor) => (
|
|
140
144
|
<Row key={color}>
|
|
141
145
|
{SHADES.map((shade: PillShade) => (
|
|
142
|
-
<Col width={100} className="mb-2">
|
|
146
|
+
<Col key={`${color}-${shade}`} width={100} className="mb-2">
|
|
143
147
|
<Pill shade={shade} color={color} size="md">
|
|
144
148
|
{color}-{shade}
|
|
145
149
|
</Pill>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
+
|
|
2
3
|
import { Pill } from '@/components/pill/Pill';
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
import { type PillColor, type PillShade, type PillSize } from '../types';
|
|
6
|
+
|
|
4
7
|
|
|
5
8
|
const sizes = ['sm', 'md', 'lg'] as PillSize[];
|
|
6
9
|
const colors = [
|