@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,8 +1,11 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
import { type SetStateAction, useEffect, useState } from 'react';
|
|
3
|
+
|
|
4
4
|
import { inputArgTypes, labelArgTypes } from '@/storybook/formArgTypes';
|
|
5
5
|
|
|
6
|
+
import { Input, type InputProps } from './Input';
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
const meta: Meta = {
|
|
7
10
|
title: 'Forms/Input',
|
|
8
11
|
component: Input,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { Icon } from '../../../components/icons/Icon';
|
|
5
|
-
import { IconName } from '../../../components/icons/types';
|
|
6
|
-
import { withLabel, LabelProps } from '../subcomponents/Label';
|
|
5
|
+
import { type IconName } from '../../../components/icons/types';
|
|
7
6
|
import { DisplayFormError } from '../subcomponents/DisplayFormError';
|
|
7
|
+
import { withLabel, type LabelProps } from '../subcomponents/Label';
|
|
8
8
|
|
|
9
9
|
export interface BaseInputProps {
|
|
10
10
|
id?: string;
|
|
@@ -46,6 +46,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
46
46
|
onBlur,
|
|
47
47
|
onKeyDown,
|
|
48
48
|
className,
|
|
49
|
+
text: _text,
|
|
49
50
|
...rest
|
|
50
51
|
},
|
|
51
52
|
ref,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { render, screen
|
|
2
|
-
import { Input } from '@/components/forms/input/Input';
|
|
3
|
-
import { ChangeEvent } from 'react';
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
4
2
|
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { type ChangeEvent } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Input } from '@/components/forms/input/Input';
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
const handleOnChange = jest.fn();
|
|
7
9
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { NumberInput, NumberInputProps } from './NumberInput';
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
2
|
import { useEffect, useState } from 'react';
|
|
3
|
+
|
|
4
4
|
import { labelArgTypes, inputArgTypes } from '@/storybook/formArgTypes';
|
|
5
5
|
|
|
6
|
+
import { NumberInput, type NumberInputProps } from './NumberInput';
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
const meta: Meta = {
|
|
7
10
|
title: 'Forms/Number Input',
|
|
8
11
|
component: NumberInput,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { Icon } from '@/components/icons/Icon';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { type BaseInputProps } from '../input/Input';
|
|
6
7
|
import { DisplayFormError } from '../subcomponents/DisplayFormError';
|
|
7
|
-
import {
|
|
8
|
+
import { type LabelProps, withLabel } from '../subcomponents/Label';
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
export interface NumberInputProps extends Omit<BaseInputProps, 'value'>, LabelProps {
|
|
10
12
|
/** The value for the input field */
|
|
@@ -31,6 +33,7 @@ const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
31
33
|
helpText,
|
|
32
34
|
iconName,
|
|
33
35
|
className,
|
|
36
|
+
text: _text,
|
|
34
37
|
...rest
|
|
35
38
|
},
|
|
36
39
|
ref,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { NumberInput, type NumberInputProps } from '../NumberInput';
|
|
4
5
|
|
|
5
6
|
const handleOnChange = jest.fn();
|
|
6
7
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
import { type SetStateAction, useEffect, useState } from 'react';
|
|
3
|
+
|
|
4
4
|
import { baseInputArgTypes, labelArgTypes } from '@/storybook/formArgTypes';
|
|
5
5
|
|
|
6
|
+
import { PasswordInput, type PasswordInputProps } from './PasswordInput';
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
const meta: Meta = {
|
|
7
10
|
title: 'Forms/PasswordInput',
|
|
8
11
|
component: PasswordInput,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
1
2
|
import React, { useState } from 'react';
|
|
3
|
+
|
|
2
4
|
import { Icon } from '@/components/icons/Icon';
|
|
3
|
-
|
|
5
|
+
|
|
4
6
|
import { DisplayFormError } from '../subcomponents/DisplayFormError';
|
|
5
|
-
import
|
|
7
|
+
import { withLabel, type LabelProps } from '../subcomponents/Label';
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
export interface PasswordInputProps extends LabelProps {
|
|
8
11
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
@@ -32,6 +35,7 @@ const PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(
|
|
|
32
35
|
errorMessage,
|
|
33
36
|
helpText,
|
|
34
37
|
hasShowPassword = true,
|
|
38
|
+
text: _text,
|
|
35
39
|
...rest
|
|
36
40
|
},
|
|
37
41
|
ref,
|
|
@@ -55,7 +59,12 @@ const PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(
|
|
|
55
59
|
return (
|
|
56
60
|
<>
|
|
57
61
|
<div className="password-input-wrapper">
|
|
58
|
-
<Icon
|
|
62
|
+
<Icon
|
|
63
|
+
name="lock"
|
|
64
|
+
data-testid={`${name}-embedded-icon`}
|
|
65
|
+
className="embedded-icon"
|
|
66
|
+
size="sm"
|
|
67
|
+
/>
|
|
59
68
|
<input
|
|
60
69
|
ref={ref}
|
|
61
70
|
data-testid={`form-password-input-${name}`}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { render, screen
|
|
2
|
-
import { PasswordInput } from '@/components/forms/passwordInput/PasswordInput';
|
|
3
|
-
import { ChangeEvent } from 'react';
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
4
2
|
import userEvent from '@testing-library/user-event';
|
|
5
3
|
|
|
4
|
+
import { PasswordInput } from '@/components/forms/passwordInput/PasswordInput';
|
|
5
|
+
|
|
6
6
|
const handleOnChange = jest.fn();
|
|
7
|
-
const handleShowPassword = jest.fn();
|
|
8
7
|
|
|
9
8
|
describe('Input', () => {
|
|
10
9
|
it('renders the input field', () => {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
3
|
import { Col, Row } from '@/components/grid';
|
|
4
4
|
|
|
5
|
+
import { Radio } from './Radio';
|
|
6
|
+
|
|
7
|
+
|
|
5
8
|
const meta: Meta = {
|
|
6
9
|
title: 'Forms/Radio',
|
|
7
10
|
component: Radio,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { render, screen
|
|
2
|
-
import { Radio } from '@/components/forms/radio/Radio';
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
3
2
|
import userEvent from '@testing-library/user-event';
|
|
4
3
|
|
|
4
|
+
import { Radio } from '@/components/forms/radio/Radio';
|
|
5
|
+
|
|
5
6
|
const handleOnChange = jest.fn();
|
|
6
7
|
|
|
7
8
|
describe('radio', () => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { Select, type SelectProps } from './Select';
|
|
4
|
+
import { type SelectOption } from './types';
|
|
5
|
+
import { type LabelProps } from '../subcomponents/Label';
|
|
5
6
|
|
|
6
7
|
const meta: Meta<SelectProps<SelectOption> & LabelProps> = {
|
|
7
8
|
title: 'Forms/Select',
|
|
@@ -87,15 +88,16 @@ const meta: Meta<SelectProps<SelectOption> & LabelProps> = {
|
|
|
87
88
|
},
|
|
88
89
|
defaultValue: { summary: 'true' },
|
|
89
90
|
},
|
|
90
|
-
|
|
91
|
-
control: '
|
|
91
|
+
text: {
|
|
92
|
+
control: 'object',
|
|
93
|
+
description: 'Customizable text.',
|
|
92
94
|
table: {
|
|
93
|
-
category: '
|
|
95
|
+
category: 'i18n Text',
|
|
94
96
|
type: {
|
|
95
|
-
summary:
|
|
97
|
+
summary:
|
|
98
|
+
'{ placeholder?: string; noOptions?: string; loading?: string; required?: string }',
|
|
96
99
|
},
|
|
97
100
|
},
|
|
98
|
-
defaultValue: { summary: 'Select an option...' },
|
|
99
101
|
},
|
|
100
102
|
className: {
|
|
101
103
|
control: 'text',
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactSelect, { type Props as ReactSelectProps, components, type OptionProps } from 'react-select';
|
|
4
|
+
|
|
5
|
+
import { type SelectOption, type SelectText } from './types';
|
|
5
6
|
import { withLabel } from '../subcomponents/Label';
|
|
6
7
|
|
|
8
|
+
const DEFAULT_TEXT: Required<SelectText> = {
|
|
9
|
+
placeholder: 'Select...',
|
|
10
|
+
noOptions: 'No options',
|
|
11
|
+
loading: 'Loading...',
|
|
12
|
+
required: '(required)',
|
|
13
|
+
};
|
|
14
|
+
|
|
7
15
|
export interface SelectProps<OptionType extends SelectOption> extends ReactSelectProps<OptionType> {
|
|
8
16
|
/** Options for the select component */
|
|
9
17
|
options: OptionType[];
|
|
@@ -19,6 +27,8 @@ export interface SelectProps<OptionType extends SelectOption> extends ReactSelec
|
|
|
19
27
|
classNamePrefix?: string;
|
|
20
28
|
/** Event handler for when the selected value changes */
|
|
21
29
|
onChange?: (newValue: any, actionMeta: any) => void;
|
|
30
|
+
/** Customizable display text. */
|
|
31
|
+
text?: SelectText;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
const OptionComponent = <OptionType extends SelectOption>({
|
|
@@ -40,13 +50,15 @@ const Select = React.forwardRef(
|
|
|
40
50
|
classNamePrefix = 'select',
|
|
41
51
|
className,
|
|
42
52
|
components: customComponents,
|
|
43
|
-
label,
|
|
44
|
-
hasHiddenLabel,
|
|
45
|
-
name,
|
|
53
|
+
label: _label,
|
|
54
|
+
hasHiddenLabel: _hasHiddenLabel,
|
|
55
|
+
name: _name,
|
|
56
|
+
text: textProp,
|
|
46
57
|
...props
|
|
47
58
|
}: SelectProps<OptionType>,
|
|
48
59
|
ref: React.Ref<any>,
|
|
49
60
|
) => {
|
|
61
|
+
const text = { ...DEFAULT_TEXT, ...textProp };
|
|
50
62
|
const defaultComponents = {
|
|
51
63
|
Option: OptionComponent as React.ComponentType<OptionProps<OptionType>>,
|
|
52
64
|
};
|
|
@@ -59,6 +71,9 @@ const Select = React.forwardRef(
|
|
|
59
71
|
classNamePrefix={classNamePrefix}
|
|
60
72
|
className={classNames('select-wrapper', className)}
|
|
61
73
|
components={mergedComponents}
|
|
74
|
+
placeholder={text.placeholder}
|
|
75
|
+
noOptionsMessage={() => text.noOptions}
|
|
76
|
+
loadingMessage={() => text.loading}
|
|
62
77
|
{...props}
|
|
63
78
|
/>
|
|
64
79
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
2
|
+
import { type OptionProps } from 'react-select';
|
|
2
3
|
|
|
3
4
|
import { Select } from '../Select';
|
|
4
|
-
import { SelectOption } from '../types';
|
|
5
|
-
import { OptionProps, components } from 'react-select';
|
|
5
|
+
import { type SelectOption } from '../types';
|
|
6
6
|
|
|
7
7
|
const options: SelectOption[] = [
|
|
8
8
|
{ value: 'option1', label: 'Option 1' },
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { type FormLabelText } from '../subcomponents/Label';
|
|
2
4
|
|
|
3
5
|
export type SelectOption = {
|
|
4
6
|
label: string;
|
|
@@ -6,3 +8,13 @@ export type SelectOption = {
|
|
|
6
8
|
detail?: ReactNode;
|
|
7
9
|
[key: string]: any; // Allow for additional properties
|
|
8
10
|
};
|
|
11
|
+
|
|
12
|
+
/** Customizable text for Select. Extends FormLabelText for label-related text. */
|
|
13
|
+
export interface SelectText extends FormLabelText {
|
|
14
|
+
/** Placeholder text when no option is selected. Default: "Select..." */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Text when there are no options. Default: "No options" */
|
|
17
|
+
noOptions?: string;
|
|
18
|
+
/** Text while loading options. Default: "Loading..." */
|
|
19
|
+
loading?: string;
|
|
20
|
+
}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { type FormLabelText } from './types';
|
|
4
|
+
|
|
5
|
+
import type React from 'react';
|
|
6
|
+
|
|
7
|
+
export type { FormLabelText } from './types';
|
|
8
|
+
|
|
9
|
+
const DEFAULT_TEXT: Required<FormLabelText> = {
|
|
10
|
+
required: '(required)',
|
|
11
|
+
};
|
|
2
12
|
|
|
3
13
|
export interface LabelProps {
|
|
4
14
|
label?: string;
|
|
5
15
|
name: string;
|
|
6
16
|
isRequired?: boolean;
|
|
7
17
|
hasHiddenLabel?: boolean;
|
|
18
|
+
/** Customizable display text. */
|
|
19
|
+
text?: FormLabelText;
|
|
8
20
|
}
|
|
9
21
|
|
|
10
22
|
export const Label = ({ label, name, isRequired }: LabelProps) => {
|
|
@@ -21,17 +33,25 @@ export const Label = ({ label, name, isRequired }: LabelProps) => {
|
|
|
21
33
|
// HOC to add common label functionality to components
|
|
22
34
|
export function withLabel<P extends object>(WrappedComponent: React.ComponentType<P>) {
|
|
23
35
|
const WithLabelComponent = (
|
|
24
|
-
{ label, hasHiddenLabel = false, name, isRequired, ...rest }: P & LabelProps,
|
|
36
|
+
{ label, hasHiddenLabel = false, name, isRequired, text: textProp, ...rest }: P & LabelProps,
|
|
25
37
|
ref: React.Ref<any>,
|
|
26
38
|
) => {
|
|
39
|
+
const text = { ...DEFAULT_TEXT, ...textProp };
|
|
27
40
|
const ariaLabel = hasHiddenLabel
|
|
28
|
-
? { 'aria-label': isRequired ? `${label}
|
|
41
|
+
? { 'aria-label': isRequired ? `${label} ${text.required}` : label }
|
|
29
42
|
: {};
|
|
30
43
|
|
|
31
44
|
return (
|
|
32
45
|
<div className="form-control">
|
|
33
46
|
{!hasHiddenLabel && <Label label={label} name={name} isRequired={isRequired} />}
|
|
34
|
-
<WrappedComponent
|
|
47
|
+
<WrappedComponent
|
|
48
|
+
{...(rest as P)}
|
|
49
|
+
id={name}
|
|
50
|
+
name={name}
|
|
51
|
+
{...ariaLabel}
|
|
52
|
+
text={textProp}
|
|
53
|
+
ref={ref}
|
|
54
|
+
/>
|
|
35
55
|
</div>
|
|
36
56
|
);
|
|
37
57
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
1
2
|
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { labelArgTypes,
|
|
3
|
+
|
|
4
|
+
import { labelArgTypes, baseInputArgTypes } from '@/storybook/formArgTypes';
|
|
5
|
+
|
|
4
6
|
import { Textarea } from './Textarea';
|
|
5
7
|
|
|
8
|
+
|
|
6
9
|
const meta: Meta = {
|
|
7
10
|
title: 'Forms/Textarea',
|
|
8
11
|
component: Textarea,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { withLabel, LabelProps } from '../subcomponents/Label';
|
|
5
4
|
import { DisplayFormError } from '../subcomponents/DisplayFormError';
|
|
5
|
+
import { withLabel, type LabelProps } from '../subcomponents/Label';
|
|
6
6
|
|
|
7
7
|
export interface TextareaProps extends LabelProps {
|
|
8
8
|
ref?: React.LegacyRef<HTMLTextAreaElement>;
|
|
@@ -33,7 +33,7 @@ export interface TextareaProps extends LabelProps {
|
|
|
33
33
|
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
34
34
|
(
|
|
35
35
|
{
|
|
36
|
-
label,
|
|
36
|
+
label: _label,
|
|
37
37
|
name,
|
|
38
38
|
placeholder,
|
|
39
39
|
value,
|
|
@@ -43,7 +43,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
43
43
|
isDisabled,
|
|
44
44
|
errorMessage,
|
|
45
45
|
helpText,
|
|
46
|
-
hasHiddenLabel,
|
|
46
|
+
hasHiddenLabel: _hasHiddenLabel,
|
|
47
47
|
rows,
|
|
48
48
|
cols,
|
|
49
49
|
readonly,
|
|
@@ -53,6 +53,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
53
53
|
autofocus,
|
|
54
54
|
defaultValue,
|
|
55
55
|
tabIndex,
|
|
56
|
+
text: _text,
|
|
56
57
|
...rest
|
|
57
58
|
},
|
|
58
59
|
ref,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { render, screen
|
|
2
|
-
import { Textarea } from '@/components/forms/textarea/Textarea';
|
|
3
|
-
import { ChangeEvent } from 'react';
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
4
2
|
import userEvent from '@testing-library/user-event';
|
|
5
3
|
|
|
4
|
+
import { Textarea } from '@/components/forms/textarea/Textarea';
|
|
5
|
+
|
|
6
6
|
const handleOnChange = jest.fn();
|
|
7
7
|
|
|
8
8
|
describe('Textarea', () => {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { TimePicker } from './TimePicker';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
1
|
import { useArgs } from '@storybook/preview-api';
|
|
2
|
+
|
|
3
|
+
import { TimePicker } from './TimePicker';
|
|
4
4
|
import { Col, Row } from '../../grid';
|
|
5
5
|
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
7
|
+
|
|
6
8
|
const meta: Meta<typeof TimePicker> = {
|
|
7
9
|
title: 'Forms/TimePicker',
|
|
8
10
|
component: TimePicker,
|
|
@@ -44,6 +46,16 @@ const meta: Meta<typeof TimePicker> = {
|
|
|
44
46
|
control: 'text',
|
|
45
47
|
defaultValue: 'Time Picker',
|
|
46
48
|
},
|
|
49
|
+
text: {
|
|
50
|
+
control: 'object',
|
|
51
|
+
description: 'Customizable text.',
|
|
52
|
+
table: {
|
|
53
|
+
category: 'i18n Text',
|
|
54
|
+
type: {
|
|
55
|
+
summary: '{ validationError?: string }',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
47
59
|
},
|
|
48
60
|
decorators: [
|
|
49
61
|
(Story: React.ComponentType) => (
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { ChangeEvent, useState, FocusEvent } from 'react';
|
|
2
|
-
import { Input } from '../input/Input';
|
|
3
|
-
import { FloatUI } from '../../floatUI/FloatUI';
|
|
4
|
-
import { formatTimeValue, validateInputValue } from './helpers';
|
|
5
1
|
import { offset, flip, shift } from '@floating-ui/react';
|
|
2
|
+
import { type ChangeEvent, useState, type FocusEvent } from 'react';
|
|
3
|
+
|
|
4
|
+
import { formatTimeValue, validateInputValue } from './helpers';
|
|
5
|
+
import { type TimePickerText } from './types';
|
|
6
|
+
import { FloatUI } from '../../floatUI/FloatUI';
|
|
7
|
+
import { Input } from '../input/Input';
|
|
8
|
+
|
|
9
|
+
const DEFAULT_TEXT: Required<TimePickerText> = {
|
|
10
|
+
validationError: 'Time validation error',
|
|
11
|
+
};
|
|
6
12
|
|
|
7
13
|
interface TimePickerProps {
|
|
8
14
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
@@ -20,6 +26,8 @@ interface TimePickerProps {
|
|
|
20
26
|
isReadOnly?: boolean;
|
|
21
27
|
isDisabled?: boolean;
|
|
22
28
|
tabIndex?: number;
|
|
29
|
+
/** Customizable display text. */
|
|
30
|
+
text?: TimePickerText;
|
|
23
31
|
[key: string]: unknown;
|
|
24
32
|
}
|
|
25
33
|
|
|
@@ -34,8 +42,10 @@ export const TimePicker = ({
|
|
|
34
42
|
isDisabled,
|
|
35
43
|
isReadOnly,
|
|
36
44
|
tabIndex,
|
|
45
|
+
text: textProp,
|
|
37
46
|
...rest
|
|
38
47
|
}: TimePickerProps) => {
|
|
48
|
+
const text = { ...DEFAULT_TEXT, ...textProp };
|
|
39
49
|
const [validationError, setValidationError] = useState('');
|
|
40
50
|
const [inputValue, setInputValue] = useState(timeValue);
|
|
41
51
|
|
|
@@ -82,7 +92,7 @@ export const TimePicker = ({
|
|
|
82
92
|
/>
|
|
83
93
|
{/* This is a temporary work around to address a validation issue in cenote*/}
|
|
84
94
|
<FloatUI
|
|
85
|
-
ariaLabel=
|
|
95
|
+
ariaLabel={text.validationError}
|
|
86
96
|
isOpen={!!validationError}
|
|
87
97
|
setIsOpen={() => {}} // Prevent click-to-open behavior
|
|
88
98
|
isPortal
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import { TimePicker } from '@/components/forms/timePicker/TimePicker';
|
|
3
2
|
import userEvent from '@testing-library/user-event';
|
|
4
3
|
|
|
4
|
+
import { TimePicker } from '@/components/forms/timePicker/TimePicker';
|
|
5
|
+
|
|
5
6
|
describe('TimePicker', () => {
|
|
6
7
|
// TODO -- fix this when we decide on a validation strategy
|
|
7
8
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Toggle } from './Toggle';
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
2
|
import { useState } from 'react';
|
|
4
3
|
|
|
4
|
+
import { Toggle } from './Toggle';
|
|
5
|
+
|
|
5
6
|
const meta: Meta = {
|
|
6
7
|
title: 'Forms/Toggle',
|
|
7
8
|
component: Toggle,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { render, screen
|
|
2
|
-
import { Toggle } from '@/components/forms/toggle/Toggle';
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
3
2
|
import userEvent from '@testing-library/user-event';
|
|
4
3
|
|
|
4
|
+
import { Toggle } from '@/components/forms/toggle/Toggle';
|
|
5
|
+
|
|
5
6
|
const handleOnChange = jest.fn();
|
|
6
7
|
|
|
7
8
|
describe('Toggle', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container as RgsContainer, ContainerProps } from 'react-grid-system';
|
|
1
|
+
import { Container as RgsContainer, type ContainerProps } from 'react-grid-system';
|
|
2
2
|
|
|
3
3
|
export const Container = ({ ref: _ref, ...rest }: ContainerProps) => {
|
|
4
4
|
return <RgsContainer {...rest} />;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { Icon, Row, Col, Button } from '@/components';
|
|
4
|
-
import { IconName, IconProps, IconSizes } from './types';
|
|
5
1
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Icon, Row, Col, Button } from '@/components';
|
|
6
6
|
import { registerFontAwesomeIcons } from '@/index';
|
|
7
7
|
import { fontAwesomeIconNames, iconNames, indiconIconNames } from '@/storybook/iconNames';
|
|
8
|
+
|
|
8
9
|
import { indiconDefinitions } from './indicons';
|
|
10
|
+
import { type IconName, type IconProps, type IconSizes } from './types';
|
|
11
|
+
|
|
12
|
+
import type React from 'react';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
9
16
|
|
|
10
17
|
registerFontAwesomeIcons(...Object.values(fas), ...indiconDefinitions);
|
|
11
18
|
|