@sebgroup/green-react 1.2.1 → 1.3.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.
Files changed (59) hide show
  1. package/{index.esm.js → index.js} +181 -91
  2. package/package.json +7 -6
  3. package/{index.d.ts → src/index.d.ts} +2 -1
  4. package/{lib → src/lib}/dropdown/hooks.d.ts +1 -1
  5. package/src/lib/form/input/input.d.ts +10 -0
  6. package/{lib → src/lib}/form/types.d.ts +5 -1
  7. package/src/lib/layout/flexbox/types.d.ts +5 -0
  8. package/{lib → src/lib}/modal/modal.d.ts +1 -1
  9. package/src/lib/slider/index.d.ts +1 -0
  10. package/src/lib/slider/slider.d.ts +3 -0
  11. package/src/types/props/index.d.ts +28 -0
  12. package/index.umd.js +0 -3654
  13. package/lib/form/input/input.d.ts +0 -10
  14. package/lib/layout/flexbox/types.d.ts +0 -5
  15. package/types/props/index.d.ts +0 -15
  16. /package/{lib → src/lib}/accordion/accordion-item.d.ts +0 -0
  17. /package/{lib → src/lib}/accordion/accordion.d.ts +0 -0
  18. /package/{lib → src/lib}/alert-ribbon/alert-ribbon.d.ts +0 -0
  19. /package/{lib → src/lib}/badge/badge.d.ts +0 -0
  20. /package/{lib → src/lib}/card/card.d.ts +0 -0
  21. /package/{lib → src/lib}/datepicker/datepicker.d.ts +0 -0
  22. /package/{lib → src/lib}/datepicker/hook.d.ts +0 -0
  23. /package/{lib → src/lib}/dropdown/dropdown.d.ts +0 -0
  24. /package/{lib → src/lib}/form/button/button.d.ts +0 -0
  25. /package/{lib → src/lib}/form/buttonGroup/buttonGroup.d.ts +0 -0
  26. /package/{lib → src/lib}/form/form.d.ts +0 -0
  27. /package/{lib → src/lib}/form/formContext.d.ts +0 -0
  28. /package/{lib → src/lib}/form/formItems.d.ts +0 -0
  29. /package/{lib → src/lib}/form/group/group.d.ts +0 -0
  30. /package/{lib → src/lib}/form/iconButton/iconButton.d.ts +0 -0
  31. /package/{lib → src/lib}/form/index.d.ts +0 -0
  32. /package/{lib → src/lib}/form/radioButton/radioGroup.d.ts +0 -0
  33. /package/{lib → src/lib}/form/text/text.d.ts +0 -0
  34. /package/{lib → src/lib}/form/useInput.d.ts +0 -0
  35. /package/{lib → src/lib}/form/validateInput.d.ts +0 -0
  36. /package/{lib → src/lib}/formItem/formItem.d.ts +0 -0
  37. /package/{lib → src/lib}/formItem/index.d.ts +0 -0
  38. /package/{lib → src/lib}/icons/bankId.d.ts +0 -0
  39. /package/{lib → src/lib}/icons/check.d.ts +0 -0
  40. /package/{lib → src/lib}/icons/chevronDown.d.ts +0 -0
  41. /package/{lib → src/lib}/icons/index.d.ts +0 -0
  42. /package/{lib → src/lib}/icons/infoCircle.d.ts +0 -0
  43. /package/{lib → src/lib}/icons/square-exclamation.d.ts +0 -0
  44. /package/{lib → src/lib}/icons/square-info.d.ts +0 -0
  45. /package/{lib → src/lib}/icons/times.d.ts +0 -0
  46. /package/{lib → src/lib}/layout/flexbox/flexbox.d.ts +0 -0
  47. /package/{lib → src/lib}/layout/index.d.ts +0 -0
  48. /package/{lib → src/lib}/link/link.d.ts +0 -0
  49. /package/{lib → src/lib}/list/index.d.ts +0 -0
  50. /package/{lib → src/lib}/list/list.d.ts +0 -0
  51. /package/{lib → src/lib}/list/listItem.d.ts +0 -0
  52. /package/{lib → src/lib}/list/valueList.d.ts +0 -0
  53. /package/{lib → src/lib}/navbar/navbar.d.ts +0 -0
  54. /package/{lib → src/lib}/select/index.d.ts +0 -0
  55. /package/{lib → src/lib}/select/select.d.ts +0 -0
  56. /package/{lib → src/lib}/stepper/hook.d.ts +0 -0
  57. /package/{lib → src/lib}/stepper/stepper.d.ts +0 -0
  58. /package/{lib → src/lib}/tabs/tabs.d.ts +0 -0
  59. /package/{types → src/types}/index.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import React, { useState, useLayoutEffect, useEffect, useRef, useMemo } from 'react';
3
- import { randomId, debounce, validateClassName, delay, createStepper, createDropdown, dropdownValues, createDatepicker, months, years } from '@sebgroup/extract';
3
+ import { randomId, debounce, validateClassName, delay, sliderColors, getSliderTrackBackground, createStepper, createDropdown, dropdownValues, createDatepicker, months, years } from '@sebgroup/extract';
4
4
  import classNames from 'classnames';
5
5
 
6
6
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -333,10 +333,10 @@ var store$2 = sharedStore;
333
333
  (shared$3.exports = function (key, value) {
334
334
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
335
335
  })('versions', []).push({
336
- version: '3.29.0',
336
+ version: '3.29.1',
337
337
  mode: 'global',
338
338
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
339
- license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',
339
+ license: 'https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE',
340
340
  source: 'https://github.com/zloirock/core-js'
341
341
  });
342
342
 
@@ -2429,6 +2429,7 @@ const useInput = (props, onChanges, onChangeInput) => {
2429
2429
  const [value, setValue] = useState(props.value ? props.value : '');
2430
2430
  const [checked, setChecked] = useState(props.checked ? props.checked : false);
2431
2431
  useEffect(() => {
2432
+ if (props.value !== undefined) setValue(props.value);
2432
2433
  if (ref.current && ref.current.form) {
2433
2434
  const resetListener = () => {
2434
2435
  setValue(props.value ? props.value : '');
@@ -2443,7 +2444,9 @@ const useInput = (props, onChanges, onChangeInput) => {
2443
2444
  }
2444
2445
  }, [props]);
2445
2446
  const onChange = event => {
2446
- setValue(event.target.value);
2447
+ if (props.value === undefined) {
2448
+ setValue(event.target.value);
2449
+ }
2447
2450
  setChecked(event.currentTarget.checked);
2448
2451
  onChanges && onChanges(event);
2449
2452
  onChangeInput && onChangeInput(event.target.value);
@@ -2457,7 +2460,7 @@ const useInput = (props, onChanges, onChangeInput) => {
2457
2460
  });
2458
2461
  };
2459
2462
 
2460
- const RenderInput = (type, props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel) => {
2463
+ const RenderInput = (type, props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel, testId) => {
2461
2464
  const _a = useInput(props, onChange, onChangeInput),
2462
2465
  {
2463
2466
  value
@@ -2469,7 +2472,8 @@ const RenderInput = (type, props, onChange, onChangeInput, label, info, validato
2469
2472
  // Render naked
2470
2473
  if (!label && !info && !expandableInfo) return jsx("input", Object.assign({
2471
2474
  type: type,
2472
- value: value
2475
+ value: value,
2476
+ "data-testid": testId
2473
2477
  }, propsWithDescription));
2474
2478
  return jsx(FormItem, Object.assign({
2475
2479
  validator: validator,
@@ -2486,7 +2490,8 @@ const RenderInput = (type, props, onChange, onChangeInput, label, info, validato
2486
2490
  type: type,
2487
2491
  value: value
2488
2492
  }, propsWithDescription, {
2489
- className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
2493
+ className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator),
2494
+ "data-testid": testId
2490
2495
  }))
2491
2496
  }))
2492
2497
  }));
@@ -2495,14 +2500,15 @@ const TextInput = _a => {
2495
2500
  var {
2496
2501
  label,
2497
2502
  info,
2503
+ testId,
2498
2504
  onChange,
2499
2505
  onChangeInput,
2500
2506
  validator,
2501
2507
  expandableInfo,
2502
2508
  expandableInfoButtonLabel
2503
2509
  } = _a,
2504
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
2505
- return RenderInput('text', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel);
2510
+ props = __rest(_a, ["label", "info", "testId", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
2511
+ return RenderInput('text', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel, testId);
2506
2512
  };
2507
2513
  const EmailInput = _a => {
2508
2514
  var {
@@ -2510,10 +2516,11 @@ const EmailInput = _a => {
2510
2516
  info,
2511
2517
  onChange,
2512
2518
  onChangeInput,
2513
- validator
2519
+ validator,
2520
+ testId
2514
2521
  } = _a,
2515
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2516
- return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
2522
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "testId"]);
2523
+ return RenderInput('email', props, onChange, onChangeInput, label, info, validator, testId);
2517
2524
  };
2518
2525
  const NumberInput = _a => {
2519
2526
  var {
@@ -2523,18 +2530,20 @@ const NumberInput = _a => {
2523
2530
  onChangeInput,
2524
2531
  validator,
2525
2532
  expandableInfo,
2526
- expandableInfoButtonLabel
2533
+ expandableInfoButtonLabel,
2534
+ testId
2527
2535
  } = _a,
2528
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
2529
- return RenderInput('number', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel);
2536
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel", "testId"]);
2537
+ return RenderInput('number', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel, testId);
2530
2538
  };
2531
2539
  const Checkbox = _a => {
2532
2540
  var {
2533
2541
  label,
2534
2542
  onChange,
2535
- validator
2543
+ validator,
2544
+ testId
2536
2545
  } = _a,
2537
- props = __rest(_a, ["label", "onChange", "validator"]);
2546
+ props = __rest(_a, ["label", "onChange", "validator", "testId"]);
2538
2547
  const inputProps = useInput(props, onChange);
2539
2548
  const labelClassNames = classNames('form-control', validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
2540
2549
  const inputClassNames = classNames(validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
@@ -2546,7 +2555,8 @@ const Checkbox = _a => {
2546
2555
  className: labelClassNames
2547
2556
  }, {
2548
2557
  children: [label, jsx("input", Object.assign({
2549
- type: "checkbox"
2558
+ type: "checkbox",
2559
+ "data-testid": testId
2550
2560
  }, inputProps, {
2551
2561
  className: inputClassNames
2552
2562
  })), jsx("i", {})]
@@ -2560,9 +2570,10 @@ const Checkbox = _a => {
2560
2570
  const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
2561
2571
  var {
2562
2572
  label,
2563
- validator
2573
+ validator,
2574
+ testId
2564
2575
  } = _a,
2565
- props = __rest(_a, ["label", "validator"]);
2576
+ props = __rest(_a, ["label", "validator", "testId"]);
2566
2577
  const {
2567
2578
  id
2568
2579
  } = useInput(props);
@@ -2573,7 +2584,8 @@ const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
2573
2584
  }, {
2574
2585
  children: [jsx("input", Object.assign({
2575
2586
  id: id,
2576
- type: "radio"
2587
+ type: "radio",
2588
+ "data-testid": testId
2577
2589
  }, props, {
2578
2590
  className: inputClassNames,
2579
2591
  ref: ref
@@ -3005,6 +3017,153 @@ function Badge(_a) {
3005
3017
  })) : null;
3006
3018
  }
3007
3019
 
3020
+ const Select = /*#__PURE__*/React.forwardRef(({
3021
+ id,
3022
+ className,
3023
+ children,
3024
+ validator,
3025
+ label,
3026
+ labelInformation,
3027
+ defaultValue,
3028
+ value,
3029
+ testId,
3030
+ onChange,
3031
+ onSelect,
3032
+ expandableInfo,
3033
+ expandableInfoButtonLabel
3034
+ }, ref) => {
3035
+ const selectId = id !== null && id !== void 0 ? id : randomId();
3036
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
3037
+ return jsx(FormItem, Object.assign({
3038
+ label: label,
3039
+ labelInformation: labelInformation,
3040
+ expandableInfo: expandableInfo,
3041
+ expandableInfoButtonLabel: expandableInfoButtonLabel,
3042
+ inputId: selectId,
3043
+ validator: validator
3044
+ }, {
3045
+ children: jsxs("div", Object.assign({
3046
+ className: `gds-select ${validatorClassName}`
3047
+ }, {
3048
+ children: [jsx("select", Object.assign({
3049
+ id: selectId,
3050
+ "data-testid": testId,
3051
+ className: className,
3052
+ defaultValue: defaultValue,
3053
+ value: value,
3054
+ ref: ref,
3055
+ onChange: event => {
3056
+ onChange && onChange(event);
3057
+ }
3058
+ }, {
3059
+ children: children
3060
+ })), jsx(ChevronDown, {})]
3061
+ }))
3062
+ }));
3063
+ });
3064
+ const Option = _a => {
3065
+ var {
3066
+ value,
3067
+ children
3068
+ } = _a,
3069
+ rest = __rest(_a, ["value", "children"]);
3070
+ return jsx("option", Object.assign({
3071
+ value: value
3072
+ }, rest, {
3073
+ children: children
3074
+ }));
3075
+ };
3076
+ const OptionGroup = ({
3077
+ label,
3078
+ disabled,
3079
+ children
3080
+ }) => {
3081
+ return jsx("optgroup", Object.assign({
3082
+ label: label,
3083
+ disabled: disabled
3084
+ }, {
3085
+ children: children
3086
+ }));
3087
+ };
3088
+
3089
+ function Slider({
3090
+ name = `${randomId()}-slider`,
3091
+ defaultValue,
3092
+ min = 0,
3093
+ max = 100,
3094
+ step = 1,
3095
+ label,
3096
+ instruction,
3097
+ errorMessage,
3098
+ hasTextbox = false,
3099
+ disabled = false,
3100
+ onChange
3101
+ }) {
3102
+ const [background, setBackground] = React.useState();
3103
+ const [sliderValue, setSliderValue] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0);
3104
+ React.useLayoutEffect(() => {
3105
+ if (disabled) {
3106
+ setBackground(sliderColors.disabled);
3107
+ return;
3108
+ }
3109
+ const percent = (sliderValue - min) / (max - min) * 100;
3110
+ setBackground(getSliderTrackBackground(percent));
3111
+ }, [disabled, sliderValue]);
3112
+ const handleChange = e => {
3113
+ const {
3114
+ value
3115
+ } = e.target;
3116
+ setSliderValue(Number(value));
3117
+ if (onChange) onChange(Number(value));
3118
+ };
3119
+ return jsxs(Fragment, {
3120
+ children: [label && jsxs("div", Object.assign({
3121
+ className: "gds-slider-label-container"
3122
+ }, {
3123
+ children: [jsxs("div", {
3124
+ children: [jsx("label", Object.assign({
3125
+ htmlFor: name
3126
+ }, {
3127
+ children: label
3128
+ })), instruction && jsx("p", {
3129
+ children: instruction
3130
+ })]
3131
+ }), hasTextbox && jsxs("div", Object.assign({
3132
+ className: "form-group"
3133
+ }, {
3134
+ children: [jsx("input", {
3135
+ type: "number",
3136
+ value: sliderValue,
3137
+ id: `${name}-textbox`,
3138
+ name: name,
3139
+ className: errorMessage ? 'is-invalid' : '',
3140
+ disabled: disabled,
3141
+ onChange: handleChange
3142
+ }), jsx("span", {
3143
+ className: "form-info"
3144
+ })]
3145
+ }))]
3146
+ })), jsx("input", {
3147
+ type: "range",
3148
+ value: sliderValue,
3149
+ id: name,
3150
+ name: name,
3151
+ min: min,
3152
+ max: max,
3153
+ step: step,
3154
+ disabled: disabled,
3155
+ onChange: handleChange,
3156
+ style: {
3157
+ background
3158
+ }
3159
+ }), errorMessage && jsx("p", Object.assign({
3160
+ className: "gds-slider-error-info"
3161
+ }, {
3162
+ children: errorMessage
3163
+ }))]
3164
+ });
3165
+ }
3166
+
3008
3167
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3009
3168
  const noop = () => {};
3010
3169
  const useStepper = ({
@@ -3120,75 +3279,6 @@ function Stepper(_a) {
3120
3279
  }));
3121
3280
  }
3122
3281
 
3123
- const Select = /*#__PURE__*/React.forwardRef(({
3124
- id,
3125
- className,
3126
- children,
3127
- validator,
3128
- label,
3129
- labelInformation,
3130
- defaultValue,
3131
- value,
3132
- testId,
3133
- onChange,
3134
- onSelect,
3135
- expandableInfo,
3136
- expandableInfoButtonLabel
3137
- }, ref) => {
3138
- const selectId = id !== null && id !== void 0 ? id : randomId();
3139
- const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
3140
- return jsx(FormItem, Object.assign({
3141
- label: label,
3142
- labelInformation: labelInformation,
3143
- expandableInfo: expandableInfo,
3144
- expandableInfoButtonLabel: expandableInfoButtonLabel,
3145
- inputId: selectId,
3146
- validator: validator
3147
- }, {
3148
- children: jsxs("div", Object.assign({
3149
- className: `gds-select ${validatorClassName}`
3150
- }, {
3151
- children: [jsx("select", Object.assign({
3152
- id: selectId,
3153
- "data-testid": testId,
3154
- className: className,
3155
- defaultValue: defaultValue,
3156
- value: value,
3157
- ref: ref,
3158
- onChange: event => {
3159
- onChange && onChange(event);
3160
- }
3161
- }, {
3162
- children: children
3163
- })), jsx(ChevronDown, {})]
3164
- }))
3165
- }));
3166
- });
3167
- const Option = _a => {
3168
- var {
3169
- value,
3170
- children
3171
- } = _a,
3172
- rest = __rest(_a, ["value", "children"]);
3173
- return jsx("option", Object.assign({
3174
- value: value
3175
- }, rest, {
3176
- children: children
3177
- }));
3178
- };
3179
- const OptionGroup = ({
3180
- label,
3181
- disabled,
3182
- children
3183
- }) => {
3184
- return jsx("optgroup", Object.assign({
3185
- label: label,
3186
- disabled: disabled
3187
- }, {
3188
- children: children
3189
- }));
3190
- };
3191
-
3192
3282
  const useDropdown = ({
3193
3283
  id,
3194
3284
  value,
@@ -3612,4 +3702,4 @@ const Datepicker = (options = {}) => {
3612
3702
  });
3613
3703
  };
3614
3704
 
3615
- export { AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormItem, FormItems, Group, Link, List$1 as List, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, RenderInput, Select, Stepper, Text, TextInput, valueList$1 as ValueList };
3705
+ export { AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormItem, FormItems, Group, Link, List$1 as List, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, RenderInput, Select, Slider, Stepper, Text, TextInput, valueList$1 as ValueList };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sebgroup/green-react",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "peerDependencies": {
5
5
  "react": "^17 || ^18",
6
6
  "react-dom": "^17 || ^18"
7
7
  },
8
8
  "dependencies": {
9
- "@sebgroup/chlorophyll": "^1.0.0",
10
- "@sebgroup/extract": "^1.0.0",
9
+ "@sebgroup/chlorophyll": "^1.6.0",
10
+ "@sebgroup/extract": "^1.3.0",
11
11
  "classnames": "^2.3.2"
12
12
  },
13
13
  "description": "React components built on top of @sebgroup/chlorophyll.",
@@ -26,7 +26,8 @@
26
26
  "url": "https://github.com/sebgroup/green/labels/react"
27
27
  },
28
28
  "homepage": "https://sebgroup.github.io/green/latest/react/",
29
- "main": "./index.umd.js",
30
- "module": "./index.esm.js",
31
- "typings": "./index.d.ts"
29
+ "module": "./index.js",
30
+ "main": "./index.js",
31
+ "type": "module",
32
+ "types": "./src/index.d.ts"
32
33
  }
@@ -8,8 +8,9 @@ export * from './lib/list';
8
8
  export * from './lib/navbar/navbar';
9
9
  export * from './lib/link/link';
10
10
  export * from './lib/badge/badge';
11
- export * from './lib/stepper/stepper';
12
11
  export * from './lib/select';
12
+ export * from './lib/slider';
13
+ export * from './lib/stepper/stepper';
13
14
  export * from './lib/dropdown/dropdown';
14
15
  export * from './lib/datepicker/datepicker';
15
16
  export * from './types';
@@ -7,7 +7,7 @@ interface HookArgs extends DropdownArgs {
7
7
  onChange?: OnChange;
8
8
  validator?: IValidator;
9
9
  }
10
- declare type Props = HTMLAttributes<HTMLElement>;
10
+ type Props = HTMLAttributes<HTMLElement>;
11
11
  interface CheckboxItem {
12
12
  labelProps: Props;
13
13
  inputProps: InputHTMLAttributes<HTMLInputElement>;
@@ -0,0 +1,10 @@
1
+ import React, { InputHTMLAttributes } from 'react';
2
+ import { IValidator } from '@sebgroup/extract';
3
+ import { CheckboxProps, NumberInputProps, RadioButtonProps, TextInputProps } from '../types';
4
+ export type Renderer = (type: string, props: InputHTMLAttributes<HTMLInputElement>, onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void, onChangeInput?: (value: string) => string, label?: string, info?: string, validator?: IValidator, expandableInfo?: string, expandableInfoButtonLabel?: string, testId?: string) => JSX.Element;
5
+ export declare const RenderInput: Renderer;
6
+ export declare const TextInput: ({ label, info, testId, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, ...props }: TextInputProps) => JSX.Element;
7
+ export declare const EmailInput: ({ label, info, onChange, onChangeInput, validator, testId, ...props }: TextInputProps) => JSX.Element;
8
+ export declare const NumberInput: ({ label, info, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, testId, ...props }: NumberInputProps) => JSX.Element;
9
+ export declare const Checkbox: ({ label, onChange, validator, testId, ...props }: CheckboxProps) => JSX.Element;
10
+ export declare const RadioButton: React.ForwardRefExoticComponent<Pick<RadioButtonProps, "label" | "testId" | "onChange" | "validator" | "type" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLInputElement>>;
@@ -4,12 +4,14 @@ export interface TextInputProps extends HTMLProps<HTMLInputElement> {
4
4
  type?: 'text' | 'email' | 'number';
5
5
  label?: string;
6
6
  info?: string;
7
+ testId?: string;
7
8
  expandableInfo?: string;
8
9
  expandableInfoButtonLabel?: string;
9
10
  validator?: IValidator;
10
11
  onChangeInput?: (value: string) => string;
11
12
  }
12
13
  export interface NumberInputProps extends TextInputProps {
14
+ testId?: string;
13
15
  min?: number;
14
16
  max?: number;
15
17
  step?: number;
@@ -17,11 +19,13 @@ export interface NumberInputProps extends TextInputProps {
17
19
  expandableInfoButtonLabel?: string;
18
20
  }
19
21
  export interface CheckboxProps extends HTMLProps<HTMLInputElement> {
22
+ testId?: string;
20
23
  validator?: IValidator;
21
24
  }
22
25
  export interface RadioButtonProps extends HTMLProps<HTMLInputElement> {
23
26
  label: string;
27
+ testId?: string;
24
28
  validator?: string;
25
29
  value: string;
26
30
  }
27
- export declare type InputListener<T> = (newValue?: T) => unknown;
31
+ export type InputListener<T> = (newValue?: T) => unknown;
@@ -0,0 +1,5 @@
1
+ export type AlignContentType = 'start' | 'between' | 'center' | 'stretch' | 'around' | 'end' | 'sm-start' | 'sm-between' | 'sm-center' | 'sm-stretch' | 'sm-around' | 'sm-end' | 'md-start' | 'md-between' | 'md-center' | 'md-stretch' | 'md-around' | 'md-end' | 'lg-start' | 'lg-between' | 'lg-center' | 'lg-stretch' | 'lg-around' | 'lg-end' | 'xl-start' | 'xl-between' | 'xl-center' | 'xl-stretch' | 'xl-around' | 'xl-end' | 'xxl-start' | 'xxl-between' | 'xxl-center' | 'xxl-stretch' | 'xxl-around' | 'xxl-end';
2
+ export type AlignType = 'start' | 'end' | 'center' | 'baseline' | 'stretch' | 'sm-start' | 'sm-end' | 'sm-center' | 'sm-baseline' | 'sm-stretch' | 'md-start' | 'md-end' | 'md-center' | 'md-baseline' | 'md-stretch' | 'lg-start' | 'lg-end' | 'lg-center' | 'lg-baseline' | 'lg-stretch' | 'xl-start' | 'xl-end' | 'xl-center' | 'xl-baseline' | 'xl-stretch' | 'xxl-start' | 'xxl-end' | 'xxl-center' | 'xxl-baseline' | 'xxl-stretch';
3
+ export type JustifyContentType = 'start' | 'between' | 'center' | 'evenly' | 'around' | 'end' | 'sm-start' | 'sm-between' | 'sm-center' | 'sm-evenly' | 'sm-around' | 'sm-end' | 'md-start' | 'md-between' | 'md-center' | 'md-evenly' | 'md-around' | 'md-end' | 'lg-start' | 'lg-between' | 'lg-center' | 'lg-evenly' | 'lg-around' | 'lg-end' | 'xl-start' | 'xl-between' | 'xl-center' | 'xl-evenly' | 'xl-around' | 'xl-end' | 'xxl-start' | 'xxl-between' | 'xxl-center' | 'xxl-evenly' | 'xxl-around' | 'xxl-end';
4
+ export type FlexDirectionType = 'row' | 'row-reverse' | 'column' | 'column-reverse' | 'sm-row' | 'sm-row-reverse' | 'sm-column' | 'sm-column-reverse' | 'md-row' | 'md-row-reverse' | 'md-column' | 'md-column-reverse' | 'lg-row' | 'lg-row-reverse' | 'lg-column' | 'lg-column-reverse' | 'xl-row' | 'xl-row-reverse' | 'xl-column' | 'xl-column-reverse' | 'xxl-row' | 'xxl-row-reverse' | 'xxl-column' | 'xxl-column-reverse';
5
+ export type FlexWrapType = 'nowrap' | 'wrap' | 'wrap-reverse' | 'sm-nowrap' | 'sm-wrap' | 'sm-wrap-reverse' | 'md-nowrap' | 'md-wrap' | 'md-wrap-reverse' | 'lg-nowrap' | 'lg-wrap' | 'lg-wrap-reverse' | 'xl-nowrap' | 'xl-wrap' | 'xl-wrap-reverse' | 'xxl-nowrap' | 'xxl-wrap' | 'xxl-wrap-reverse';
@@ -1,6 +1,6 @@
1
1
  import { ModalType, Size } from '@sebgroup/extract';
2
2
  import { MouseEvent, ReactNode } from 'react';
3
- declare type ModalEventListener = (event: MouseEvent<HTMLButtonElement>) => unknown;
3
+ type ModalEventListener = (event: MouseEvent<HTMLButtonElement>) => unknown;
4
4
  export interface ModalProps {
5
5
  type?: ModalType;
6
6
  header?: string;
@@ -0,0 +1 @@
1
+ export * from './slider';
@@ -0,0 +1,3 @@
1
+ import { SliderProps } from '../../types';
2
+ export declare function Slider({ name, defaultValue, min, max, step, label, instruction, errorMessage, hasTextbox, disabled, onChange, }: SliderProps): JSX.Element;
3
+ export default Slider;
@@ -0,0 +1,28 @@
1
+ export interface IconProps {
2
+ focusable?: boolean;
3
+ title?: string;
4
+ fill?: string;
5
+ 'aria-hidden'?: boolean;
6
+ }
7
+ export interface SelectorAttributesProps {
8
+ id?: string;
9
+ className?: string;
10
+ testId?: string;
11
+ }
12
+ export interface LabelProps {
13
+ label?: string;
14
+ labelInformation?: string;
15
+ }
16
+ export interface SliderProps {
17
+ name?: string;
18
+ defaultValue?: number;
19
+ min?: number;
20
+ max?: number;
21
+ step?: number;
22
+ label?: string;
23
+ instruction?: string;
24
+ errorMessage?: string;
25
+ hasTextbox?: boolean;
26
+ disabled?: boolean;
27
+ onChange?: (value: number) => void;
28
+ }