grommet 2.55.0 → 2.56.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/COPYRIGHT.md +3 -1
- package/components/Button/Button.js +7 -4
- package/components/Button/stories/CustomThemed/ChildrenPlainOption.stories.js +86 -0
- package/components/Calendar/Calendar.js +2 -1
- package/components/Cards/Cards.js +1 -2
- package/components/DateTimeInput/DateTimeInput.js +1093 -0
- package/components/DateTimeInput/README.md +2 -0
- package/components/DateTimeInput/StyledDateTimeInput.js +74 -0
- package/components/DateTimeInput/index.d.ts +47 -0
- package/components/DateTimeInput/index.js +6 -0
- package/components/DateTimeInput/propTypes.js +42 -0
- package/components/DateTimeInput/stories/CustomThemed/Custom.stories.tsx +53 -0
- package/components/DateTimeInput/stories/Form.stories.tsx +44 -0
- package/components/DateTimeInput/stories/Inline.stories.tsx +45 -0
- package/components/DateTimeInput/stories/Locale.stories.tsx +59 -0
- package/components/DateTimeInput/stories/Simple.stories.tsx +23 -0
- package/components/Form/Form.js +7 -4
- package/components/Form/index.d.ts +3 -0
- package/components/Form/stories/AggregateValidation.stories.js +6 -8
- package/components/FormField/FormField.js +164 -91
- package/components/Grommet/index.d.ts +21 -0
- package/components/Grommet/propTypes.js +26 -0
- package/components/Stepper/StepConnector.js +38 -0
- package/components/Stepper/Stepper.js +303 -0
- package/components/Stepper/StepperContext.js +43 -0
- package/components/Stepper/StepperDescription.js +26 -0
- package/components/Stepper/StepperHelperText.js +44 -0
- package/components/Stepper/StepperIndicator.js +74 -0
- package/components/Stepper/StepperLabel.js +41 -0
- package/components/Stepper/StepperStep.js +137 -0
- package/components/Stepper/StyledStepper.js +162 -0
- package/components/Stepper/index.d.ts +80 -0
- package/components/Stepper/index.js +18 -0
- package/components/Stepper/propTypes.js +35 -0
- package/components/Stepper/stories/DisabledSteps.stories.js +45 -0
- package/components/Stepper/stories/ErrorStates.stories.js +45 -0
- package/components/Stepper/stories/HorizontalSteps.stories.js +50 -0
- package/components/Stepper/stories/Interactive.stories.js +60 -0
- package/components/Stepper/stories/KeyboardNavigation.stories.js +64 -0
- package/components/Stepper/stories/NestedSubSteps.stories.js +70 -0
- package/components/Stepper/stories/ReadOnly.stories.js +43 -0
- package/components/Stepper/stories/ThemingLightDark.stories.js +58 -0
- package/components/Stepper/stories/VerticalSteps.stories.js +67 -0
- package/components/Tab/Tab.js +19 -6
- package/components/Tabs/Tabs.js +156 -22
- package/components/TimeInput/README.md +2 -0
- package/components/TimeInput/StyledTimeInput.js +73 -0
- package/components/TimeInput/TimeInput.js +692 -0
- package/components/TimeInput/TimeInputPopup.js +489 -0
- package/components/TimeInput/index.d.ts +44 -0
- package/components/TimeInput/index.js +6 -0
- package/components/TimeInput/propTypes.js +39 -0
- package/components/TimeInput/stories/Controlled.stories.tsx +29 -0
- package/components/TimeInput/stories/Disabled.stories.tsx +13 -0
- package/components/TimeInput/stories/Form.stories.tsx +38 -0
- package/components/TimeInput/stories/ReadOnly.stories.tsx +13 -0
- package/components/TimeInput/stories/Simple.stories.tsx +19 -0
- package/components/TimeInput/stories/Step.stories.tsx +14 -0
- package/components/TimeInput/stories/ThemingLightDark.stories.tsx +22 -0
- package/components/TimeInput/stories/Uncontrolled.stories.tsx +22 -0
- package/components/TimeInput/useSectionedTimeField.js +358 -0
- package/components/TimeInput/utils.js +192 -0
- package/components/Wizard/StyledWizard.js +16 -0
- package/components/Wizard/Wizard.js +770 -0
- package/components/Wizard/WizardContent.js +90 -0
- package/components/Wizard/WizardContext.js +35 -0
- package/components/Wizard/WizardFooter.js +123 -0
- package/components/Wizard/WizardHeader.js +63 -0
- package/components/Wizard/WizardProgress.js +84 -0
- package/components/Wizard/WizardStepHeader.js +55 -0
- package/components/Wizard/index.d.ts +171 -0
- package/components/Wizard/index.js +19 -0
- package/components/Wizard/propTypes.js +56 -0
- package/components/Wizard/stories/BasicLinear.stories.js +71 -0
- package/components/Wizard/stories/Branching.stories.js +96 -0
- package/components/Wizard/stories/Composable.stories.js +75 -0
- package/components/Wizard/stories/Controlled.stories.js +136 -0
- package/components/Wizard/stories/LongContent.stories.js +118 -0
- package/components/Wizard/stories/Modal.stories.js +143 -0
- package/components/Wizard/stories/NestedSubSteps.stories.js +79 -0
- package/components/Wizard/stories/Validation.stories.js +123 -0
- package/components/index.d.ts +6 -0
- package/components/index.js +24 -0
- package/es6/components/Button/Button.js +7 -4
- package/es6/components/Button/stories/CustomThemed/ChildrenPlainOption.stories.js +81 -0
- package/es6/components/Calendar/Calendar.js +2 -0
- package/es6/components/Cards/Cards.js +1 -2
- package/es6/components/DateTimeInput/DateTimeInput.js +1090 -0
- package/es6/components/DateTimeInput/README.md +2 -0
- package/es6/components/DateTimeInput/StyledDateTimeInput.js +68 -0
- package/es6/components/DateTimeInput/index.d.ts +47 -0
- package/es6/components/DateTimeInput/index.js +3 -0
- package/es6/components/DateTimeInput/propTypes.js +36 -0
- package/es6/components/DateTimeInput/stories/CustomThemed/Custom.stories.tsx +53 -0
- package/es6/components/DateTimeInput/stories/Form.stories.tsx +44 -0
- package/es6/components/DateTimeInput/stories/Inline.stories.tsx +45 -0
- package/es6/components/DateTimeInput/stories/Locale.stories.tsx +59 -0
- package/es6/components/DateTimeInput/stories/Simple.stories.tsx +23 -0
- package/es6/components/Form/Form.js +7 -3
- package/es6/components/Form/index.d.ts +3 -0
- package/es6/components/Form/stories/AggregateValidation.stories.js +6 -9
- package/es6/components/FormField/FormField.js +165 -91
- package/es6/components/Grommet/index.d.ts +21 -0
- package/es6/components/Grommet/propTypes.js +26 -0
- package/es6/components/Stepper/StepConnector.js +33 -0
- package/es6/components/Stepper/Stepper.js +301 -0
- package/es6/components/Stepper/StepperContext.js +39 -0
- package/es6/components/Stepper/StepperDescription.js +21 -0
- package/es6/components/Stepper/StepperHelperText.js +39 -0
- package/es6/components/Stepper/StepperIndicator.js +69 -0
- package/es6/components/Stepper/StepperLabel.js +36 -0
- package/es6/components/Stepper/StepperStep.js +133 -0
- package/es6/components/Stepper/StyledStepper.js +156 -0
- package/es6/components/Stepper/index.d.ts +80 -0
- package/es6/components/Stepper/index.js +6 -0
- package/es6/components/Stepper/propTypes.js +30 -0
- package/es6/components/Stepper/stories/DisabledSteps.stories.js +41 -0
- package/es6/components/Stepper/stories/ErrorStates.stories.js +41 -0
- package/es6/components/Stepper/stories/HorizontalSteps.stories.js +46 -0
- package/es6/components/Stepper/stories/Interactive.stories.js +56 -0
- package/es6/components/Stepper/stories/KeyboardNavigation.stories.js +60 -0
- package/es6/components/Stepper/stories/NestedSubSteps.stories.js +66 -0
- package/es6/components/Stepper/stories/ReadOnly.stories.js +39 -0
- package/es6/components/Stepper/stories/ThemingLightDark.stories.js +54 -0
- package/es6/components/Stepper/stories/VerticalSteps.stories.js +63 -0
- package/es6/components/Tab/Tab.js +19 -6
- package/es6/components/Tabs/Tabs.js +157 -23
- package/es6/components/TimeInput/README.md +2 -0
- package/es6/components/TimeInput/StyledTimeInput.js +68 -0
- package/es6/components/TimeInput/TimeInput.js +689 -0
- package/es6/components/TimeInput/TimeInputPopup.js +485 -0
- package/es6/components/TimeInput/index.d.ts +44 -0
- package/es6/components/TimeInput/index.js +1 -0
- package/es6/components/TimeInput/propTypes.js +33 -0
- package/es6/components/TimeInput/stories/Controlled.stories.tsx +29 -0
- package/es6/components/TimeInput/stories/Disabled.stories.tsx +13 -0
- package/es6/components/TimeInput/stories/Form.stories.tsx +38 -0
- package/es6/components/TimeInput/stories/ReadOnly.stories.tsx +13 -0
- package/es6/components/TimeInput/stories/Simple.stories.tsx +19 -0
- package/es6/components/TimeInput/stories/Step.stories.tsx +14 -0
- package/es6/components/TimeInput/stories/ThemingLightDark.stories.tsx +22 -0
- package/es6/components/TimeInput/stories/Uncontrolled.stories.tsx +22 -0
- package/es6/components/TimeInput/useSectionedTimeField.js +355 -0
- package/es6/components/TimeInput/utils.js +187 -0
- package/es6/components/Wizard/StyledWizard.js +11 -0
- package/es6/components/Wizard/Wizard.js +768 -0
- package/es6/components/Wizard/WizardContent.js +87 -0
- package/es6/components/Wizard/WizardContext.js +31 -0
- package/es6/components/Wizard/WizardFooter.js +120 -0
- package/es6/components/Wizard/WizardHeader.js +60 -0
- package/es6/components/Wizard/WizardProgress.js +80 -0
- package/es6/components/Wizard/WizardStepHeader.js +51 -0
- package/es6/components/Wizard/index.d.ts +171 -0
- package/es6/components/Wizard/index.js +7 -0
- package/es6/components/Wizard/propTypes.js +51 -0
- package/es6/components/Wizard/stories/BasicLinear.stories.js +67 -0
- package/es6/components/Wizard/stories/Branching.stories.js +93 -0
- package/es6/components/Wizard/stories/Composable.stories.js +72 -0
- package/es6/components/Wizard/stories/Controlled.stories.js +133 -0
- package/es6/components/Wizard/stories/LongContent.stories.js +115 -0
- package/es6/components/Wizard/stories/Modal.stories.js +141 -0
- package/es6/components/Wizard/stories/NestedSubSteps.stories.js +76 -0
- package/es6/components/Wizard/stories/Validation.stories.js +118 -0
- package/es6/components/index.d.ts +6 -0
- package/es6/components/index.js +6 -0
- package/es6/index.d.ts +6 -0
- package/es6/languages/default.json +48 -0
- package/es6/themes/base.d.ts +223 -0
- package/es6/themes/base.js +366 -0
- package/es6/utils/DOM.js +11 -2
- package/es6/utils/dates.js +10 -0
- package/es6/utils/sectionHelpers.js +57 -0
- package/es6/utils/useSectionedField.js +45 -0
- package/grommet.min.js +2 -1
- package/grommet.min.js.LICENSE.txt +1 -0
- package/grommet.min.js.map +1 -1
- package/index.d.ts +6 -0
- package/languages/default.json +48 -0
- package/package.json +57 -52
- package/themes/base.d.ts +223 -0
- package/themes/base.js +366 -1
- package/tools/license-header.js +2 -0
- package/utils/DOM.js +11 -2
- package/utils/dates.js +11 -1
- package/utils/sectionHelpers.js +61 -0
- package/utils/useSectionedField.js +50 -0
- package/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +0 -180
- package/components/TextInput/stories/CustomThemed/Themed.stories.js +0 -79
- package/es6/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +0 -180
- package/es6/components/TextInput/stories/CustomThemed/Themed.stories.js +0 -74
package/es6/themes/base.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
4
|
import { Actions } from 'grommet-icons/icons/Actions';
|
|
3
5
|
import { AssistListening } from 'grommet-icons/icons/AssistListening';
|
|
4
6
|
import { CircleInformation } from 'grommet-icons/icons/CircleInformation';
|
|
5
7
|
import { ClosedCaption } from 'grommet-icons/icons/ClosedCaption';
|
|
6
8
|
import { Expand } from 'grommet-icons/icons/Expand';
|
|
9
|
+
import { FormCheckmark } from 'grommet-icons/icons/FormCheckmark';
|
|
7
10
|
import { FormClose } from 'grommet-icons/icons/FormClose';
|
|
8
11
|
import { FormDown } from 'grommet-icons/icons/FormDown';
|
|
9
12
|
import { FormNext } from 'grommet-icons/icons/FormNext';
|
|
@@ -1123,6 +1126,41 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
1123
1126
|
size: 'medium'
|
|
1124
1127
|
}
|
|
1125
1128
|
},
|
|
1129
|
+
dateTimeInput: {
|
|
1130
|
+
button: {
|
|
1131
|
+
margin: {
|
|
1132
|
+
right: 'small'
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
container: {
|
|
1136
|
+
round: 'xxsmall'
|
|
1137
|
+
},
|
|
1138
|
+
active: {
|
|
1139
|
+
background: 'active-background',
|
|
1140
|
+
pad: 'xxsmall',
|
|
1141
|
+
indicator: {
|
|
1142
|
+
color: {
|
|
1143
|
+
dark: 'white',
|
|
1144
|
+
light: 'black'
|
|
1145
|
+
},
|
|
1146
|
+
size: 'small'
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
drop: {
|
|
1150
|
+
pad: 'small',
|
|
1151
|
+
gap: 'small',
|
|
1152
|
+
border: {
|
|
1153
|
+
color: 'border',
|
|
1154
|
+
size: 'xsmall'
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
icon: {
|
|
1158
|
+
calendar: undefined
|
|
1159
|
+
},
|
|
1160
|
+
separator: {
|
|
1161
|
+
pad: 'xxsmall'
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1126
1164
|
dataSearch: {
|
|
1127
1165
|
// icons: {
|
|
1128
1166
|
// search: undefined,
|
|
@@ -2480,6 +2518,190 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
2480
2518
|
large: 3
|
|
2481
2519
|
}
|
|
2482
2520
|
},
|
|
2521
|
+
stepper: {
|
|
2522
|
+
indicator: {
|
|
2523
|
+
size: 'medium',
|
|
2524
|
+
// 'small' | 'medium' | 'large'
|
|
2525
|
+
border: {
|
|
2526
|
+
width: '2px'
|
|
2527
|
+
}
|
|
2528
|
+
},
|
|
2529
|
+
label: {
|
|
2530
|
+
size: 'medium',
|
|
2531
|
+
substep: {
|
|
2532
|
+
size: 'small'
|
|
2533
|
+
}
|
|
2534
|
+
},
|
|
2535
|
+
connector: {
|
|
2536
|
+
stroke: {
|
|
2537
|
+
width: '2px'
|
|
2538
|
+
}
|
|
2539
|
+
},
|
|
2540
|
+
description: {
|
|
2541
|
+
size: 'small',
|
|
2542
|
+
color: 'text-weak'
|
|
2543
|
+
},
|
|
2544
|
+
helperText: {
|
|
2545
|
+
size: 'xsmall',
|
|
2546
|
+
color: 'text-weak'
|
|
2547
|
+
},
|
|
2548
|
+
button: {
|
|
2549
|
+
pad: 'xxsmall'
|
|
2550
|
+
},
|
|
2551
|
+
horizontal: {
|
|
2552
|
+
connector: {
|
|
2553
|
+
margin: 'xxsmall'
|
|
2554
|
+
},
|
|
2555
|
+
button: {
|
|
2556
|
+
gap: 'xsmall'
|
|
2557
|
+
}
|
|
2558
|
+
},
|
|
2559
|
+
vertical: {
|
|
2560
|
+
button: {
|
|
2561
|
+
gap: 'small'
|
|
2562
|
+
}
|
|
2563
|
+
},
|
|
2564
|
+
// States: [component].[state].[element].[property]
|
|
2565
|
+
pending: {
|
|
2566
|
+
indicator: {
|
|
2567
|
+
background: 'background-front',
|
|
2568
|
+
color: 'text-strong',
|
|
2569
|
+
border: 'text-xweak',
|
|
2570
|
+
substep: {
|
|
2571
|
+
iconSize: 'small'
|
|
2572
|
+
},
|
|
2573
|
+
hover: {
|
|
2574
|
+
background: 'background-front',
|
|
2575
|
+
border: 'text-strong'
|
|
2576
|
+
}
|
|
2577
|
+
},
|
|
2578
|
+
label: {
|
|
2579
|
+
color: 'text'
|
|
2580
|
+
},
|
|
2581
|
+
connector: {
|
|
2582
|
+
color: 'border'
|
|
2583
|
+
}
|
|
2584
|
+
},
|
|
2585
|
+
current: {
|
|
2586
|
+
indicator: {
|
|
2587
|
+
icon: StatusGoodSmall,
|
|
2588
|
+
iconSize: 'medium',
|
|
2589
|
+
background: 'brand',
|
|
2590
|
+
color: 'white',
|
|
2591
|
+
border: 'brand',
|
|
2592
|
+
substep: {
|
|
2593
|
+
iconSize: 'small'
|
|
2594
|
+
},
|
|
2595
|
+
hover: {
|
|
2596
|
+
color: 'white'
|
|
2597
|
+
}
|
|
2598
|
+
},
|
|
2599
|
+
label: {
|
|
2600
|
+
color: {
|
|
2601
|
+
dark: 'text-strong',
|
|
2602
|
+
light: 'brand'
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
},
|
|
2606
|
+
currentCompleted: {
|
|
2607
|
+
indicator: {
|
|
2608
|
+
icon: FormCheckmark,
|
|
2609
|
+
iconSize: 'medium',
|
|
2610
|
+
background: 'brand',
|
|
2611
|
+
color: 'white',
|
|
2612
|
+
border: 'brand',
|
|
2613
|
+
substep: {
|
|
2614
|
+
iconSize: 'small'
|
|
2615
|
+
},
|
|
2616
|
+
hover: {
|
|
2617
|
+
color: 'white'
|
|
2618
|
+
}
|
|
2619
|
+
},
|
|
2620
|
+
label: {
|
|
2621
|
+
color: {
|
|
2622
|
+
dark: 'text-strong',
|
|
2623
|
+
light: 'brand'
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
},
|
|
2627
|
+
completed: {
|
|
2628
|
+
indicator: {
|
|
2629
|
+
icon: FormCheckmark,
|
|
2630
|
+
iconSize: 'medium',
|
|
2631
|
+
background: 'background-front',
|
|
2632
|
+
color: 'brand',
|
|
2633
|
+
border: 'brand',
|
|
2634
|
+
substep: {
|
|
2635
|
+
iconSize: 'small'
|
|
2636
|
+
},
|
|
2637
|
+
hover: {
|
|
2638
|
+
background: 'background-front'
|
|
2639
|
+
}
|
|
2640
|
+
},
|
|
2641
|
+
label: {
|
|
2642
|
+
color: 'text-weak'
|
|
2643
|
+
},
|
|
2644
|
+
connector: {
|
|
2645
|
+
color: 'brand'
|
|
2646
|
+
}
|
|
2647
|
+
},
|
|
2648
|
+
error: {
|
|
2649
|
+
indicator: {
|
|
2650
|
+
icon: StatusCriticalSmall,
|
|
2651
|
+
background: 'background-front',
|
|
2652
|
+
color: 'status-critical',
|
|
2653
|
+
border: 'status-critical',
|
|
2654
|
+
substep: {
|
|
2655
|
+
iconSize: 'small'
|
|
2656
|
+
},
|
|
2657
|
+
hover: {
|
|
2658
|
+
background: 'background-front'
|
|
2659
|
+
}
|
|
2660
|
+
},
|
|
2661
|
+
label: {
|
|
2662
|
+
color: 'text'
|
|
2663
|
+
},
|
|
2664
|
+
connector: {
|
|
2665
|
+
color: 'status-critical'
|
|
2666
|
+
},
|
|
2667
|
+
helperText: {
|
|
2668
|
+
color: 'status-critical'
|
|
2669
|
+
}
|
|
2670
|
+
},
|
|
2671
|
+
currentError: {
|
|
2672
|
+
indicator: {
|
|
2673
|
+
icon: StatusCriticalSmall,
|
|
2674
|
+
background: 'status-critical',
|
|
2675
|
+
color: 'white',
|
|
2676
|
+
border: 'status-critical',
|
|
2677
|
+
substep: {
|
|
2678
|
+
iconSize: 'small'
|
|
2679
|
+
},
|
|
2680
|
+
hover: {
|
|
2681
|
+
color: 'white'
|
|
2682
|
+
}
|
|
2683
|
+
},
|
|
2684
|
+
label: {
|
|
2685
|
+
color: 'status-critical'
|
|
2686
|
+
}
|
|
2687
|
+
},
|
|
2688
|
+
disabled: {
|
|
2689
|
+
indicator: {
|
|
2690
|
+
background: 'background-contrast',
|
|
2691
|
+
color: 'text-weak',
|
|
2692
|
+
border: 'border',
|
|
2693
|
+
substep: {
|
|
2694
|
+
iconSize: 'small'
|
|
2695
|
+
}
|
|
2696
|
+
},
|
|
2697
|
+
label: {
|
|
2698
|
+
color: 'text-weak'
|
|
2699
|
+
},
|
|
2700
|
+
connector: {
|
|
2701
|
+
color: 'border'
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
},
|
|
2483
2705
|
table: {
|
|
2484
2706
|
caption: {
|
|
2485
2707
|
margin: {
|
|
@@ -2648,6 +2870,48 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
2648
2870
|
// copy: undefined,
|
|
2649
2871
|
// },
|
|
2650
2872
|
},
|
|
2873
|
+
timeInput: {
|
|
2874
|
+
button: {
|
|
2875
|
+
margin: {
|
|
2876
|
+
right: 'small'
|
|
2877
|
+
}
|
|
2878
|
+
},
|
|
2879
|
+
container: {
|
|
2880
|
+
round: 'xxsmall'
|
|
2881
|
+
},
|
|
2882
|
+
active: {
|
|
2883
|
+
background: 'active-background',
|
|
2884
|
+
pad: 'xxsmall',
|
|
2885
|
+
indicator: {
|
|
2886
|
+
color: {
|
|
2887
|
+
dark: 'white',
|
|
2888
|
+
light: 'black'
|
|
2889
|
+
},
|
|
2890
|
+
size: 'small'
|
|
2891
|
+
}
|
|
2892
|
+
},
|
|
2893
|
+
drop: {
|
|
2894
|
+
option: {
|
|
2895
|
+
// background: undefined,
|
|
2896
|
+
hover: {
|
|
2897
|
+
background: 'active-background'
|
|
2898
|
+
},
|
|
2899
|
+
selected: {
|
|
2900
|
+
background: 'selected',
|
|
2901
|
+
color: 'white',
|
|
2902
|
+
text: {
|
|
2903
|
+
weight: 'medium'
|
|
2904
|
+
},
|
|
2905
|
+
hover: {
|
|
2906
|
+
// background: undefined,
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
},
|
|
2911
|
+
icon: {
|
|
2912
|
+
// clock: undefined,
|
|
2913
|
+
}
|
|
2914
|
+
},
|
|
2651
2915
|
tip: {
|
|
2652
2916
|
content: {
|
|
2653
2917
|
// any Box props
|
|
@@ -2730,6 +2994,108 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
2730
2994
|
}
|
|
2731
2995
|
}
|
|
2732
2996
|
},
|
|
2997
|
+
wizard: {
|
|
2998
|
+
container: {
|
|
2999
|
+
gap: 'none',
|
|
3000
|
+
background: 'background-back'
|
|
3001
|
+
},
|
|
3002
|
+
body: {
|
|
3003
|
+
pad: {
|
|
3004
|
+
horizontal: 'large',
|
|
3005
|
+
vertical: 'large'
|
|
3006
|
+
},
|
|
3007
|
+
gap: {
|
|
3008
|
+
row: 'none',
|
|
3009
|
+
column: 'medium'
|
|
3010
|
+
}
|
|
3011
|
+
},
|
|
3012
|
+
header: {
|
|
3013
|
+
pad: {
|
|
3014
|
+
horizontal: 'large',
|
|
3015
|
+
vertical: 'small'
|
|
3016
|
+
},
|
|
3017
|
+
background: 'background-front',
|
|
3018
|
+
title: {
|
|
3019
|
+
size: 'small'
|
|
3020
|
+
},
|
|
3021
|
+
close: {
|
|
3022
|
+
icon: FormClose
|
|
3023
|
+
}
|
|
3024
|
+
},
|
|
3025
|
+
progress: {
|
|
3026
|
+
horizontal: {
|
|
3027
|
+
pad: {
|
|
3028
|
+
horizontal: 'none',
|
|
3029
|
+
vertical: 'none'
|
|
3030
|
+
}
|
|
3031
|
+
},
|
|
3032
|
+
vertical: {
|
|
3033
|
+
// Fixed rail width so the column doesn't collapse to label text.
|
|
3034
|
+
width: 'small'
|
|
3035
|
+
// pad: undefined,
|
|
3036
|
+
}
|
|
3037
|
+
},
|
|
3038
|
+
stepHeader: {
|
|
3039
|
+
pad: {
|
|
3040
|
+
horizontal: 'none',
|
|
3041
|
+
vertical: 'none'
|
|
3042
|
+
},
|
|
3043
|
+
counter: {
|
|
3044
|
+
size: 'small',
|
|
3045
|
+
color: 'text'
|
|
3046
|
+
},
|
|
3047
|
+
title: {
|
|
3048
|
+
size: 'large',
|
|
3049
|
+
margin: 'none'
|
|
3050
|
+
},
|
|
3051
|
+
description: {
|
|
3052
|
+
size: 'medium',
|
|
3053
|
+
color: 'text-weak',
|
|
3054
|
+
margin: {
|
|
3055
|
+
top: 'xsmall',
|
|
3056
|
+
bottom: 'none'
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
},
|
|
3060
|
+
content: {
|
|
3061
|
+
pad: 'medium',
|
|
3062
|
+
gap: 'medium',
|
|
3063
|
+
background: 'background-front',
|
|
3064
|
+
round: 'small',
|
|
3065
|
+
margin: {
|
|
3066
|
+
top: 'medium'
|
|
3067
|
+
}
|
|
3068
|
+
},
|
|
3069
|
+
footer: {
|
|
3070
|
+
pad: {
|
|
3071
|
+
horizontal: 'large',
|
|
3072
|
+
vertical: 'small'
|
|
3073
|
+
},
|
|
3074
|
+
gap: {
|
|
3075
|
+
row: 'xsmall',
|
|
3076
|
+
column: 'small'
|
|
3077
|
+
},
|
|
3078
|
+
background: 'background-front',
|
|
3079
|
+
justify: 'end',
|
|
3080
|
+
button: {
|
|
3081
|
+
next: {
|
|
3082
|
+
icon: FormNext
|
|
3083
|
+
},
|
|
3084
|
+
complete: {
|
|
3085
|
+
icon: undefined
|
|
3086
|
+
},
|
|
3087
|
+
previous: {
|
|
3088
|
+
icon: FormPrevious
|
|
3089
|
+
},
|
|
3090
|
+
cancel: {
|
|
3091
|
+
icon: undefined
|
|
3092
|
+
},
|
|
3093
|
+
skip: {
|
|
3094
|
+
icon: FormNext
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
},
|
|
2733
3099
|
worldMap: {
|
|
2734
3100
|
color: 'light-3',
|
|
2735
3101
|
continent: {
|
package/es6/utils/DOM.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1
3
|
export var findScrollParent = function findScrollParent(element, horizontal) {
|
|
2
4
|
var result;
|
|
3
5
|
if (element) {
|
|
@@ -76,10 +78,17 @@ export var withinDropPortal = function withinDropPortal(node, portalContext) {
|
|
|
76
78
|
return true;
|
|
77
79
|
};
|
|
78
80
|
|
|
79
|
-
// Check if
|
|
81
|
+
// Check if an element can receive focus: native form inputs, or non-native
|
|
82
|
+
// interactive elements with an explicit tabIndex attribute
|
|
83
|
+
// (e.g. span[role="spinbutton"]). Excludes native interactive elements
|
|
84
|
+
// (button, a) so they don't trigger FormField focus state.
|
|
80
85
|
export var isFocusable = function isFocusable(element) {
|
|
86
|
+
if (!element || element.disabled) return false;
|
|
81
87
|
var tagName = element.tagName.toLowerCase();
|
|
82
|
-
|
|
88
|
+
if (tagName === 'input' || tagName === 'select' || tagName === 'textarea') return true;
|
|
89
|
+
// Only non-native-interactive elements with an explicit tabindex attribute
|
|
90
|
+
var isNativeInteractive = tagName === 'button' || tagName === 'a';
|
|
91
|
+
return !isNativeInteractive && element.tabIndex >= 0 && element.hasAttribute('tabindex');
|
|
83
92
|
};
|
|
84
93
|
|
|
85
94
|
// Get the first element that can receive focus
|
package/es6/utils/dates.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1
3
|
export var setHoursWithOffset = function setHoursWithOffset(date) {
|
|
2
4
|
var newDate = new Date(date);
|
|
3
5
|
if ((date == null ? void 0 : date.indexOf('T')) === -1) {
|
|
@@ -6,4 +8,12 @@ export var setHoursWithOffset = function setHoursWithOffset(date) {
|
|
|
6
8
|
newDate.setHours(hour, offset < 0 ? -offset : offset);
|
|
7
9
|
}
|
|
8
10
|
return newDate;
|
|
11
|
+
};
|
|
12
|
+
export var pad = function pad(value) {
|
|
13
|
+
return String(value).padStart(2, '0');
|
|
14
|
+
};
|
|
15
|
+
export var normalizeStep = function normalizeStep(step) {
|
|
16
|
+
var parsed = Number(step);
|
|
17
|
+
if (!Number.isFinite(parsed) || parsed <= 0) return 1;
|
|
18
|
+
return Math.max(1, Math.floor(parsed));
|
|
9
19
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var sectionKeyByType = {
|
|
4
|
+
day: 'day',
|
|
5
|
+
month: 'month',
|
|
6
|
+
year: 'year',
|
|
7
|
+
hours: 'hour',
|
|
8
|
+
minutes: 'minute',
|
|
9
|
+
seconds: 'second',
|
|
10
|
+
meridiem: 'period'
|
|
11
|
+
};
|
|
12
|
+
var sectionTokenByType = {
|
|
13
|
+
day: 'dd',
|
|
14
|
+
month: 'mm',
|
|
15
|
+
year: 'yyyy',
|
|
16
|
+
hours: 'hh',
|
|
17
|
+
minutes: 'mm',
|
|
18
|
+
seconds: 'ss',
|
|
19
|
+
meridiem: 'aa'
|
|
20
|
+
};
|
|
21
|
+
var sectionMessageSuffixByType = {
|
|
22
|
+
day: 'sectionDay',
|
|
23
|
+
month: 'sectionMonth',
|
|
24
|
+
year: 'sectionYear',
|
|
25
|
+
hours: 'sectionHours',
|
|
26
|
+
minutes: 'sectionMinutes',
|
|
27
|
+
seconds: 'sectionSeconds',
|
|
28
|
+
meridiem: 'sectionMeridiem'
|
|
29
|
+
};
|
|
30
|
+
var defaultSectionNameByType = {
|
|
31
|
+
day: 'day',
|
|
32
|
+
month: 'month',
|
|
33
|
+
year: 'year',
|
|
34
|
+
hours: 'hours',
|
|
35
|
+
minutes: 'minutes',
|
|
36
|
+
seconds: 'seconds',
|
|
37
|
+
meridiem: 'meridiem'
|
|
38
|
+
};
|
|
39
|
+
export var getSectionKeyFromType = function getSectionKeyFromType(sectionType) {
|
|
40
|
+
return sectionKeyByType[sectionType];
|
|
41
|
+
};
|
|
42
|
+
export var getSectionTokenFromType = function getSectionTokenFromType(sectionType) {
|
|
43
|
+
return sectionTokenByType[sectionType];
|
|
44
|
+
};
|
|
45
|
+
export var getSectionNameFromType = function getSectionNameFromType(_ref) {
|
|
46
|
+
var sectionType = _ref.sectionType,
|
|
47
|
+
messagePrefix = _ref.messagePrefix,
|
|
48
|
+
formatMessage = _ref.formatMessage,
|
|
49
|
+
messages = _ref.messages;
|
|
50
|
+
if (formatMessage) {
|
|
51
|
+
return formatMessage({
|
|
52
|
+
id: messagePrefix + "." + sectionMessageSuffixByType[sectionType],
|
|
53
|
+
messages: messages
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return defaultSectionNameByType[sectionType];
|
|
57
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
export var useSectionedField = function useSectionedField(_ref) {
|
|
5
|
+
var value = _ref.value,
|
|
6
|
+
parseValue = _ref.parseValue,
|
|
7
|
+
defaultValue = _ref.defaultValue,
|
|
8
|
+
sectionOrder = _ref.sectionOrder;
|
|
9
|
+
var parsedValue = useMemo(function () {
|
|
10
|
+
return parseValue(value);
|
|
11
|
+
}, [parseValue, value]);
|
|
12
|
+
var _useState = useState(function () {
|
|
13
|
+
return parsedValue || defaultValue();
|
|
14
|
+
}),
|
|
15
|
+
sections = _useState[0],
|
|
16
|
+
setSections = _useState[1];
|
|
17
|
+
var _useState2 = useState({}),
|
|
18
|
+
pendingDigits = _useState2[0],
|
|
19
|
+
setPendingDigits = _useState2[1];
|
|
20
|
+
var _useState3 = useState(sectionOrder[0]),
|
|
21
|
+
activeSection = _useState3[0],
|
|
22
|
+
setActiveSection = _useState3[1];
|
|
23
|
+
var preserveIncompleteSectionsRef = useRef(false);
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
if (!sectionOrder.includes(activeSection)) {
|
|
26
|
+
setActiveSection(sectionOrder[0]);
|
|
27
|
+
}
|
|
28
|
+
}, [activeSection, sectionOrder]);
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
if (!parsedValue && preserveIncompleteSectionsRef.current) {
|
|
31
|
+
preserveIncompleteSectionsRef.current = false;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
setSections(parsedValue || defaultValue());
|
|
35
|
+
}, [defaultValue, parsedValue]);
|
|
36
|
+
return {
|
|
37
|
+
activeSection: activeSection,
|
|
38
|
+
pendingDigits: pendingDigits,
|
|
39
|
+
preserveIncompleteSectionsRef: preserveIncompleteSectionsRef,
|
|
40
|
+
sections: sections,
|
|
41
|
+
setActiveSection: setActiveSection,
|
|
42
|
+
setPendingDigits: setPendingDigits,
|
|
43
|
+
setSections: setSections
|
|
44
|
+
};
|
|
45
|
+
};
|