@indico-data/design-system 3.19.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 +1 -1
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +5 -5
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +2 -2
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +5 -5
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +2 -2
- 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 +2 -2
- package/lib/components/forms/select/Select.stories.d.ts +4 -4
- package/lib/components/forms/select/types.d.ts +2 -2
- package/lib/components/forms/subcomponents/Label.d.ts +2 -2
- 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 +1 -1
- 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 +1 -1
- package/lib/components/modal/Modal.d.ts +1 -1
- package/lib/components/modal/Modal.stories.d.ts +2 -2
- package/lib/components/modal/types.d.ts +2 -2
- package/lib/components/pagination/Pagination.d.ts +1 -1
- package/lib/components/pagination/Pagination.stories.d.ts +1 -1
- 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 +1 -1
- package/lib/components/stepper/Stepper.stories.d.ts +1 -1
- package/lib/components/stepper/components/Legend.d.ts +1 -1
- package/lib/components/stepper/types.d.ts +1 -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 +1 -1
- package/lib/components/table/components/helpers.d.ts +1 -1
- package/lib/components/table/hooks/usePinnedColumnsManager.d.ts +1 -1
- package/lib/components/table/sampleData.d.ts +1 -1
- package/lib/components/table/types.d.ts +2 -2
- package/lib/components/table/utils/processColumns.d.ts +1 -1
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +1 -1
- package/lib/components/tanstackTable/TanstackTable.d.ts +1 -1
- 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/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 +1 -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 +45 -45
- package/lib/index.esm.js +137 -124
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +137 -124
- 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 +8 -4
- package/src/components/button/__tests__/Button.test.tsx +1 -0
- 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 +2 -1
- package/src/components/forms/date/datePicker/DatePicker.tsx +27 -24
- 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 +8 -8
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +6 -2
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +10 -8
- package/src/components/forms/date/iconTriggerDatePicker/__tests__/IconTriggerDatePicker.test.tsx +2 -1
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +4 -2
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +14 -10
- package/src/components/forms/date/inputDatePicker/__tests__/SingleInputDatePicker.test.tsx +2 -2
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +5 -4
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +16 -22
- package/src/components/forms/date/inputDateRangePicker/__tests__/InputDateRangePicker.test.tsx +2 -2
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +9 -5
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +15 -11
- 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 +3 -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 +5 -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 +5 -2
- 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 +5 -4
- package/src/components/forms/select/Select.tsx +7 -6
- package/src/components/forms/select/__tests__/Select.test.tsx +2 -2
- package/src/components/forms/select/types.ts +3 -2
- package/src/components/forms/subcomponents/Label.tsx +5 -2
- package/src/components/forms/subcomponents/__tests__/Label.test.tsx +1 -0
- package/src/components/forms/textarea/Textarea.stories.tsx +5 -2
- package/src/components/forms/textarea/Textarea.tsx +4 -4
- package/src/components/forms/textarea/__tests__/Textarea.test.tsx +3 -3
- package/src/components/forms/timePicker/TimePicker.stories.tsx +4 -2
- package/src/components/forms/timePicker/TimePicker.tsx +6 -5
- package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +2 -1
- 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 +7 -5
- package/src/components/modal/Modal.stories.tsx +9 -6
- package/src/components/modal/Modal.tsx +2 -1
- package/src/components/modal/__tests__/Modal.test.tsx +1 -0
- package/src/components/modal/types.ts +2 -2
- package/src/components/pagination/Pagination.stories.tsx +3 -2
- package/src/components/pagination/Pagination.tsx +5 -4
- package/src/components/pagination/__tests__/Pagination.test.tsx +1 -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 +9 -7
- package/src/components/stepper/Stepper.tsx +3 -2
- package/src/components/stepper/__tests__/Stepper.tests.tsx +5 -4
- package/src/components/stepper/components/Legend.tsx +4 -3
- 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 +1 -1
- package/src/components/table/Table.stories.tsx +9 -5
- package/src/components/table/Table.tsx +5 -4
- package/src/components/table/__tests__/Table.test.tsx +2 -1
- package/src/components/table/components/HorizontalStickyHeader.tsx +3 -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 +6 -2
- package/src/components/table/sampleData.tsx +1 -3
- package/src/components/table/types.ts +5 -6
- package/src/components/table/utils/processColumns.tsx +2 -2
- package/src/components/tanstackTable/TankstackTable.types.ts +1 -1
- package/src/components/tanstackTable/TanstackTable.stories.tsx +6 -5
- package/src/components/tanstackTable/TanstackTable.tsx +8 -8
- 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/__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 +1 -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/setup/setupIcons.ts +2 -2
- package/src/storybook/formArgTypes.ts +2 -1
- package/src/storybook/iconNames.ts +1 -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,2 +1,2 @@
|
|
|
1
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
1
|
+
import { type IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
2
|
export declare const registerFontAwesomeIcons: (...icons: IconDefinition[]) => void;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { type SelectOption } from './components/forms/select/types';
|
|
2
|
+
import { type IconSizes, type IconName } from './components/icons/types';
|
|
3
|
+
import { type PillColor, type PillSize } from './components/pill/types';
|
|
4
|
+
import { type TableProps, type TableColumn, type Direction, type Alignment } from './components/table/types';
|
|
1
5
|
export type PermafrostComponent = {
|
|
2
6
|
id?: string;
|
|
3
7
|
className?: string;
|
|
4
8
|
'data-cy'?: string;
|
|
5
9
|
'data-testid'?: string;
|
|
6
10
|
};
|
|
7
|
-
import { IconSizes, IconName } from './components/icons/types';
|
|
8
11
|
export type { IconSizes, IconName };
|
|
9
12
|
export type ChromaticColor = 'blue' | 'purple' | 'red' | 'yellow' | 'gray' | 'green' | 'pink' | 'orange' | 'teal';
|
|
10
13
|
export type Color = ChromaticColor | 'black' | 'white';
|
|
11
14
|
export type SemanticColor = 'neutral' | 'info' | 'warning' | 'error' | 'success' | 'pending';
|
|
12
|
-
import { SelectOption } from './components/forms/select/types';
|
|
13
15
|
export type { SelectOption };
|
|
14
|
-
import { TableProps, TableColumn, Direction, Alignment } from './components/table/types';
|
|
15
16
|
export type { TableProps, TableColumn, Direction, Alignment };
|
|
16
|
-
import { PillColor, PillSize } from './components/pill/types';
|
|
17
17
|
export type { PillColor, PillSize };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indico-data/design-system",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
"test": "DEBUG_PRINT_LIMIT=10000 jest",
|
|
21
21
|
"test:watch": "DEBUG_PRINT_LIMIT=10000 jest --watch",
|
|
22
22
|
"all-releases": "npm view @indico-data/design-system versions",
|
|
23
|
-
"latest-release": "npm dist-tags ls @indico-data/design-system"
|
|
23
|
+
"latest-release": "npm dist-tags ls @indico-data/design-system",
|
|
24
|
+
"prepare": "husky"
|
|
24
25
|
},
|
|
25
26
|
"lint-staged": {
|
|
27
|
+
"*.{ts,tsx}": "eslint --max-warnings 0",
|
|
26
28
|
"**/*": "prettier --write --ignore-unknown"
|
|
27
29
|
},
|
|
28
30
|
"dependencies": {
|
|
@@ -73,6 +75,7 @@
|
|
|
73
75
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
74
76
|
"@rollup/plugin-terser": "^0.4.4",
|
|
75
77
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
78
|
+
"@sanity/eslint-plugin-i18n": "^1.1.0",
|
|
76
79
|
"@storybook/addon-a11y": "^8.0.8",
|
|
77
80
|
"@storybook/addon-docs": "^8.0.8",
|
|
78
81
|
"@storybook/addon-essentials": "^8.0.8",
|
|
@@ -114,9 +117,12 @@
|
|
|
114
117
|
"babel-preset-react-app": "^10.0.1",
|
|
115
118
|
"css-loader": "5.2.6",
|
|
116
119
|
"eslint": "^8.56.0",
|
|
120
|
+
"eslint-plugin-i18next": "^6.1.3",
|
|
121
|
+
"eslint-plugin-import": "2.29.1",
|
|
117
122
|
"eslint-plugin-react": "^7.33.2",
|
|
118
123
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
119
124
|
"html-webpack-plugin": "^5.6.5",
|
|
125
|
+
"husky": "^9.1.7",
|
|
120
126
|
"identity-obj-proxy": "^3.0.0",
|
|
121
127
|
"jest": "^29.7.0",
|
|
122
128
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
2
3
|
import { Badge } from './Badge';
|
|
3
|
-
import { Col, Container, Row } from '../grid';
|
|
4
4
|
import { FloatUI } from '../floatUI';
|
|
5
|
-
import {
|
|
5
|
+
import { Col, Container, Row } from '../grid';
|
|
6
6
|
import { Icon } from '../icons';
|
|
7
|
+
import { Menu } from '../menu';
|
|
7
8
|
|
|
8
9
|
const meta: Meta = {
|
|
9
10
|
title: 'Components/Badge',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Button, Col, Row } from '@/components';
|
|
3
|
-
import { iconNames } from '@/storybook/iconNames';
|
|
4
1
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
-
import {
|
|
2
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Button, Col, Row } from '@/components';
|
|
6
5
|
import { indiconDefinitions } from '@/components/icons/indicons';
|
|
6
|
+
import { registerFontAwesomeIcons } from '@/setup/setupIcons';
|
|
7
|
+
import { iconNames } from '@/storybook/iconNames';
|
|
7
8
|
|
|
8
9
|
registerFontAwesomeIcons(...Object.values(fas), ...indiconDefinitions);
|
|
9
10
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { type ButtonProps } from './types';
|
|
3
5
|
import { Icon } from '../icons/Icon';
|
|
4
|
-
import { IconSizes } from '../icons/types';
|
|
6
|
+
import { type IconSizes } from '../icons/types';
|
|
7
|
+
|
|
8
|
+
import type React from 'react';
|
|
5
9
|
|
|
6
|
-
import { ButtonProps } from './types';
|
|
7
10
|
|
|
8
11
|
export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
|
|
9
12
|
const {
|
|
@@ -20,7 +23,8 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) =>
|
|
|
20
23
|
size = 'md',
|
|
21
24
|
onMouseExit,
|
|
22
25
|
className,
|
|
23
|
-
|
|
26
|
+
// Destructure unused prop to prevent leaking to DOM
|
|
27
|
+
href: _href,
|
|
24
28
|
...rest
|
|
25
29
|
} = props;
|
|
26
30
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
|
|
3
4
|
import { FloatUI } from './FloatUI';
|
|
5
|
+
import { type FloatUIProps } from './types';
|
|
4
6
|
import { Button } from '../button';
|
|
5
7
|
import { Menu } from '../menu';
|
|
6
|
-
import { FloatUIProps } from './types';
|
|
7
8
|
|
|
8
9
|
const meta: Meta<typeof FloatUI> = {
|
|
9
10
|
title: 'Components/FloatUI',
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import React, { useRef, isValidElement, useState } from 'react';
|
|
2
1
|
import {
|
|
3
2
|
FloatingPortal,
|
|
4
3
|
useClick,
|
|
5
4
|
useHover,
|
|
6
5
|
useFloating,
|
|
7
6
|
useInteractions,
|
|
8
|
-
UseFloatingOptions,
|
|
7
|
+
type UseFloatingOptions,
|
|
9
8
|
offset,
|
|
10
9
|
flip,
|
|
11
10
|
shift,
|
|
12
|
-
Placement,
|
|
11
|
+
type Placement,
|
|
13
12
|
useDismiss,
|
|
14
|
-
ReferenceType,
|
|
15
|
-
VirtualElement,
|
|
16
13
|
autoUpdate,
|
|
17
14
|
} from '@floating-ui/react';
|
|
18
|
-
import {
|
|
15
|
+
import React, { useRef, isValidElement, useState } from 'react';
|
|
16
|
+
|
|
17
|
+
import { type FloatUIProps } from './types';
|
|
19
18
|
|
|
20
19
|
const defaultOptions: UseFloatingOptions = {
|
|
21
20
|
placement: 'bottom-start' as Placement,
|
|
@@ -69,7 +68,7 @@ export function FloatUI({
|
|
|
69
68
|
},
|
|
70
69
|
whileElementsMounted: disableAutoUpdate
|
|
71
70
|
? undefined
|
|
72
|
-
:
|
|
71
|
+
: floatingOptions.whileElementsMounted ?? autoUpdate,
|
|
73
72
|
elements: {
|
|
74
73
|
reference: referenceElement as Element | null,
|
|
75
74
|
},
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
2
|
-
import { FloatUI } from '../FloatUI';
|
|
3
|
-
import { Menu } from '../../menu';
|
|
4
|
-
import { Button } from '../../button';
|
|
5
2
|
import userEvent from '@testing-library/user-event';
|
|
6
3
|
|
|
4
|
+
import { Button } from '../../button';
|
|
5
|
+
import { Menu } from '../../menu';
|
|
6
|
+
import { FloatUI } from '../FloatUI';
|
|
7
|
+
|
|
8
|
+
|
|
7
9
|
describe('FloatUI Component', () => {
|
|
8
10
|
it('does not display FloatUI content initially when rendered in uncontrolled mode', () => {
|
|
9
11
|
render(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type UseFloatingOptions } from '@floating-ui/react-dom';
|
|
2
|
+
import { type ReactElement } from 'react';
|
|
3
3
|
|
|
4
4
|
export type FloatUIProps = {
|
|
5
5
|
/** An array of exactly two elements: the first element is the trigger that opens the FloatUI, and the second element is the content displayed within the FloatUI. */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Checkbox } from './Checkbox';
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
2
|
import { useState } from 'react';
|
|
4
3
|
|
|
4
|
+
import { Checkbox } from './Checkbox';
|
|
5
|
+
|
|
5
6
|
const meta: Meta = {
|
|
6
7
|
title: 'Forms/Checkbox',
|
|
7
8
|
component: Checkbox,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import { Checkbox } from '@/components/forms/checkbox/Checkbox';
|
|
3
2
|
import userEvent from '@testing-library/user-event';
|
|
4
3
|
|
|
4
|
+
import { Checkbox } from '@/components/forms/checkbox/Checkbox';
|
|
5
|
+
|
|
5
6
|
const handleOnChange = jest.fn();
|
|
6
7
|
|
|
7
8
|
describe('checkbox', () => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { type DateRange, DayPicker, type Mode, type OnSelectHandler } from 'react-day-picker';
|
|
3
|
+
|
|
2
4
|
import 'react-day-picker/style.css';
|
|
3
|
-
import { DatePickerProps, DatePickerText } from './types';
|
|
4
5
|
import { getCommonProps } from './contants';
|
|
5
|
-
import {
|
|
6
|
+
import { type DatePickerProps, type DatePickerText } from './types';
|
|
6
7
|
import { Col, Row } from '../../../grid';
|
|
7
|
-
import {
|
|
8
|
+
import { TimePicker } from '../../timePicker/TimePicker';
|
|
8
9
|
|
|
9
10
|
const DEFAULT_TEXT: Required<DatePickerText> = {
|
|
10
11
|
selectTime: 'Select Time',
|
|
@@ -13,37 +14,39 @@ const DEFAULT_TEXT: Required<DatePickerText> = {
|
|
|
13
14
|
export const DatePicker = (props: DatePickerProps) => {
|
|
14
15
|
const {
|
|
15
16
|
mode = 'single',
|
|
16
|
-
className,
|
|
17
|
-
captionLayout = 'dropdown',
|
|
18
17
|
selected,
|
|
19
18
|
hasTimePicker = false,
|
|
20
|
-
id,
|
|
21
|
-
month,
|
|
22
|
-
defaultMonth,
|
|
23
|
-
startMonth,
|
|
24
19
|
endMonth,
|
|
25
|
-
components,
|
|
26
20
|
numberOfMonths,
|
|
27
|
-
isDisabled,
|
|
28
|
-
formatters,
|
|
29
|
-
weekStartsOn,
|
|
30
|
-
firstWeekContainsDate,
|
|
31
|
-
today,
|
|
32
21
|
timeValue,
|
|
33
|
-
isRequired,
|
|
34
|
-
min,
|
|
35
|
-
max,
|
|
36
22
|
onTimeChange,
|
|
37
23
|
onSelect,
|
|
38
|
-
onMonthChange,
|
|
39
|
-
onNextClick,
|
|
40
|
-
onPrevClick,
|
|
41
|
-
onDayClick,
|
|
42
24
|
isReadOnly,
|
|
43
25
|
ref,
|
|
44
26
|
timeTabIndex,
|
|
45
|
-
dateTabIndex,
|
|
46
27
|
text: textProp,
|
|
28
|
+
// Destructure props handled by getCommonProps to prevent them from
|
|
29
|
+
// leaking through ...rest and overriding the transformed values
|
|
30
|
+
className: _className,
|
|
31
|
+
captionLayout: _captionLayout,
|
|
32
|
+
id: _id,
|
|
33
|
+
month: _month,
|
|
34
|
+
defaultMonth: _defaultMonth,
|
|
35
|
+
startMonth: _startMonth,
|
|
36
|
+
components: _components,
|
|
37
|
+
isDisabled: _isDisabled,
|
|
38
|
+
formatters: _formatters,
|
|
39
|
+
weekStartsOn: _weekStartsOn,
|
|
40
|
+
firstWeekContainsDate: _firstWeekContainsDate,
|
|
41
|
+
today: _today,
|
|
42
|
+
isRequired: _isRequired,
|
|
43
|
+
min: _min,
|
|
44
|
+
max: _max,
|
|
45
|
+
onMonthChange: _onMonthChange,
|
|
46
|
+
onNextClick: _onNextClick,
|
|
47
|
+
onPrevClick: _onPrevClick,
|
|
48
|
+
onDayClick: _onDayClick,
|
|
49
|
+
dateTabIndex: _dateTabIndex,
|
|
47
50
|
...rest
|
|
48
51
|
} = props;
|
|
49
52
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CustomComponents,
|
|
3
|
-
DateRange,
|
|
4
|
-
DayEventHandler,
|
|
5
|
-
Formatters,
|
|
6
|
-
Matcher,
|
|
7
|
-
Mode,
|
|
8
|
-
MonthChangeEventHandler,
|
|
9
|
-
OnSelectHandler,
|
|
2
|
+
type CustomComponents,
|
|
3
|
+
type DateRange,
|
|
4
|
+
type DayEventHandler,
|
|
5
|
+
type Formatters,
|
|
6
|
+
type Matcher,
|
|
7
|
+
type Mode,
|
|
8
|
+
type MonthChangeEventHandler,
|
|
9
|
+
type OnSelectHandler,
|
|
10
10
|
} from 'react-day-picker';
|
|
11
11
|
|
|
12
12
|
/** Customizable text for DatePicker. */
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
1
|
import { useArgs } from '@storybook/preview-api';
|
|
2
|
+
import { type DateRange } from 'react-day-picker';
|
|
3
|
+
|
|
3
4
|
import { IconTriggerDatePicker } from '@/components/forms/date/iconTriggerDatePicker';
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
7
11
|
component: IconTriggerDatePicker,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { type UseFloatingOptions } from '@floating-ui/react-dom';
|
|
1
2
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { DateRange, OnSelectHandler, Mode } from 'react-day-picker';
|
|
3
|
-
|
|
3
|
+
import { type DateRange, type OnSelectHandler, type Mode } from 'react-day-picker';
|
|
4
|
+
|
|
5
|
+
import { type IconTriggerDatePickerText } from './types';
|
|
4
6
|
import { FloatUI } from '../../../floatUI';
|
|
5
|
-
import { DatePicker } from '../datePicker/DatePicker';
|
|
6
7
|
import { Icon } from '../../../icons/Icon';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { type IconName, type IconSizes } from '../../../icons/types';
|
|
9
|
+
import { DatePicker } from '../datePicker/DatePicker';
|
|
10
|
+
import { type PortalOptions } from '../datePicker/types';
|
|
10
11
|
|
|
11
12
|
const DEFAULT_TEXT: Required<IconTriggerDatePickerText> = {
|
|
12
13
|
triggerIcon: 'Open date picker',
|
|
@@ -55,12 +56,13 @@ interface Props {
|
|
|
55
56
|
export const IconTriggerDatePicker = (props: Props) => {
|
|
56
57
|
const {
|
|
57
58
|
ariaLabel,
|
|
58
|
-
className,
|
|
59
59
|
isDisabled,
|
|
60
60
|
disableBeforeDate,
|
|
61
61
|
disableAfterDate,
|
|
62
62
|
id,
|
|
63
|
-
|
|
63
|
+
// Destructure unused props to prevent leaking into ...rest
|
|
64
|
+
className: _className,
|
|
65
|
+
label: _label,
|
|
64
66
|
onSelect,
|
|
65
67
|
selected,
|
|
66
68
|
triggerIcon,
|
package/src/components/forms/date/iconTriggerDatePicker/__tests__/IconTriggerDatePicker.test.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import { IconTriggerDatePicker } from '../IconTriggerDatePicker';
|
|
3
2
|
import userEvent from '@testing-library/user-event';
|
|
4
3
|
|
|
4
|
+
import { IconTriggerDatePicker } from '../IconTriggerDatePicker';
|
|
5
|
+
|
|
5
6
|
describe('DatePicker', () => {
|
|
6
7
|
it('The date picker opens when the icon is clicked', async () => {
|
|
7
8
|
render(
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { SingleInputDatePicker, SingleInputDatePickerProps } from './SingleInputDatePicker';
|
|
3
1
|
import { useArgs } from '@storybook/preview-api';
|
|
4
2
|
|
|
3
|
+
import { SingleInputDatePicker, type SingleInputDatePickerProps } from './SingleInputDatePicker';
|
|
4
|
+
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
+
|
|
5
7
|
const meta: Meta<typeof SingleInputDatePicker> = {
|
|
6
8
|
component: SingleInputDatePicker,
|
|
7
9
|
title: 'Forms/DatePicker/SingleInputDatePicker',
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type UseFloatingOptions } from '@floating-ui/react-dom';
|
|
2
2
|
import { isValid, parse } from 'date-fns';
|
|
3
|
-
import {
|
|
3
|
+
import { useId, useState, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
import { formatDateAsString } from './helpers';
|
|
6
|
+
import { FloatUI } from '../../../floatUI';
|
|
4
7
|
import { Input } from '../../input';
|
|
8
|
+
import { DatePicker } from '../datePicker/DatePicker';
|
|
9
|
+
import { type PortalOptions } from '../datePicker/types';
|
|
10
|
+
|
|
5
11
|
import type { IconName } from '../../../icons/types';
|
|
6
|
-
|
|
7
|
-
import { formatDateAsString } from './helpers';
|
|
8
|
-
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
9
|
-
import { PortalOptions } from '../datePicker/types';
|
|
12
|
+
|
|
10
13
|
export interface SingleInputDatePickerProps {
|
|
11
14
|
/** A label for assistive technologies. */
|
|
12
15
|
ariaLabel: string;
|
|
@@ -47,13 +50,9 @@ export interface SingleInputDatePickerProps {
|
|
|
47
50
|
export function SingleInputDatePicker(props: SingleInputDatePickerProps) {
|
|
48
51
|
const {
|
|
49
52
|
ariaLabel,
|
|
50
|
-
className,
|
|
51
53
|
isDisabled,
|
|
52
|
-
disableBeforeDate,
|
|
53
|
-
disableAfterDate,
|
|
54
54
|
captionLayout,
|
|
55
55
|
initialMonth,
|
|
56
|
-
id,
|
|
57
56
|
label,
|
|
58
57
|
selected,
|
|
59
58
|
isOpen,
|
|
@@ -70,6 +69,11 @@ export function SingleInputDatePicker(props: SingleInputDatePickerProps) {
|
|
|
70
69
|
portalOptions,
|
|
71
70
|
floatingOptions,
|
|
72
71
|
isPortal,
|
|
72
|
+
// Destructure unused props to prevent leaking into ...rest
|
|
73
|
+
className: _className,
|
|
74
|
+
disableBeforeDate: _disableBeforeDate,
|
|
75
|
+
disableAfterDate: _disableAfterDate,
|
|
76
|
+
id: _id,
|
|
73
77
|
...rest
|
|
74
78
|
} = props;
|
|
75
79
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { render, screen, waitFor, within } from '@testing-library/react';
|
|
3
2
|
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import { SingleInputDatePicker } from '../SingleInputDatePicker';
|
|
5
3
|
import { format, addDays } from 'date-fns';
|
|
6
4
|
|
|
5
|
+
import { SingleInputDatePicker } from '../SingleInputDatePicker';
|
|
6
|
+
|
|
7
7
|
const mockOnSelect = jest.fn();
|
|
8
8
|
|
|
9
9
|
describe('SingleInputDatePicker', () => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { InputDateRangePicker } from './InputDateRangePicker';
|
|
3
1
|
import { useArgs } from '@storybook/preview-api';
|
|
4
|
-
import { DateRange } from 'react-day-picker';
|
|
5
|
-
|
|
2
|
+
import { type DateRange } from 'react-day-picker';
|
|
3
|
+
|
|
4
|
+
import { InputDateRangePicker } from './InputDateRangePicker';
|
|
5
|
+
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
7
|
|
|
7
8
|
const meta: Meta<typeof InputDateRangePicker> = {
|
|
8
9
|
component: InputDateRangePicker,
|