@innovaccer/design-system 2.13.2 → 2.13.4-1
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/core/components/atoms/checkbox/__stories__/Alignment.story.jsx +11 -13
- package/core/components/atoms/dropdown/Dropdown.tsx +18 -2
- package/core/components/atoms/dropdown/DropdownList.tsx +47 -57
- package/core/components/atoms/dropdown/__stories__/LabelInline.story.jsx +58 -0
- package/core/components/atoms/dropdown/__stories__/{LabelPositionInDropdown.story.jsx → LabelOnTop.story.jsx} +8 -9
- package/core/components/atoms/dropdown/option/DefaultOption.tsx +1 -1
- package/core/components/atoms/dropdown/utility.tsx +6 -0
- package/core/components/atoms/icon/__stories__/variants/Image.story.jsx +3 -3
- package/core/components/css-utilities/Miscellaneous/Miscellaneous.story.tsx +4 -0
- package/core/components/molecules/dropzone/FileSelectorUtils.tsx +3 -0
- package/core/components/molecules/sidesheet/__stories__/variants/twoSteps.story.jsx +6 -4
- package/core/components/organisms/calendar/__stories__/index.story.jsx +4 -6
- package/core/components/organisms/dateRangePicker/__stories__/variants/withSingleInput.story.jsx +3 -0
- package/core/components/organisms/horizontalNav/__stories__/leftAlign.story.jsx +35 -19
- package/core/components/organisms/pageHeader/__stories__/Responsiveness.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withNavigation.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withNavigationL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withStepper.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withStepperL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withTabs.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withTabsL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withFilter.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withFilterL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withNavigation.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withNavigationL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withStepperL1.story.jsx +4 -4
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.jsx +4 -4
- package/core/components/organisms/timePicker/TimePicker.tsx +6 -113
- package/core/components/organisms/timePicker/TimePickerWithInput.tsx +124 -0
- package/core/components/organisms/timePicker/TimePickerWithSearch.tsx +198 -0
- package/core/components/organisms/timePicker/__stories__/TimeIntervals.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/disabledOption.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/fromTo.story.jsx +72 -0
- package/core/components/organisms/timePicker/__stories__/showDuration.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/withDatePicker.story.jsx +88 -0
- package/core/components/organisms/timePicker/__stories__/{index.story.jsx → withInput.story.jsx} +6 -3
- package/core/components/organisms/timePicker/__stories__/withSearch.story.jsx +89 -0
- package/core/components/organisms/timePicker/__tests__/TimePickerWithSearch.test.tsx +486 -0
- package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePickerWithSearch.test.tsx.snap +169 -0
- package/core/components/organisms/timePicker/index.tsx +2 -0
- package/core/components/organisms/timePicker/utility/searchUtils.tsx +295 -0
- package/core/components/organisms/timePicker/utility/timePickerUtility.tsx +219 -0
- package/core/components/organisms/timePicker/utils.tsx +1 -1
- package/core/index.tsx +1 -0
- package/css/dist/index.css +4 -10
- package/css/dist/index.css.map +1 -1
- package/css/src/components/dropdown.css +2 -6
- package/css/src/components/metricInput.css +1 -0
- package/css/src/components/modal.css +1 -2
- package/dist/core/components/atoms/dropdown/Dropdown.d.ts +2 -0
- package/dist/core/components/atoms/dropdown/DropdownList.d.ts +1 -0
- package/dist/core/components/atoms/dropdown/utility.d.ts +1 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +22 -22
- package/dist/core/components/organisms/timePicker/TimePicker.d.ts +5 -13
- package/dist/core/components/organisms/timePicker/TimePickerWithInput.d.ts +24 -0
- package/dist/core/components/organisms/timePicker/TimePickerWithSearch.d.ts +32 -0
- package/dist/core/components/organisms/timePicker/index.d.ts +2 -0
- package/dist/core/components/organisms/timePicker/utility/searchUtils.d.ts +7 -0
- package/dist/core/components/organisms/timePicker/utility/timePickerUtility.d.ts +19 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/index.esm.js +709 -46
- package/dist/index.js +638 -68
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/docs/.eslintrc.json +32 -1
- package/docs/.prettierrc +6 -0
- package/docs/README.md +14 -0
- package/docs/cypress/e2e/main.cy.js +35 -0
- package/docs/cypress/fixtures/example.json +5 -0
- package/docs/cypress/support/commands.ts +37 -0
- package/docs/cypress/support/e2e.ts +20 -0
- package/docs/cypress.config.js +9 -0
- package/docs/package.json +16 -2
- package/docs/src/components/Colors/Colors.js +13 -41
- package/docs/src/components/Container/ComponentsContainer.js +10 -30
- package/docs/src/components/Container/Container.js +10 -41
- package/docs/src/components/ErrorBoundary.js +9 -3
- package/docs/src/components/Footer/Footer.js +11 -10
- package/docs/src/components/GlobalSearch/index.js +47 -44
- package/docs/src/components/Header/Header.css +4 -0
- package/docs/src/components/Header/Header.js +25 -19
- package/docs/src/components/Layout.js +110 -172
- package/docs/src/components/LeftNav/LeftNav.js +12 -28
- package/docs/src/components/Logos/Logos.js +12 -26
- package/docs/src/components/MDXHeading.js +12 -18
- package/docs/src/components/Meta.js +9 -9
- package/docs/src/components/PropsTable/ArgJsDoc.tsx +2 -6
- package/docs/src/components/PropsTable/ArgRow.tsx +19 -47
- package/docs/src/components/PropsTable/ArgValue.tsx +50 -93
- package/docs/src/components/PropsTable/EmptyBlock.tsx +2 -5
- package/docs/src/components/PropsTable/SectionRow.tsx +7 -18
- package/docs/src/components/PropsTable/Table.tsx +43 -130
- package/docs/src/components/PropsTable/generateImports.tsx +1 -3
- package/docs/src/components/PropsTable/index.js +94 -140
- package/docs/src/components/PropsTable/prism.css +19 -20
- package/docs/src/components/Rules/DONTs.js +1 -6
- package/docs/src/components/Rules/DOs.js +1 -6
- package/docs/src/components/Rules/IconWrapper.js +6 -7
- package/docs/src/components/Rules/InlineMessage.js +1 -5
- package/docs/src/components/Rules/Rules.js +18 -28
- package/docs/src/components/TableOfContent/TableOfContent.js +49 -54
- package/docs/src/components/css/global.css +1 -1
- package/docs/src/components/css/prism.css +1 -1
- package/docs/src/components/css/style.css +7 -3
- package/docs/src/components/templates/Default.js +1 -1
- package/docs/src/components/templates/Homepage.js +4 -6
- package/docs/src/data/components/Overview.js +49 -56
- package/docs/src/data/components/images/Calendar.png +0 -0
- package/docs/src/data/components/images/MetaList.png +0 -0
- package/docs/src/data/components/images/PageHeader.png +0 -0
- package/docs/src/data/components/images/TimePicker.png +0 -0
- package/docs/src/data/components/images/mobile/Badge.png +0 -0
- package/docs/src/data/components/images/mobile/Dropdown.png +0 -0
- package/docs/src/data/components/images/mobile/Message.png +0 -0
- package/docs/src/data/components/images/mobile/MetaList.png +0 -0
- package/docs/src/data/components/images/mobile/Slider.png +0 -0
- package/docs/src/data/components/images/mobile/StatusHint.png +0 -0
- package/docs/src/data/components/images/mobile/Stepper.png +0 -0
- package/docs/src/data/components/index.js +168 -321
- package/docs/src/data/components/mobile.js +85 -125
- package/docs/src/data/components/overview.css +4 -2
- package/docs/src/data/components/patterns.js +25 -59
- package/docs/src/data/header-items.yaml +1 -0
- package/docs/src/data/nav/components.yaml +1 -7
- package/docs/src/pages/404.js +7 -17
- package/docs/src/pages/components/avatar/usage.mdx +1 -0
- package/docs/src/pages/components/button/usage.mdx +2 -2
- package/docs/src/pages/components/calendar/usage.mdx +3 -3
- package/docs/src/pages/components/chips/images/actionchip-state.png +0 -0
- package/docs/src/pages/components/chips/images/inputchips-state.png +0 -0
- package/docs/src/pages/components/chips/images/selectionchip-state.png +0 -0
- package/docs/src/pages/components/chips/usage.mdx +24 -2
- package/docs/src/pages/components/datePicker/images/datePicker-3.png +0 -0
- package/docs/src/pages/components/datePicker/images/datePicker-6.png +0 -0
- package/docs/src/pages/components/datePicker/usage.mdx +9 -2
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-2.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-3.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-1.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-4.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/usage.mdx +4 -4
- package/docs/src/pages/components/inputs/usage.mdx +7 -7
- package/docs/src/pages/components/tabs/images/tabs-1.png +0 -0
- package/docs/src/pages/content/button-guidelines/tabs/button-glossary.mdx +1776 -1
- package/docs/src/pages/content/button-guidelines/tabs/confusing-buttons.mdx +479 -8
- package/docs/src/pages/content/email-guidelines.mdx +3 -3
- package/docs/src/pages/content/house-rules/tabs/date,-time-&-numbers.mdx +24 -0
- package/docs/src/pages/content/house-rules/tabs/grammer.mdx +42 -2
- package/docs/src/pages/content/house-rules/tabs/punctuations.mdx +32 -0
- package/docs/src/pages/foundations/colors.mdx +338 -24
- package/docs/src/pages/foundations/layout/index.mdx +57 -82
- package/docs/src/pages/foundations/response-time.mdx +32 -77
- package/docs/src/pages/index.js +92 -121
- package/docs/src/pages/mobile/components/badges/images/badge-1.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-2.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-3.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-4.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-5.png +0 -0
- package/docs/src/pages/mobile/components/badges/usage.mdx +100 -0
- package/docs/src/pages/mobile/components/card/images/mcard-1.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-2.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-3.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-4.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-5.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-6.png +0 -0
- package/docs/src/pages/mobile/components/card/usage.mdx +54 -67
- package/docs/src/pages/mobile/components/checkbox/images/checkbox-1.png +0 -0
- package/docs/src/pages/mobile/components/checkbox/usage.mdx +26 -2
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-1.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-10.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-11.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-2.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-3.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-4.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-5.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-6.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-7.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-8.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-9.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/usage.mdx +88 -0
- package/docs/src/pages/mobile/components/message/images/messages-1.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-10.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-11.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-12.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-2.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-3.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-4.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-5.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-6.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-7.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-8.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-9.png +0 -0
- package/docs/src/pages/mobile/components/message/usage.mdx +170 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-1.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-2.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-3.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-4.png +0 -0
- package/docs/src/pages/mobile/components/metaList/usage.mdx +71 -0
- package/docs/src/pages/mobile/components/slider/images/slider-1.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-2.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-3.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-4.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-5.png +0 -0
- package/docs/src/pages/mobile/components/slider/usage.mdx +83 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-1.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-2.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-3.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-4.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-5.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-6.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-7.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/usage.mdx +108 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-1.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-2.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-3.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-4.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-5.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-6.png +0 -0
- package/docs/src/pages/mobile/components/steppers/usage.mdx +111 -0
- package/docs/src/pages/mobile/foundations/layout/images/layout-2.png +0 -0
- package/docs/src/pages/mobile/foundations/layout/index.mdx +3 -1
- package/docs/src/pages/mobile/foundations/page-types/index.mdx +0 -214
- package/docs/src/pages/mobile/foundations/spacing/index.mdx +5 -0
- package/docs/src/pages/mobile/foundations/typography.mdx +1 -1
- package/docs/src/pages/patterns/uiStates/usage.mdx +92 -0
- package/docs/src/util/Frontmatter.js +4 -4
- package/docs/src/util/HeaderItems.js +2 -1
- package/docs/src/util/Helpers.js +3 -3
- package/docs/src/util/HomeIcons.js +91 -53
- package/docs/src/util/InPageNavItems.js +2 -6
- package/docs/src/util/Logos.js +2 -2
- package/docs/src/util/MdsChangelog.js +5 -10
- package/docs/src/util/MediumBlogs.js +13 -13
- package/docs/src/util/NavItems.js +14 -17
- package/docs/src/util/Search.js +2 -2
- package/docs/src/util/StorybookData.js +2 -4
- package/docs/src/util/constants.js +1 -5
- package/docs/src/util/context/NavContext.js +1 -4
- package/docs/src/util/hooks/useMetadata.js +1 -1
- package/package.json +1 -1
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-2.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-3.png +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TimePicker, Label, Row } from '@/index';
|
|
3
|
+
import { TimePickerWithSearch } from '../TimePickerWithSearch';
|
|
4
|
+
import { TimePickerWithInput } from '../TimePickerWithInput';
|
|
5
|
+
|
|
6
|
+
// CSF format story
|
|
7
|
+
export const TimeIntervals = () => {
|
|
8
|
+
return (
|
|
9
|
+
<Row>
|
|
10
|
+
<div className="w-25">
|
|
11
|
+
<Label>12 Hour Format (1 hour Interval)</Label>
|
|
12
|
+
<TimePicker withSearch={true} interval={60} id="12-hour" />
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div className="w-25 ml-7">
|
|
16
|
+
<Label>24 Hour Format (1 hour Interval)</Label>
|
|
17
|
+
<TimePicker timeFormat="24-Hour" withSearch={true} interval={60} id="24-hour" />
|
|
18
|
+
</div>
|
|
19
|
+
</Row>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const customCode = `() => {
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Row>
|
|
27
|
+
<div className="w-25">
|
|
28
|
+
<Label>12 Hour Format (1 hour Interval)</Label>
|
|
29
|
+
<TimePicker withSearch={true} interval={60} id="12-hour" />
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div className="w-25 ml-7">
|
|
33
|
+
<Label>24 Hour Format (1 hour Interval)</Label>
|
|
34
|
+
<TimePicker timeFormat="24-Hour" withSearch={true} interval={60} id="24-hour" />
|
|
35
|
+
</div>
|
|
36
|
+
</Row>
|
|
37
|
+
);
|
|
38
|
+
}`;
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
title: 'Components/TimePicker/Time Intervals',
|
|
42
|
+
component: TimePickerWithInput,
|
|
43
|
+
subcomponents: { TimePickerWithSearch },
|
|
44
|
+
parameters: {
|
|
45
|
+
docs: {
|
|
46
|
+
docPage: {
|
|
47
|
+
customCode,
|
|
48
|
+
title: 'TimePicker',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TimePicker, Label, Row } from '@/index';
|
|
3
|
+
import { TimePickerWithSearch } from '../TimePickerWithSearch';
|
|
4
|
+
import { TimePickerWithInput } from '../TimePickerWithInput';
|
|
5
|
+
|
|
6
|
+
// CSF format story
|
|
7
|
+
export const disabledOption = () => {
|
|
8
|
+
return (
|
|
9
|
+
<Row>
|
|
10
|
+
<div className="w-25">
|
|
11
|
+
<Label>12 Hour Format</Label>
|
|
12
|
+
<TimePicker withSearch={true} disabledSlotList={['12:45 AM', '01:00 AM']} id="12-hour" />
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div className="w-25 ml-7">
|
|
16
|
+
<Label>24 Hour Format</Label>
|
|
17
|
+
<TimePicker timeFormat="24-Hour" withSearch={true} disabledSlotList={['00:45', '01:00']} id="24-hour" />
|
|
18
|
+
</div>
|
|
19
|
+
</Row>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const customCode = `() => {
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Row>
|
|
27
|
+
<div className="w-25">
|
|
28
|
+
<Label>12 Hour Format</Label>
|
|
29
|
+
<TimePicker withSearch={true} disabledSlotList={['12:45 AM', '01:00 AM']} id="12-hour" />
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div className="w-25 ml-7">
|
|
33
|
+
<Label>24 Hour Format</Label>
|
|
34
|
+
<TimePicker timeFormat="24-Hour" withSearch={true} disabledSlotList={['00:45', '01:00']} id="24-hour" />
|
|
35
|
+
</div>
|
|
36
|
+
</Row>
|
|
37
|
+
);
|
|
38
|
+
}`;
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
title: 'Components/TimePicker/Disabled Option',
|
|
42
|
+
component: TimePickerWithInput,
|
|
43
|
+
subcomponents: { TimePickerWithSearch },
|
|
44
|
+
parameters: {
|
|
45
|
+
docs: {
|
|
46
|
+
docPage: {
|
|
47
|
+
customCode,
|
|
48
|
+
title: 'TimePicker',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TimePicker, Label } from '@/index';
|
|
3
|
+
import { TimePickerWithInput } from '../TimePickerWithInput';
|
|
4
|
+
import { TimePickerWithSearch } from '../TimePickerWithSearch';
|
|
5
|
+
|
|
6
|
+
// CSF format story
|
|
7
|
+
export const FromTo = () => {
|
|
8
|
+
const [startTime, setStartTime] = React.useState('00:00');
|
|
9
|
+
|
|
10
|
+
const onFromChangeHandler = (props) => {
|
|
11
|
+
setStartTime(props);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="d-flex">
|
|
16
|
+
<div className="w-25 mr-5">
|
|
17
|
+
<Label withInput={true}>From</Label>
|
|
18
|
+
<TimePicker
|
|
19
|
+
withSearch={true}
|
|
20
|
+
startTime="00:15 AM"
|
|
21
|
+
endTime="11:45 PM"
|
|
22
|
+
onChange={onFromChangeHandler}
|
|
23
|
+
id="From"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div className="w-25">
|
|
28
|
+
<Label withInput={true}>To</Label>
|
|
29
|
+
<TimePicker withSearch={true} startTime={startTime} endTime="11:45 PM" showDuration={true} id="To" />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const customCode = `() => {
|
|
36
|
+
|
|
37
|
+
const [startTime, setStartTime] = React.useState('00:00');
|
|
38
|
+
|
|
39
|
+
const onFromChangeHandler = (props) => {
|
|
40
|
+
setStartTime(props);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="d-flex">
|
|
45
|
+
<div className="w-25 mr-5">
|
|
46
|
+
<Label withInput={true}>From</Label>
|
|
47
|
+
<TimePicker withSearch={true} startTime="00:15 AM" endTime="11:45 PM" onChange={onFromChangeHandler} id="From" />
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div className="w-25">
|
|
51
|
+
<Label withInput={true}>To</Label>
|
|
52
|
+
<TimePicker withSearch={true} startTime={startTime} endTime="11:45 PM" showDuration={true} id="To" />
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}`;
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
title: 'Components/TimePicker/From To',
|
|
60
|
+
component: TimePicker,
|
|
61
|
+
parameters: {
|
|
62
|
+
docs: {
|
|
63
|
+
docPage: {
|
|
64
|
+
customCode,
|
|
65
|
+
title: 'TimePicker',
|
|
66
|
+
props: {
|
|
67
|
+
components: { TimePickerWithInput, TimePickerWithSearch },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TimePicker, Label, Row } from '@/index';
|
|
3
|
+
import { TimePickerWithSearch } from '../TimePickerWithSearch';
|
|
4
|
+
import { TimePickerWithInput } from '../TimePickerWithInput';
|
|
5
|
+
|
|
6
|
+
// CSF format story
|
|
7
|
+
export const timeDuration = () => {
|
|
8
|
+
return (
|
|
9
|
+
<Row>
|
|
10
|
+
<div className="w-25">
|
|
11
|
+
<Label>12 Hour Format</Label>
|
|
12
|
+
<TimePicker startTime="05:00" withSearch={true} showDuration={true} id="12-hour" />
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div className="w-25 ml-7">
|
|
16
|
+
<Label>24 Hour Format</Label>
|
|
17
|
+
<TimePicker startTime="05:00" timeFormat="24-Hour" withSearch={true} showDuration={true} id="24-hour" />
|
|
18
|
+
</div>
|
|
19
|
+
</Row>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const customCode = `() => {
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Row>
|
|
27
|
+
<div className="w-25">
|
|
28
|
+
<Label>12 Hour Format</Label>
|
|
29
|
+
<TimePicker startTime="05:00" withSearch={true} showDuration={true} id="12-hour" />
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div className="w-25 ml-7">
|
|
33
|
+
<Label>24 Hour Format</Label>
|
|
34
|
+
<TimePicker startTime="05:00" timeFormat="24-Hour" withSearch={true} showDuration={true} id="24-hour" />
|
|
35
|
+
</div>
|
|
36
|
+
</Row>
|
|
37
|
+
);
|
|
38
|
+
}`;
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
title: 'Components/TimePicker/Time Duration',
|
|
42
|
+
component: TimePickerWithInput,
|
|
43
|
+
subcomponents: { TimePickerWithSearch },
|
|
44
|
+
parameters: {
|
|
45
|
+
docs: {
|
|
46
|
+
docPage: {
|
|
47
|
+
customCode,
|
|
48
|
+
title: 'TimePicker',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TimePicker, DatePicker, Row, Label } from '@/index';
|
|
3
|
+
import { TimePickerWithInput } from '../TimePickerWithInput';
|
|
4
|
+
import { TimePickerWithSearch } from '../TimePickerWithSearch';
|
|
5
|
+
|
|
6
|
+
// CSF format story
|
|
7
|
+
export const withDatePicker = () => {
|
|
8
|
+
const [open, setOpen] = React.useState(false);
|
|
9
|
+
|
|
10
|
+
const handleDateChange = (date) => {
|
|
11
|
+
if (date) {
|
|
12
|
+
setOpen(false);
|
|
13
|
+
window.setTimeout(() => {
|
|
14
|
+
setOpen(true);
|
|
15
|
+
}, 0);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Row>
|
|
21
|
+
<div className="w-25">
|
|
22
|
+
<Label>Date</Label>
|
|
23
|
+
<DatePicker
|
|
24
|
+
firstDayOfWeek="saturday"
|
|
25
|
+
onDateChange={handleDateChange}
|
|
26
|
+
outputFormat="yyyy/mm/dd"
|
|
27
|
+
withInput={true}
|
|
28
|
+
inputOptions={{
|
|
29
|
+
required: true,
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
<div className="w-25 ml-7">
|
|
34
|
+
<Label>Time</Label>
|
|
35
|
+
<TimePicker withSearch={true} open={open} />
|
|
36
|
+
</div>
|
|
37
|
+
</Row>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const customCode = `() => {
|
|
42
|
+
|
|
43
|
+
const [open, setOpen] = React.useState(false);
|
|
44
|
+
|
|
45
|
+
const handleDateChange = (date) => {
|
|
46
|
+
if(date) {
|
|
47
|
+
setOpen(false);
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
setOpen(true);
|
|
50
|
+
}, 0);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Row>
|
|
56
|
+
<div className="w-25">
|
|
57
|
+
<Label>Date</Label>
|
|
58
|
+
<DatePicker
|
|
59
|
+
firstDayOfWeek="saturday"
|
|
60
|
+
onDateChange={handleDateChange}
|
|
61
|
+
outputFormat="yyyy/mm/dd"
|
|
62
|
+
withInput={true}
|
|
63
|
+
inputOptions={{
|
|
64
|
+
required: true,
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
<div className="w-25 ml-7">
|
|
69
|
+
<Label>Time</Label>
|
|
70
|
+
<TimePicker withSearch={true} open={open} />
|
|
71
|
+
</div>
|
|
72
|
+
</Row>
|
|
73
|
+
);
|
|
74
|
+
}`;
|
|
75
|
+
|
|
76
|
+
export default {
|
|
77
|
+
title: 'Components/TimePicker/With Date Picker',
|
|
78
|
+
component: TimePickerWithInput,
|
|
79
|
+
subcomponents: { TimePickerWithSearch },
|
|
80
|
+
parameters: {
|
|
81
|
+
docs: {
|
|
82
|
+
docPage: {
|
|
83
|
+
customCode,
|
|
84
|
+
title: 'TimePicker',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
package/core/components/organisms/timePicker/__stories__/{index.story.jsx → withInput.story.jsx}
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TimePicker } from '@/index';
|
|
3
3
|
import { action } from '@/utils/action';
|
|
4
|
+
import { TimePickerWithSearch } from '../TimePickerWithSearch';
|
|
5
|
+
import { TimePickerWithInput } from '../TimePickerWithInput';
|
|
4
6
|
|
|
5
7
|
// CSF format story
|
|
6
|
-
export const
|
|
8
|
+
export const withInput = () => {
|
|
7
9
|
const inputFormat = 'hh:mm AM';
|
|
8
10
|
|
|
9
11
|
const outputFormat = 'hh:mm';
|
|
@@ -41,8 +43,9 @@ const customCode = `() => {
|
|
|
41
43
|
}`;
|
|
42
44
|
|
|
43
45
|
export default {
|
|
44
|
-
title: 'Components/TimePicker/
|
|
45
|
-
component:
|
|
46
|
+
title: 'Components/TimePicker/With Input',
|
|
47
|
+
component: TimePickerWithInput,
|
|
48
|
+
subcomponents: { TimePickerWithSearch },
|
|
46
49
|
parameters: {
|
|
47
50
|
docs: {
|
|
48
51
|
docPage: {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TimePicker, Label, Row } from '@/index';
|
|
3
|
+
import { action } from '@/utils/action';
|
|
4
|
+
import { TimePickerWithSearch } from '../TimePickerWithSearch';
|
|
5
|
+
import { TimePickerWithInput } from '../TimePickerWithInput';
|
|
6
|
+
|
|
7
|
+
// CSF format story
|
|
8
|
+
export const withSearch = () => {
|
|
9
|
+
const onChangeHandler = (props) => {
|
|
10
|
+
return action(`updated time: ${props}`)();
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Row>
|
|
15
|
+
<div className="w-25">
|
|
16
|
+
<Label>12 Hour Format</Label>
|
|
17
|
+
<TimePicker
|
|
18
|
+
withSearch={true}
|
|
19
|
+
startTime="00:00 AM"
|
|
20
|
+
endTime="11:59 PM"
|
|
21
|
+
onChange={onChangeHandler}
|
|
22
|
+
noResultMessage="Invalid Time"
|
|
23
|
+
id="12-hour"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
<div className="w-25 ml-7">
|
|
27
|
+
<Label>24 Hour Format</Label>
|
|
28
|
+
<TimePicker
|
|
29
|
+
withSearch={true}
|
|
30
|
+
startTime="00:00 AM"
|
|
31
|
+
endTime="11:59 PM"
|
|
32
|
+
timeFormat="24-Hour"
|
|
33
|
+
onChange={onChangeHandler}
|
|
34
|
+
noResultMessage="Invalid Time"
|
|
35
|
+
id="24-hour"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</Row>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const customCode = `() => {
|
|
43
|
+
|
|
44
|
+
const onChangeHandler = (props) => {
|
|
45
|
+
console.log(props);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Row>
|
|
50
|
+
<div className="w-25">
|
|
51
|
+
<Label>12 Hour Format</Label>
|
|
52
|
+
<TimePicker
|
|
53
|
+
withSearch={true}
|
|
54
|
+
startTime="00:00 AM"
|
|
55
|
+
endTime="11:59 PM"
|
|
56
|
+
onChange={onChangeHandler}
|
|
57
|
+
noResultMessage="Invalid Time"
|
|
58
|
+
id="12-hour"
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
<div className="w-25 ml-7">
|
|
62
|
+
<Label>24 Hour Format</Label>
|
|
63
|
+
<TimePicker
|
|
64
|
+
withSearch={true}
|
|
65
|
+
startTime="00:00 AM"
|
|
66
|
+
endTime="11:59 PM"
|
|
67
|
+
timeFormat="24-Hour"
|
|
68
|
+
onChange={onChangeHandler}
|
|
69
|
+
noResultMessage="Invalid Time"
|
|
70
|
+
id="24-hour"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</Row>
|
|
74
|
+
);
|
|
75
|
+
}`;
|
|
76
|
+
|
|
77
|
+
export default {
|
|
78
|
+
title: 'Components/TimePicker/With Search',
|
|
79
|
+
component: TimePickerWithInput,
|
|
80
|
+
subcomponents: { TimePickerWithSearch },
|
|
81
|
+
parameters: {
|
|
82
|
+
docs: {
|
|
83
|
+
docPage: {
|
|
84
|
+
customCode,
|
|
85
|
+
title: 'TimePicker',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|