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/themes/base.js
CHANGED
|
@@ -7,6 +7,7 @@ var _AssistListening = require("grommet-icons/icons/AssistListening");
|
|
|
7
7
|
var _CircleInformation = require("grommet-icons/icons/CircleInformation");
|
|
8
8
|
var _ClosedCaption = require("grommet-icons/icons/ClosedCaption");
|
|
9
9
|
var _Expand = require("grommet-icons/icons/Expand");
|
|
10
|
+
var _FormCheckmark = require("grommet-icons/icons/FormCheckmark");
|
|
10
11
|
var _FormClose = require("grommet-icons/icons/FormClose");
|
|
11
12
|
var _FormDown = require("grommet-icons/icons/FormDown");
|
|
12
13
|
var _FormNext = require("grommet-icons/icons/FormNext");
|
|
@@ -27,7 +28,8 @@ var _VolumeLow = require("grommet-icons/icons/VolumeLow");
|
|
|
27
28
|
var _base = require("grommet-icons/themes/base");
|
|
28
29
|
var _object = require("../utils/object");
|
|
29
30
|
var _mixins = require("../utils/mixins");
|
|
30
|
-
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); }
|
|
31
|
+
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); } // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
32
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
31
33
|
var brandColor = '#7D4CDB';
|
|
32
34
|
var accentColors = ['#6FFFB0', '#FD6FFF', '#81FCED', '#FFCA58'];
|
|
33
35
|
var neutralColors = ['#00873D', '#3D138D', '#00739D', '#A2423D'];
|
|
@@ -1127,6 +1129,41 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
1127
1129
|
size: 'medium'
|
|
1128
1130
|
}
|
|
1129
1131
|
},
|
|
1132
|
+
dateTimeInput: {
|
|
1133
|
+
button: {
|
|
1134
|
+
margin: {
|
|
1135
|
+
right: 'small'
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
container: {
|
|
1139
|
+
round: 'xxsmall'
|
|
1140
|
+
},
|
|
1141
|
+
active: {
|
|
1142
|
+
background: 'active-background',
|
|
1143
|
+
pad: 'xxsmall',
|
|
1144
|
+
indicator: {
|
|
1145
|
+
color: {
|
|
1146
|
+
dark: 'white',
|
|
1147
|
+
light: 'black'
|
|
1148
|
+
},
|
|
1149
|
+
size: 'small'
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
drop: {
|
|
1153
|
+
pad: 'small',
|
|
1154
|
+
gap: 'small',
|
|
1155
|
+
border: {
|
|
1156
|
+
color: 'border',
|
|
1157
|
+
size: 'xsmall'
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
icon: {
|
|
1161
|
+
calendar: undefined
|
|
1162
|
+
},
|
|
1163
|
+
separator: {
|
|
1164
|
+
pad: 'xxsmall'
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1130
1167
|
dataSearch: {
|
|
1131
1168
|
// icons: {
|
|
1132
1169
|
// search: undefined,
|
|
@@ -2484,6 +2521,190 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2484
2521
|
large: 3
|
|
2485
2522
|
}
|
|
2486
2523
|
},
|
|
2524
|
+
stepper: {
|
|
2525
|
+
indicator: {
|
|
2526
|
+
size: 'medium',
|
|
2527
|
+
// 'small' | 'medium' | 'large'
|
|
2528
|
+
border: {
|
|
2529
|
+
width: '2px'
|
|
2530
|
+
}
|
|
2531
|
+
},
|
|
2532
|
+
label: {
|
|
2533
|
+
size: 'medium',
|
|
2534
|
+
substep: {
|
|
2535
|
+
size: 'small'
|
|
2536
|
+
}
|
|
2537
|
+
},
|
|
2538
|
+
connector: {
|
|
2539
|
+
stroke: {
|
|
2540
|
+
width: '2px'
|
|
2541
|
+
}
|
|
2542
|
+
},
|
|
2543
|
+
description: {
|
|
2544
|
+
size: 'small',
|
|
2545
|
+
color: 'text-weak'
|
|
2546
|
+
},
|
|
2547
|
+
helperText: {
|
|
2548
|
+
size: 'xsmall',
|
|
2549
|
+
color: 'text-weak'
|
|
2550
|
+
},
|
|
2551
|
+
button: {
|
|
2552
|
+
pad: 'xxsmall'
|
|
2553
|
+
},
|
|
2554
|
+
horizontal: {
|
|
2555
|
+
connector: {
|
|
2556
|
+
margin: 'xxsmall'
|
|
2557
|
+
},
|
|
2558
|
+
button: {
|
|
2559
|
+
gap: 'xsmall'
|
|
2560
|
+
}
|
|
2561
|
+
},
|
|
2562
|
+
vertical: {
|
|
2563
|
+
button: {
|
|
2564
|
+
gap: 'small'
|
|
2565
|
+
}
|
|
2566
|
+
},
|
|
2567
|
+
// States: [component].[state].[element].[property]
|
|
2568
|
+
pending: {
|
|
2569
|
+
indicator: {
|
|
2570
|
+
background: 'background-front',
|
|
2571
|
+
color: 'text-strong',
|
|
2572
|
+
border: 'text-xweak',
|
|
2573
|
+
substep: {
|
|
2574
|
+
iconSize: 'small'
|
|
2575
|
+
},
|
|
2576
|
+
hover: {
|
|
2577
|
+
background: 'background-front',
|
|
2578
|
+
border: 'text-strong'
|
|
2579
|
+
}
|
|
2580
|
+
},
|
|
2581
|
+
label: {
|
|
2582
|
+
color: 'text'
|
|
2583
|
+
},
|
|
2584
|
+
connector: {
|
|
2585
|
+
color: 'border'
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
current: {
|
|
2589
|
+
indicator: {
|
|
2590
|
+
icon: _StatusGoodSmall.StatusGoodSmall,
|
|
2591
|
+
iconSize: 'medium',
|
|
2592
|
+
background: 'brand',
|
|
2593
|
+
color: 'white',
|
|
2594
|
+
border: 'brand',
|
|
2595
|
+
substep: {
|
|
2596
|
+
iconSize: 'small'
|
|
2597
|
+
},
|
|
2598
|
+
hover: {
|
|
2599
|
+
color: 'white'
|
|
2600
|
+
}
|
|
2601
|
+
},
|
|
2602
|
+
label: {
|
|
2603
|
+
color: {
|
|
2604
|
+
dark: 'text-strong',
|
|
2605
|
+
light: 'brand'
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
},
|
|
2609
|
+
currentCompleted: {
|
|
2610
|
+
indicator: {
|
|
2611
|
+
icon: _FormCheckmark.FormCheckmark,
|
|
2612
|
+
iconSize: 'medium',
|
|
2613
|
+
background: 'brand',
|
|
2614
|
+
color: 'white',
|
|
2615
|
+
border: 'brand',
|
|
2616
|
+
substep: {
|
|
2617
|
+
iconSize: 'small'
|
|
2618
|
+
},
|
|
2619
|
+
hover: {
|
|
2620
|
+
color: 'white'
|
|
2621
|
+
}
|
|
2622
|
+
},
|
|
2623
|
+
label: {
|
|
2624
|
+
color: {
|
|
2625
|
+
dark: 'text-strong',
|
|
2626
|
+
light: 'brand'
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
},
|
|
2630
|
+
completed: {
|
|
2631
|
+
indicator: {
|
|
2632
|
+
icon: _FormCheckmark.FormCheckmark,
|
|
2633
|
+
iconSize: 'medium',
|
|
2634
|
+
background: 'background-front',
|
|
2635
|
+
color: 'brand',
|
|
2636
|
+
border: 'brand',
|
|
2637
|
+
substep: {
|
|
2638
|
+
iconSize: 'small'
|
|
2639
|
+
},
|
|
2640
|
+
hover: {
|
|
2641
|
+
background: 'background-front'
|
|
2642
|
+
}
|
|
2643
|
+
},
|
|
2644
|
+
label: {
|
|
2645
|
+
color: 'text-weak'
|
|
2646
|
+
},
|
|
2647
|
+
connector: {
|
|
2648
|
+
color: 'brand'
|
|
2649
|
+
}
|
|
2650
|
+
},
|
|
2651
|
+
error: {
|
|
2652
|
+
indicator: {
|
|
2653
|
+
icon: _StatusCriticalSmall.StatusCriticalSmall,
|
|
2654
|
+
background: 'background-front',
|
|
2655
|
+
color: 'status-critical',
|
|
2656
|
+
border: 'status-critical',
|
|
2657
|
+
substep: {
|
|
2658
|
+
iconSize: 'small'
|
|
2659
|
+
},
|
|
2660
|
+
hover: {
|
|
2661
|
+
background: 'background-front'
|
|
2662
|
+
}
|
|
2663
|
+
},
|
|
2664
|
+
label: {
|
|
2665
|
+
color: 'text'
|
|
2666
|
+
},
|
|
2667
|
+
connector: {
|
|
2668
|
+
color: 'status-critical'
|
|
2669
|
+
},
|
|
2670
|
+
helperText: {
|
|
2671
|
+
color: 'status-critical'
|
|
2672
|
+
}
|
|
2673
|
+
},
|
|
2674
|
+
currentError: {
|
|
2675
|
+
indicator: {
|
|
2676
|
+
icon: _StatusCriticalSmall.StatusCriticalSmall,
|
|
2677
|
+
background: 'status-critical',
|
|
2678
|
+
color: 'white',
|
|
2679
|
+
border: 'status-critical',
|
|
2680
|
+
substep: {
|
|
2681
|
+
iconSize: 'small'
|
|
2682
|
+
},
|
|
2683
|
+
hover: {
|
|
2684
|
+
color: 'white'
|
|
2685
|
+
}
|
|
2686
|
+
},
|
|
2687
|
+
label: {
|
|
2688
|
+
color: 'status-critical'
|
|
2689
|
+
}
|
|
2690
|
+
},
|
|
2691
|
+
disabled: {
|
|
2692
|
+
indicator: {
|
|
2693
|
+
background: 'background-contrast',
|
|
2694
|
+
color: 'text-weak',
|
|
2695
|
+
border: 'border',
|
|
2696
|
+
substep: {
|
|
2697
|
+
iconSize: 'small'
|
|
2698
|
+
}
|
|
2699
|
+
},
|
|
2700
|
+
label: {
|
|
2701
|
+
color: 'text-weak'
|
|
2702
|
+
},
|
|
2703
|
+
connector: {
|
|
2704
|
+
color: 'border'
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
},
|
|
2487
2708
|
table: {
|
|
2488
2709
|
caption: {
|
|
2489
2710
|
margin: {
|
|
@@ -2652,6 +2873,48 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2652
2873
|
// copy: undefined,
|
|
2653
2874
|
// },
|
|
2654
2875
|
},
|
|
2876
|
+
timeInput: {
|
|
2877
|
+
button: {
|
|
2878
|
+
margin: {
|
|
2879
|
+
right: 'small'
|
|
2880
|
+
}
|
|
2881
|
+
},
|
|
2882
|
+
container: {
|
|
2883
|
+
round: 'xxsmall'
|
|
2884
|
+
},
|
|
2885
|
+
active: {
|
|
2886
|
+
background: 'active-background',
|
|
2887
|
+
pad: 'xxsmall',
|
|
2888
|
+
indicator: {
|
|
2889
|
+
color: {
|
|
2890
|
+
dark: 'white',
|
|
2891
|
+
light: 'black'
|
|
2892
|
+
},
|
|
2893
|
+
size: 'small'
|
|
2894
|
+
}
|
|
2895
|
+
},
|
|
2896
|
+
drop: {
|
|
2897
|
+
option: {
|
|
2898
|
+
// background: undefined,
|
|
2899
|
+
hover: {
|
|
2900
|
+
background: 'active-background'
|
|
2901
|
+
},
|
|
2902
|
+
selected: {
|
|
2903
|
+
background: 'selected',
|
|
2904
|
+
color: 'white',
|
|
2905
|
+
text: {
|
|
2906
|
+
weight: 'medium'
|
|
2907
|
+
},
|
|
2908
|
+
hover: {
|
|
2909
|
+
// background: undefined,
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
},
|
|
2914
|
+
icon: {
|
|
2915
|
+
// clock: undefined,
|
|
2916
|
+
}
|
|
2917
|
+
},
|
|
2655
2918
|
tip: {
|
|
2656
2919
|
content: {
|
|
2657
2920
|
// any Box props
|
|
@@ -2734,6 +2997,108 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2734
2997
|
}
|
|
2735
2998
|
}
|
|
2736
2999
|
},
|
|
3000
|
+
wizard: {
|
|
3001
|
+
container: {
|
|
3002
|
+
gap: 'none',
|
|
3003
|
+
background: 'background-back'
|
|
3004
|
+
},
|
|
3005
|
+
body: {
|
|
3006
|
+
pad: {
|
|
3007
|
+
horizontal: 'large',
|
|
3008
|
+
vertical: 'large'
|
|
3009
|
+
},
|
|
3010
|
+
gap: {
|
|
3011
|
+
row: 'none',
|
|
3012
|
+
column: 'medium'
|
|
3013
|
+
}
|
|
3014
|
+
},
|
|
3015
|
+
header: {
|
|
3016
|
+
pad: {
|
|
3017
|
+
horizontal: 'large',
|
|
3018
|
+
vertical: 'small'
|
|
3019
|
+
},
|
|
3020
|
+
background: 'background-front',
|
|
3021
|
+
title: {
|
|
3022
|
+
size: 'small'
|
|
3023
|
+
},
|
|
3024
|
+
close: {
|
|
3025
|
+
icon: _FormClose.FormClose
|
|
3026
|
+
}
|
|
3027
|
+
},
|
|
3028
|
+
progress: {
|
|
3029
|
+
horizontal: {
|
|
3030
|
+
pad: {
|
|
3031
|
+
horizontal: 'none',
|
|
3032
|
+
vertical: 'none'
|
|
3033
|
+
}
|
|
3034
|
+
},
|
|
3035
|
+
vertical: {
|
|
3036
|
+
// Fixed rail width so the column doesn't collapse to label text.
|
|
3037
|
+
width: 'small'
|
|
3038
|
+
// pad: undefined,
|
|
3039
|
+
}
|
|
3040
|
+
},
|
|
3041
|
+
stepHeader: {
|
|
3042
|
+
pad: {
|
|
3043
|
+
horizontal: 'none',
|
|
3044
|
+
vertical: 'none'
|
|
3045
|
+
},
|
|
3046
|
+
counter: {
|
|
3047
|
+
size: 'small',
|
|
3048
|
+
color: 'text'
|
|
3049
|
+
},
|
|
3050
|
+
title: {
|
|
3051
|
+
size: 'large',
|
|
3052
|
+
margin: 'none'
|
|
3053
|
+
},
|
|
3054
|
+
description: {
|
|
3055
|
+
size: 'medium',
|
|
3056
|
+
color: 'text-weak',
|
|
3057
|
+
margin: {
|
|
3058
|
+
top: 'xsmall',
|
|
3059
|
+
bottom: 'none'
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
},
|
|
3063
|
+
content: {
|
|
3064
|
+
pad: 'medium',
|
|
3065
|
+
gap: 'medium',
|
|
3066
|
+
background: 'background-front',
|
|
3067
|
+
round: 'small',
|
|
3068
|
+
margin: {
|
|
3069
|
+
top: 'medium'
|
|
3070
|
+
}
|
|
3071
|
+
},
|
|
3072
|
+
footer: {
|
|
3073
|
+
pad: {
|
|
3074
|
+
horizontal: 'large',
|
|
3075
|
+
vertical: 'small'
|
|
3076
|
+
},
|
|
3077
|
+
gap: {
|
|
3078
|
+
row: 'xsmall',
|
|
3079
|
+
column: 'small'
|
|
3080
|
+
},
|
|
3081
|
+
background: 'background-front',
|
|
3082
|
+
justify: 'end',
|
|
3083
|
+
button: {
|
|
3084
|
+
next: {
|
|
3085
|
+
icon: _FormNext.FormNext
|
|
3086
|
+
},
|
|
3087
|
+
complete: {
|
|
3088
|
+
icon: undefined
|
|
3089
|
+
},
|
|
3090
|
+
previous: {
|
|
3091
|
+
icon: _FormPrevious.FormPrevious
|
|
3092
|
+
},
|
|
3093
|
+
cancel: {
|
|
3094
|
+
icon: undefined
|
|
3095
|
+
},
|
|
3096
|
+
skip: {
|
|
3097
|
+
icon: _FormNext.FormNext
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
},
|
|
2737
3102
|
worldMap: {
|
|
2738
3103
|
color: 'light-3',
|
|
2739
3104
|
continent: {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs=require("fs"),path=require("path"),{execFileSync}=require("child_process"),HEADER="// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP\n// SPDX-License-Identifier: Apache-2.0\n",ROOTS=["src","e2e","storybook","tools"],EXTENSIONS=new Set([".js",".jsx",".ts",".tsx",".mjs",".cjs"]),EXCLUDED_DIRS=new Set(["node_modules","dist","coverage",".git",".yarn","storybook-static","__snapshots__"]);function isIncluded(e){return!e.endsWith(".snap")&&EXTENSIONS.has(path.extname(e))}function collectStagedFiles(){return execFileSync("git",["diff","--cached","--name-only","--diff-filter=ACMR"],{encoding:"utf8"}).split("\n").map((e=>e.trim())).filter(Boolean).filter((e=>ROOTS.some((t=>e===t||e.startsWith(`${t}/`))))).filter((e=>isIncluded(e))).filter((e=>fs.existsSync(e)))}function collectFiles(e,t){if(!fs.existsSync(e))return;const s=fs.statSync(e);s.isDirectory()?fs.readdirSync(e,{withFileTypes:!0}).forEach((s=>{s.isDirectory()&&EXCLUDED_DIRS.has(s.name)||collectFiles(path.join(e,s.name),t)})):s.isFile()&&isIncluded(e)&&t.push(e)}function buildExpected(e){let t="",s=e;if(e.startsWith("#!")){const i=e.indexOf("\n");t=-1===i?`${e}\n`:e.slice(0,i+1),s=-1===i?"":e.slice(i+1)}const i=s.split("\n");let n=0;for(;n<i.length&&/^\/\/\s*SPDX-/i.test(i[n]);)n+=1;n>0&&""===i[n]?.trim()&&(n+=1);const c=i.slice(n),l=/^\s*(['"])use [\w-]+\1;?\s*$/.test(c[0]??"");return`${t}${HEADER}${l?"\n":""}${c.join("\n")}`}function main(){const e=process.argv.slice(2),t=e.includes("--check"),s=e.includes("--staged"),i=e.filter((e=>!e.startsWith("--")));let n;if(s)n=collectStagedFiles();else{const e=i.length>0?i:ROOTS;n=[],e.forEach((e=>collectFiles(e,n)))}const c=[];if(n.forEach((e=>{const s=fs.readFileSync(e,"utf8"),i=buildExpected(s);i!==s&&(c.push(e),t||fs.writeFileSync(e,i))})),s&&!t&&c.length>0&&execFileSync("git",["add","--",...c]),t)return c.length>0&&(console.error(`License header check failed: ${c.length} file(s) missing or with an incorrect SPDX header.`),c.forEach((e=>console.error(` ${e}`))),console.error('\nRun "yarn license" to fix the headers.'),process.exit(1)),void console.log(`License header check passed (${n.length} file(s)).`);c.length>0?console.log(`Updated SPDX header in ${c.length} file(s).`):console.log(`All ${n.length} file(s) already compliant.`)}main();
|
package/utils/DOM.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.withinDropPortal = exports.shouldKeepFocus = exports.setFocusWithoutScroll = exports.makeNodeUnfocusable = exports.makeNodeFocusable = exports.isNodeBeforeScroll = exports.isNodeAfterScroll = exports.isFocusable = exports.getNewContainer = exports.getFirstFocusableDescendant = exports.findVisibleParent = exports.findScrollParents = exports.findScrollParent = exports.findButtonParent = exports.containsFocus = void 0;
|
|
5
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
7
|
var findScrollParent = exports.findScrollParent = function findScrollParent(element, horizontal) {
|
|
6
8
|
var result;
|
|
7
9
|
if (element) {
|
|
@@ -80,10 +82,17 @@ var withinDropPortal = exports.withinDropPortal = function withinDropPortal(node
|
|
|
80
82
|
return true;
|
|
81
83
|
};
|
|
82
84
|
|
|
83
|
-
// Check if
|
|
85
|
+
// Check if an element can receive focus: native form inputs, or non-native
|
|
86
|
+
// interactive elements with an explicit tabIndex attribute
|
|
87
|
+
// (e.g. span[role="spinbutton"]). Excludes native interactive elements
|
|
88
|
+
// (button, a) so they don't trigger FormField focus state.
|
|
84
89
|
var isFocusable = exports.isFocusable = function isFocusable(element) {
|
|
90
|
+
if (!element || element.disabled) return false;
|
|
85
91
|
var tagName = element.tagName.toLowerCase();
|
|
86
|
-
|
|
92
|
+
if (tagName === 'input' || tagName === 'select' || tagName === 'textarea') return true;
|
|
93
|
+
// Only non-native-interactive elements with an explicit tabindex attribute
|
|
94
|
+
var isNativeInteractive = tagName === 'button' || tagName === 'a';
|
|
95
|
+
return !isNativeInteractive && element.tabIndex >= 0 && element.hasAttribute('tabindex');
|
|
87
96
|
};
|
|
88
97
|
|
|
89
98
|
// Get the first element that can receive focus
|
package/utils/dates.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.setHoursWithOffset = void 0;
|
|
4
|
+
exports.setHoursWithOffset = exports.pad = exports.normalizeStep = void 0;
|
|
5
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
7
|
var setHoursWithOffset = exports.setHoursWithOffset = function setHoursWithOffset(date) {
|
|
6
8
|
var newDate = new Date(date);
|
|
7
9
|
if ((date == null ? void 0 : date.indexOf('T')) === -1) {
|
|
@@ -10,4 +12,12 @@ var setHoursWithOffset = exports.setHoursWithOffset = function setHoursWithOffse
|
|
|
10
12
|
newDate.setHours(hour, offset < 0 ? -offset : offset);
|
|
11
13
|
}
|
|
12
14
|
return newDate;
|
|
15
|
+
};
|
|
16
|
+
var pad = exports.pad = function pad(value) {
|
|
17
|
+
return String(value).padStart(2, '0');
|
|
18
|
+
};
|
|
19
|
+
var normalizeStep = exports.normalizeStep = function normalizeStep(step) {
|
|
20
|
+
var parsed = Number(step);
|
|
21
|
+
if (!Number.isFinite(parsed) || parsed <= 0) return 1;
|
|
22
|
+
return Math.max(1, Math.floor(parsed));
|
|
13
23
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getSectionTokenFromType = exports.getSectionNameFromType = exports.getSectionKeyFromType = void 0;
|
|
5
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
var sectionKeyByType = {
|
|
8
|
+
day: 'day',
|
|
9
|
+
month: 'month',
|
|
10
|
+
year: 'year',
|
|
11
|
+
hours: 'hour',
|
|
12
|
+
minutes: 'minute',
|
|
13
|
+
seconds: 'second',
|
|
14
|
+
meridiem: 'period'
|
|
15
|
+
};
|
|
16
|
+
var sectionTokenByType = {
|
|
17
|
+
day: 'dd',
|
|
18
|
+
month: 'mm',
|
|
19
|
+
year: 'yyyy',
|
|
20
|
+
hours: 'hh',
|
|
21
|
+
minutes: 'mm',
|
|
22
|
+
seconds: 'ss',
|
|
23
|
+
meridiem: 'aa'
|
|
24
|
+
};
|
|
25
|
+
var sectionMessageSuffixByType = {
|
|
26
|
+
day: 'sectionDay',
|
|
27
|
+
month: 'sectionMonth',
|
|
28
|
+
year: 'sectionYear',
|
|
29
|
+
hours: 'sectionHours',
|
|
30
|
+
minutes: 'sectionMinutes',
|
|
31
|
+
seconds: 'sectionSeconds',
|
|
32
|
+
meridiem: 'sectionMeridiem'
|
|
33
|
+
};
|
|
34
|
+
var defaultSectionNameByType = {
|
|
35
|
+
day: 'day',
|
|
36
|
+
month: 'month',
|
|
37
|
+
year: 'year',
|
|
38
|
+
hours: 'hours',
|
|
39
|
+
minutes: 'minutes',
|
|
40
|
+
seconds: 'seconds',
|
|
41
|
+
meridiem: 'meridiem'
|
|
42
|
+
};
|
|
43
|
+
var getSectionKeyFromType = exports.getSectionKeyFromType = function getSectionKeyFromType(sectionType) {
|
|
44
|
+
return sectionKeyByType[sectionType];
|
|
45
|
+
};
|
|
46
|
+
var getSectionTokenFromType = exports.getSectionTokenFromType = function getSectionTokenFromType(sectionType) {
|
|
47
|
+
return sectionTokenByType[sectionType];
|
|
48
|
+
};
|
|
49
|
+
var getSectionNameFromType = exports.getSectionNameFromType = function getSectionNameFromType(_ref) {
|
|
50
|
+
var sectionType = _ref.sectionType,
|
|
51
|
+
messagePrefix = _ref.messagePrefix,
|
|
52
|
+
formatMessage = _ref.formatMessage,
|
|
53
|
+
messages = _ref.messages;
|
|
54
|
+
if (formatMessage) {
|
|
55
|
+
return formatMessage({
|
|
56
|
+
id: messagePrefix + "." + sectionMessageSuffixByType[sectionType],
|
|
57
|
+
messages: messages
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return defaultSectionNameByType[sectionType];
|
|
61
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useSectionedField = void 0;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
7
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
|
|
9
|
+
var useSectionedField = exports.useSectionedField = function useSectionedField(_ref) {
|
|
10
|
+
var value = _ref.value,
|
|
11
|
+
parseValue = _ref.parseValue,
|
|
12
|
+
defaultValue = _ref.defaultValue,
|
|
13
|
+
sectionOrder = _ref.sectionOrder;
|
|
14
|
+
var parsedValue = (0, _react.useMemo)(function () {
|
|
15
|
+
return parseValue(value);
|
|
16
|
+
}, [parseValue, value]);
|
|
17
|
+
var _useState = (0, _react.useState)(function () {
|
|
18
|
+
return parsedValue || defaultValue();
|
|
19
|
+
}),
|
|
20
|
+
sections = _useState[0],
|
|
21
|
+
setSections = _useState[1];
|
|
22
|
+
var _useState2 = (0, _react.useState)({}),
|
|
23
|
+
pendingDigits = _useState2[0],
|
|
24
|
+
setPendingDigits = _useState2[1];
|
|
25
|
+
var _useState3 = (0, _react.useState)(sectionOrder[0]),
|
|
26
|
+
activeSection = _useState3[0],
|
|
27
|
+
setActiveSection = _useState3[1];
|
|
28
|
+
var preserveIncompleteSectionsRef = (0, _react.useRef)(false);
|
|
29
|
+
(0, _react.useEffect)(function () {
|
|
30
|
+
if (!sectionOrder.includes(activeSection)) {
|
|
31
|
+
setActiveSection(sectionOrder[0]);
|
|
32
|
+
}
|
|
33
|
+
}, [activeSection, sectionOrder]);
|
|
34
|
+
(0, _react.useEffect)(function () {
|
|
35
|
+
if (!parsedValue && preserveIncompleteSectionsRef.current) {
|
|
36
|
+
preserveIncompleteSectionsRef.current = false;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
setSections(parsedValue || defaultValue());
|
|
40
|
+
}, [defaultValue, parsedValue]);
|
|
41
|
+
return {
|
|
42
|
+
activeSection: activeSection,
|
|
43
|
+
pendingDigits: pendingDigits,
|
|
44
|
+
preserveIncompleteSectionsRef: preserveIncompleteSectionsRef,
|
|
45
|
+
sections: sections,
|
|
46
|
+
setActiveSection: setActiveSection,
|
|
47
|
+
setPendingDigits: setPendingDigits,
|
|
48
|
+
setSections: setSections
|
|
49
|
+
};
|
|
50
|
+
};
|