@homecode/ui 5.20.24 → 5.21.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/dist/esm/index.js +1 -0
- package/dist/esm/src/components/Autocomplete/Autocomplete.js +2 -0
- package/dist/esm/src/components/Gallery/Dots/Dots.js +7 -2
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js +2 -2
- package/dist/esm/src/components/InputFile/InputFile.js +2 -0
- package/dist/esm/src/components/Select/Select.styl.js +2 -2
- package/dist/esm/src/components/Select/Select2.js +47 -6
- package/dist/esm/src/components/Stepper/Stepper.js +94 -0
- package/dist/esm/src/components/Stepper/Stepper.styl.js +20 -0
- package/dist/esm/types/src/components/Gallery/Dots/Dots.d.ts +9 -4
- package/dist/esm/types/src/components/Select/Select.types.d.ts +1 -0
- package/dist/esm/types/src/components/Stepper/Stepper.d.ts +3 -0
- package/dist/esm/types/src/components/Stepper/Stepper.types.d.ts +49 -0
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -60,6 +60,7 @@ export { Scroll } from './src/components/Scroll/Scroll.js';
|
|
|
60
60
|
export { Slider } from './src/components/Slider/Slider.js';
|
|
61
61
|
export { Shimmer } from './src/components/Shimmer/Shimmer.js';
|
|
62
62
|
export { Spinner } from './src/components/Spinner/Spinner.js';
|
|
63
|
+
export { Stepper } from './src/components/Stepper/Stepper.js';
|
|
63
64
|
export { Table } from './src/components/Table/Table.js';
|
|
64
65
|
export { Tabs } from './src/components/Tabs/Tabs.js';
|
|
65
66
|
export { TextShimmer } from './src/components/TextShimmer/TextShimmer.js';
|
|
@@ -90,6 +90,8 @@ import '../RadioButton/RadioButton.styl.js';
|
|
|
90
90
|
import '../RadioGroup/RadioGroup.styl.js';
|
|
91
91
|
import '../Router/Router.js';
|
|
92
92
|
import '../Resizer/Resizer.styl.js';
|
|
93
|
+
import '../Gallery/Dots/Dots.styl.js';
|
|
94
|
+
import '../Stepper/Stepper.styl.js';
|
|
93
95
|
import '../Tabs/Tabs.styl.js';
|
|
94
96
|
import '../TextWithDeferTooltip/TextWithDeferTooltip.styl.js';
|
|
95
97
|
import '../Text/Text.js';
|
|
@@ -2,8 +2,13 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import S from './Dots.styl.js';
|
|
4
4
|
|
|
5
|
-
function Dots({ index, count }) {
|
|
6
|
-
return (jsx("div", { className: S.root, children: jsx("div", { className: S.inner, children: Array.from({ length: count }).map((_, i) =>
|
|
5
|
+
function Dots({ index, count, className, onSelect, getLabel, }) {
|
|
6
|
+
return (jsx("div", { className: cn(S.root, onSelect && S.interactive, className), children: jsx("div", { className: S.inner, children: Array.from({ length: count }).map((_, i) => {
|
|
7
|
+
const classes = cn(S.item, i === index && S.active);
|
|
8
|
+
if (!onSelect)
|
|
9
|
+
return jsx("div", { className: classes }, i);
|
|
10
|
+
return (jsx("button", { type: "button", className: classes, "aria-label": getLabel?.(i) ?? String(i + 1), "aria-current": i === index ? 'step' : undefined, onClick: () => onSelect(i) }, i));
|
|
11
|
+
}) }) }));
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
export { Dots as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var css_248z = ".Dots_root__dTavT{bottom:1%;display:flex;justify-content:center;-webkit-mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);overflow:hidden;padding:0 10%;pointer-events:none;position:absolute;width:100%}.Dots_inner__0Nqa9{align-items:center;display:flex}.Dots_item__gEVuS{background-color:var(--accent-color-alpha-200);border-radius:50%;box-shadow:0 0 0 1px var(--decent-color-alpha-500);flex-shrink:0;height:8px;margin:3px;transition:.1s ease-out;transition-property:background-color,transform;width:8px}.Dots_item__gEVuS.Dots_active__gAUAj{background-color:var(--accent-color-alpha-500);transform:scale(1.2)}";
|
|
2
|
-
var S = {"root":"Dots_root__dTavT","inner":"Dots_inner__0Nqa9","item":"Dots_item__gEVuS","active":"Dots_active__gAUAj"};
|
|
1
|
+
var css_248z = ".Dots_root__dTavT{bottom:1%;display:flex;justify-content:center;-webkit-mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);overflow:hidden;padding:0 10%;pointer-events:none;position:absolute;width:100%}.Dots_inner__0Nqa9{align-items:center;display:flex}.Dots_item__gEVuS{background-color:var(--accent-color-alpha-200);border-radius:50%;box-shadow:0 0 0 1px var(--decent-color-alpha-500);flex-shrink:0;height:8px;margin:3px;transition:.1s ease-out;transition-property:background-color,transform;width:8px}.Dots_item__gEVuS.Dots_active__gAUAj{background-color:var(--accent-color-alpha-500);transform:scale(1.2)}.Dots_interactive__wQylw{pointer-events:auto}.Dots_interactive__wQylw .Dots_item__gEVuS{border:none;cursor:pointer;padding:0}.Dots_interactive__wQylw .Dots_item__gEVuS:hover:not(.Dots_active__gAUAj){background-color:var(--accent-color-alpha-400)}.Dots_interactive__wQylw .Dots_item__gEVuS:focus-visible{outline:2px solid var(--active-color);outline-offset:2px}";
|
|
2
|
+
var S = {"root":"Dots_root__dTavT","inner":"Dots_inner__0Nqa9","item":"Dots_item__gEVuS","active":"Dots_active__gAUAj","interactive":"Dots_interactive__wQylw"};
|
|
3
3
|
if (typeof document !== 'undefined') {
|
|
4
4
|
var __uilibHead = document.head || document.getElementsByTagName('head')[0];
|
|
5
5
|
if (__uilibHead) {
|
|
@@ -90,6 +90,8 @@ import '../RadioButton/RadioButton.styl.js';
|
|
|
90
90
|
import '../RadioGroup/RadioGroup.styl.js';
|
|
91
91
|
import '../Router/Router.js';
|
|
92
92
|
import '../Resizer/Resizer.styl.js';
|
|
93
|
+
import '../Gallery/Dots/Dots.styl.js';
|
|
94
|
+
import '../Stepper/Stepper.styl.js';
|
|
93
95
|
import '../Tabs/Tabs.styl.js';
|
|
94
96
|
import '../TextWithDeferTooltip/TextWithDeferTooltip.styl.js';
|
|
95
97
|
import '../Text/Text.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var css_248z = ".Select_root__mjOjv{max-height:200px;max-width:100%;position:relative}.Select_root__mjOjv.Select_disabled__AlOQi{opacity:.4;pointer-events:none}.Select_additionalLabel__K0--Z{flex-grow:1;overflow:hidden;text-align:left;text-overflow:ellipsis}.Select_trigger__OH48f{position:relative;z-index:1}.Select_triggerArrow__1LEop{flex-shrink:0;margin-left:.3em;margin-right:.7em;opacity:.3;transition:.2s ease-out;transition-property:opacity,transform}.Select_root__mjOjv:hover .Select_triggerArrow__1LEop{opacity:1}.Select_triggerArrow__1LEop.Select_isOpen__WlMUH{transform:rotateX(-180deg)}.Select_disabled__AlOQi .Select_triggerArrow__1LEop{color:var(--text3-color)}.Select_variant-clear__3Htb5 .Select_triggerButton__lErtt{background-color:transparent}.Select_triggerButton__lErtt{justify-content:space-between;text-align:left;width:100%}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad{padding-right:0}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad>span{max-width:calc(100% - 22px)}.Select_triggerButton__lErtt.Select_isError__WJJLq{box-shadow:inset 0 0 0 2px var(--danger-color)}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh{line-height:1.2em;opacity:0;overflow:hidden;text-overflow:ellipsis}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh.Select_hasSelected__zQhBV{opacity:1}.Select_presetPanel__Yu94r{box-shadow:inset 0 -1px 0 var(--decent-color-alpha-100);display:flex;padding:5px}.Select_presetButton__BAl0q{flex-grow:1;justify-content:center}.Select_presetButton__BAl0q+.Select_presetButton__BAl0q{margin-left:8px}.Select_options__3C0-v{max-height:200px;overflow-y:auto}.keyboard .Select_options__3C0-v{pointer-events:none}.Select_option__iJkfJ{align-items:center;cursor:pointer;display:flex;overflow:hidden;padding-bottom:0!important;padding-top:0!important;position:relative;text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}.Select_isTree__SiTaD .Select_option__iJkfJ{min-height:36px}.Select_size-xs__2lZQY .Select_option__iJkfJ{border-radius:6px;font-size:14px;height:22px;padding:0 8px}.Select_size-s__qBK9t .Select_option__iJkfJ{border-radius:6px;font-size:16px;height:26px;padding:0 12px}.Select_size-m__jp7n- .Select_option__iJkfJ{border-radius:9px;font-size:18px;height:34px;padding:0 16px}.Select_size-l__b4EEy .Select_option__iJkfJ{border-radius:12px;font-size:22px;height:42px;padding:0 20px}.Select_size-xl__0OerX .Select_option__iJkfJ{border-radius:15px;font-size:26px;height:50px;padding:0 24px}.Select_isTree__SiTaD .Select_option__iJkfJ{padding-left:30px}.Select_option__iJkfJ.Select_isGroup__aP1lY{color:var(--accent-color);font-weight:500;pointer-events:none}.Select_isExpanded__rG8R1>.Select_option__iJkfJ{display:flex}.Select_option__iJkfJ>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Select_option__iJkfJ:before{content:\"\";display:inline-block}.Select_option__iJkfJ.Select_level-0__vu03A:before{content:none}.Select_option__iJkfJ.Select_level-1__ozH2U:before{min-width:24px;width:24px}.Select_option__iJkfJ.Select_level-2__XDqeh:before{min-width:48px;width:48px}.Select_option__iJkfJ.Select_level-3__Bc9XS:before{min-width:72px;width:72px}.Select_option__iJkfJ.Select_level-4__KfQcQ:before{min-width:96px;width:96px}.Select_option__iJkfJ.Select_level-5__DGSDM:before{min-width:120px;width:120px}.Select_option__iJkfJ.Select_level-6__p688A:before{min-width:144px;width:144px}.Select_option__iJkfJ.Select_isIndeterminate__dy-xV,.Select_option__iJkfJ.Select_isSelected__n3ZeN{background-color:var(--active-color-alpha-500)}.keyboard .Select_option__iJkfJ.Select_isFocused__oZSgY,.pointer .Select_option__iJkfJ:hover{box-shadow:inset 100vw 0 0 0 var(--accent-color-alpha-200)}.Select_expandButton__UTwlR{background-color:transparent!important;display:flex;height:100%;justify-content:flex-end;overflow:visible;padding:0;position:relative;width:30px}.Select_expandButton__UTwlR:before{content:\"\";display:block;height:calc(100% + 20px);position:absolute;right:0;top:-10;width:100px}.Select_size-xs__2lZQY .Select_expandButton__UTwlR{margin-left:-34px}.Select_size-s__qBK9t .Select_expandButton__UTwlR{margin-left:-37px}.Select_size-m__jp7n- .Select_expandButton__UTwlR{margin-left:-40px}.Select_size-l__b4EEy .Select_expandButton__UTwlR{margin-left:-46px}.Select_size-xl__0OerX .Select_expandButton__UTwlR{margin-left:-52px}.Select_expandIcon__gWAIB{backface-visibility:hidden;transition:transform .1s ease-out}.Select_isExpanded__rG8R1 .Select_expandIcon__gWAIB{transform:rotate(90deg) translateZ(0)}.Select_expandButton__UTwlR:hover .Select_expandIcon__gWAIB{color:var(--primary-color)}.Select_chip__FRK2y{margin-left:-.4em}.Select_chipsContainer__JruCi{overflow-y:auto;padding:4px 0}.Select_size-xs__2lZQY .Select_chipsContainer__JruCi{max-height:90px}.Select_size-s__qBK9t .Select_chipsContainer__JruCi{max-height:108px}.Select_size-m__jp7n- .Select_chipsContainer__JruCi{max-height:180px}.Select_size-l__b4EEy .Select_chipsContainer__JruCi{max-height:220px}.Select_size-xl__0OerX .Select_chipsContainer__JruCi{max-height:260px}.Select_chipContainerInner__cYHSk{display:flex;flex-wrap:wrap;gap:4px}.Select_chip__FRK2y{margin:0}@keyframes Select_fadeIn__QpAwZ{0%{opacity:0}10%{opacity:0}to{opacity:1}}";
|
|
2
|
-
var S = {"root":"Select_root__mjOjv","disabled":"Select_disabled__AlOQi","additionalLabel":"Select_additionalLabel__K0--Z","trigger":"Select_trigger__OH48f","triggerArrow":"Select_triggerArrow__1LEop","isOpen":"Select_isOpen__WlMUH","variant-clear":"Select_variant-clear__3Htb5","triggerButton":"Select_triggerButton__lErtt","hasTriggerArrow":"Select_hasTriggerArrow__vPLad","isError":"Select_isError__WJJLq","triggerButtonLabel":"Select_triggerButtonLabel__XXLzh","hasSelected":"Select_hasSelected__zQhBV","presetPanel":"Select_presetPanel__Yu94r","presetButton":"Select_presetButton__BAl0q","options":"Select_options__3C0-v","option":"Select_option__iJkfJ","isTree":"Select_isTree__SiTaD","size-xs":"Select_size-xs__2lZQY","size-s":"Select_size-s__qBK9t","size-m":"Select_size-m__jp7n-","size-l":"Select_size-l__b4EEy","size-xl":"Select_size-xl__0OerX","isGroup":"Select_isGroup__aP1lY","isExpanded":"Select_isExpanded__rG8R1","level-0":"Select_level-0__vu03A","level-1":"Select_level-1__ozH2U","level-2":"Select_level-2__XDqeh","level-3":"Select_level-3__Bc9XS","level-4":"Select_level-4__KfQcQ","level-5":"Select_level-5__DGSDM","level-6":"Select_level-6__p688A","isSelected":"Select_isSelected__n3ZeN","isIndeterminate":"Select_isIndeterminate__dy-xV","isFocused":"Select_isFocused__oZSgY","expandButton":"Select_expandButton__UTwlR","expandIcon":"Select_expandIcon__gWAIB","chip":"Select_chip__FRK2y","chipsContainer":"Select_chipsContainer__JruCi","chipContainerInner":"Select_chipContainerInner__cYHSk","fadeIn":"Select_fadeIn__QpAwZ"};
|
|
1
|
+
var css_248z = ".Select_root__mjOjv{max-height:200px;max-width:100%;position:relative}.Select_root__mjOjv.Select_disabled__AlOQi{opacity:.4;pointer-events:none}.Select_additionalLabel__K0--Z{flex-grow:1;overflow:hidden;text-align:left;text-overflow:ellipsis}.Select_trigger__OH48f{position:relative;z-index:1}.Select_triggerArrow__1LEop{flex-shrink:0;margin-left:.3em;margin-right:.7em;opacity:.3;transition:.2s ease-out;transition-property:opacity,transform}.Select_root__mjOjv:hover .Select_triggerArrow__1LEop{opacity:1}.Select_triggerArrow__1LEop.Select_isOpen__WlMUH{transform:rotateX(-180deg)}.Select_disabled__AlOQi .Select_triggerArrow__1LEop{color:var(--text3-color)}.Select_variant-clear__3Htb5 .Select_triggerButton__lErtt{background-color:transparent}.Select_triggerButton__lErtt{justify-content:space-between;text-align:left;width:100%}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad{padding-right:0}.Select_triggerButton__lErtt.Select_hasTriggerArrow__vPLad>span{max-width:calc(100% - 22px)}.Select_triggerButton__lErtt.Select_isError__WJJLq{box-shadow:inset 0 0 0 2px var(--danger-color)}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh{line-height:1.2em;opacity:0;overflow:hidden;text-overflow:ellipsis}.Select_triggerButton__lErtt .Select_triggerButtonLabel__XXLzh.Select_hasSelected__zQhBV{opacity:1}.Select_presetPanel__Yu94r{box-shadow:inset 0 -1px 0 var(--decent-color-alpha-100);display:flex;padding:5px}.Select_presetButton__BAl0q{flex-grow:1;justify-content:center}.Select_presetButton__BAl0q+.Select_presetButton__BAl0q{margin-left:8px}.Select_options__3C0-v{max-height:200px;overflow-y:auto}.keyboard .Select_options__3C0-v{pointer-events:none}.Select_option__iJkfJ{align-items:center;cursor:pointer;display:flex;overflow:hidden;padding-bottom:0!important;padding-top:0!important;position:relative;text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}.Select_isTree__SiTaD .Select_option__iJkfJ{min-height:36px}.Select_size-xs__2lZQY .Select_option__iJkfJ{border-radius:6px;font-size:14px;height:22px;padding:0 8px}.Select_size-s__qBK9t .Select_option__iJkfJ{border-radius:6px;font-size:16px;height:26px;padding:0 12px}.Select_size-m__jp7n- .Select_option__iJkfJ{border-radius:9px;font-size:18px;height:34px;padding:0 16px}.Select_size-l__b4EEy .Select_option__iJkfJ{border-radius:12px;font-size:22px;height:42px;padding:0 20px}.Select_size-xl__0OerX .Select_option__iJkfJ{border-radius:15px;font-size:26px;height:50px;padding:0 24px}.Select_isTree__SiTaD .Select_option__iJkfJ{padding-left:30px}.Select_option__iJkfJ.Select_isGroup__aP1lY{color:var(--accent-color);font-weight:500;pointer-events:none}.Select_isExpanded__rG8R1>.Select_option__iJkfJ{display:flex}.Select_option__iJkfJ>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Select_option__iJkfJ:before{content:\"\";display:inline-block}.Select_option__iJkfJ.Select_level-0__vu03A:before{content:none}.Select_option__iJkfJ.Select_level-1__ozH2U:before{min-width:24px;width:24px}.Select_option__iJkfJ.Select_level-2__XDqeh:before{min-width:48px;width:48px}.Select_option__iJkfJ.Select_level-3__Bc9XS:before{min-width:72px;width:72px}.Select_option__iJkfJ.Select_level-4__KfQcQ:before{min-width:96px;width:96px}.Select_option__iJkfJ.Select_level-5__DGSDM:before{min-width:120px;width:120px}.Select_option__iJkfJ.Select_level-6__p688A:before{min-width:144px;width:144px}.Select_option__iJkfJ.Select_isIndeterminate__dy-xV,.Select_option__iJkfJ.Select_isSelected__n3ZeN{background-color:var(--active-color-alpha-500)}.keyboard .Select_option__iJkfJ.Select_isFocused__oZSgY,.pointer .Select_option__iJkfJ:hover{box-shadow:inset 100vw 0 0 0 var(--accent-color-alpha-200)}.Select_expandButton__UTwlR{background-color:transparent!important;display:flex;height:100%;justify-content:flex-end;overflow:visible;padding:0;position:relative;width:30px}.Select_expandButton__UTwlR:before{content:\"\";display:block;height:calc(100% + 20px);position:absolute;right:0;top:-10;width:100px}.Select_size-xs__2lZQY .Select_expandButton__UTwlR{margin-left:-34px}.Select_size-s__qBK9t .Select_expandButton__UTwlR{margin-left:-37px}.Select_size-m__jp7n- .Select_expandButton__UTwlR{margin-left:-40px}.Select_size-l__b4EEy .Select_expandButton__UTwlR{margin-left:-46px}.Select_size-xl__0OerX .Select_expandButton__UTwlR{margin-left:-52px}.Select_expandIcon__gWAIB{backface-visibility:hidden;transition:transform .1s ease-out}.Select_isExpanded__rG8R1 .Select_expandIcon__gWAIB{transform:rotate(90deg) translateZ(0)}.Select_expandButton__UTwlR:hover .Select_expandIcon__gWAIB{color:var(--primary-color)}.Select_chip__FRK2y{margin-left:-.4em}.Select_chipsContainer__JruCi{overflow-y:auto;padding:4px 0}.Select_size-xs__2lZQY .Select_chipsContainer__JruCi{max-height:90px}.Select_size-s__qBK9t .Select_chipsContainer__JruCi{max-height:108px}.Select_size-m__jp7n- .Select_chipsContainer__JruCi{max-height:180px}.Select_size-l__b4EEy .Select_chipsContainer__JruCi{max-height:220px}.Select_size-xl__0OerX .Select_chipsContainer__JruCi{max-height:260px}.Select_chipContainerInner__cYHSk{display:flex;flex-wrap:wrap;gap:4px}.Select_chip__FRK2y{margin:0}.Select_inline__nJFrE{background-color:var(--decent-color);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50);box-shadow:inset 0 0 0 2px none;display:flex;flex-direction:column;gap:var(--p-1);max-height:none;overflow:hidden;padding:var(--p-1)}.Select_inline__nJFrE.Select_blur__qqWoS{backdrop-filter:blur(50px);background-color:var(--decent-color-alpha-500)}.Select_inline__nJFrE.Select_isError__WJJLq{box-shadow:inset 0 0 0 2px var(--danger-color)}.Select_inline__nJFrE.Select_size-xs__2lZQY{border-radius:8.4px}.Select_inline__nJFrE.Select_size-xs__2lZQY.Select_round__Iv2dd{border-radius:12px}.Select_inline__nJFrE.Select_size-s__qBK9t{border-radius:8.4px}.Select_inline__nJFrE.Select_size-s__qBK9t.Select_round__Iv2dd{border-radius:16px}.Select_inline__nJFrE.Select_size-m__jp7n-{border-radius:12.6px}.Select_inline__nJFrE.Select_size-m__jp7n-.Select_round__Iv2dd{border-radius:20px}.Select_inline__nJFrE.Select_size-l__b4EEy{border-radius:16.8px}.Select_inline__nJFrE.Select_size-l__b4EEy.Select_round__Iv2dd{border-radius:24px}.Select_inline__nJFrE.Select_size-xl__0OerX{border-radius:21px}.Select_inline__nJFrE.Select_size-xl__0OerX.Select_round__Iv2dd{border-radius:28px}.Select_inlineSearch__ZDBbK{flex:none;position:relative;z-index:1}.Select_inline__nJFrE.Select_size-xs__2lZQY .Select_option__iJkfJ{padding-left:calc(8px - var(--p-1))!important;padding-right:calc(8px - var(--p-1))!important}.Select_inline__nJFrE.Select_size-s__qBK9t .Select_option__iJkfJ{padding-left:calc(12px - var(--p-1))!important;padding-right:calc(12px - var(--p-1))!important}.Select_inline__nJFrE.Select_size-m__jp7n- .Select_option__iJkfJ{padding-left:calc(16px - var(--p-1))!important;padding-right:calc(16px - var(--p-1))!important}.Select_inline__nJFrE.Select_size-l__b4EEy .Select_option__iJkfJ{padding-left:calc(20px - var(--p-1))!important;padding-right:calc(20px - var(--p-1))!important}.Select_inline__nJFrE.Select_size-xl__0OerX .Select_option__iJkfJ{padding-left:calc(24px - var(--p-1))!important;padding-right:calc(24px - var(--p-1))!important}.Select_inlineChips__no6i2{flex:none}.Select_inlineList__61-N3{flex:1 1 auto;min-height:0}.Select_inlineOptions__-WNbz{max-height:320px}.keyboard .Select_inlineOptions__-WNbz{pointer-events:auto}.Select_options__3C0-v{--select-inset:0px}.Select_options__3C0-v.Select_inlineOptions__-WNbz{--select-inset:var(--p-1)}.Select_options__3C0-v.Select_size-xs__2lZQY{--select-row-radius:6px;--select-box-radius:8.4px}.Select_options__3C0-v.Select_size-xs__2lZQY.Select_round__Iv2dd{--select-box-radius:12px}.Select_options__3C0-v.Select_size-s__qBK9t{--select-row-radius:6px;--select-box-radius:8.4px}.Select_options__3C0-v.Select_size-s__qBK9t.Select_round__Iv2dd{--select-box-radius:16px}.Select_options__3C0-v.Select_size-m__jp7n-{--select-row-radius:9px;--select-box-radius:12.6px}.Select_options__3C0-v.Select_size-m__jp7n-.Select_round__Iv2dd{--select-box-radius:20px}.Select_options__3C0-v.Select_size-l__b4EEy{--select-row-radius:12px;--select-box-radius:16.8px}.Select_options__3C0-v.Select_size-l__b4EEy.Select_round__Iv2dd{--select-box-radius:24px}.Select_options__3C0-v.Select_size-xl__0OerX{--select-row-radius:15px;--select-box-radius:21px}.Select_options__3C0-v.Select_size-xl__0OerX.Select_round__Iv2dd{--select-box-radius:28px}.Select_options__3C0-v.Select_round__Iv2dd.Select_flushTop__h7nnL .Select_option__iJkfJ:first-child{border-top-left-radius:max(var(--select-row-radius),calc(var(--select-box-radius) - var(--select-inset)));border-top-right-radius:max(var(--select-row-radius),calc(var(--select-box-radius) - var(--select-inset)))}.Select_options__3C0-v.Select_round__Iv2dd .Select_option__iJkfJ:last-child{border-bottom-left-radius:max(var(--select-row-radius),calc(var(--select-box-radius) - var(--select-inset)));border-bottom-right-radius:max(var(--select-row-radius),calc(var(--select-box-radius) - var(--select-inset)))}@keyframes Select_fadeIn__QpAwZ{0%{opacity:0}10%{opacity:0}to{opacity:1}}";
|
|
2
|
+
var S = {"root":"Select_root__mjOjv","disabled":"Select_disabled__AlOQi","additionalLabel":"Select_additionalLabel__K0--Z","trigger":"Select_trigger__OH48f","triggerArrow":"Select_triggerArrow__1LEop","isOpen":"Select_isOpen__WlMUH","variant-clear":"Select_variant-clear__3Htb5","triggerButton":"Select_triggerButton__lErtt","hasTriggerArrow":"Select_hasTriggerArrow__vPLad","isError":"Select_isError__WJJLq","triggerButtonLabel":"Select_triggerButtonLabel__XXLzh","hasSelected":"Select_hasSelected__zQhBV","presetPanel":"Select_presetPanel__Yu94r","presetButton":"Select_presetButton__BAl0q","options":"Select_options__3C0-v","option":"Select_option__iJkfJ","isTree":"Select_isTree__SiTaD","size-xs":"Select_size-xs__2lZQY","size-s":"Select_size-s__qBK9t","size-m":"Select_size-m__jp7n-","size-l":"Select_size-l__b4EEy","size-xl":"Select_size-xl__0OerX","isGroup":"Select_isGroup__aP1lY","isExpanded":"Select_isExpanded__rG8R1","level-0":"Select_level-0__vu03A","level-1":"Select_level-1__ozH2U","level-2":"Select_level-2__XDqeh","level-3":"Select_level-3__Bc9XS","level-4":"Select_level-4__KfQcQ","level-5":"Select_level-5__DGSDM","level-6":"Select_level-6__p688A","isSelected":"Select_isSelected__n3ZeN","isIndeterminate":"Select_isIndeterminate__dy-xV","isFocused":"Select_isFocused__oZSgY","expandButton":"Select_expandButton__UTwlR","expandIcon":"Select_expandIcon__gWAIB","chip":"Select_chip__FRK2y","chipsContainer":"Select_chipsContainer__JruCi","chipContainerInner":"Select_chipContainerInner__cYHSk","inline":"Select_inline__nJFrE","blur":"Select_blur__qqWoS","round":"Select_round__Iv2dd","inlineSearch":"Select_inlineSearch__ZDBbK","inlineChips":"Select_inlineChips__no6i2","inlineList":"Select_inlineList__61-N3","inlineOptions":"Select_inlineOptions__-WNbz","flushTop":"Select_flushTop__h7nnL","fadeIn":"Select_fadeIn__QpAwZ"};
|
|
3
3
|
if (typeof document !== 'undefined') {
|
|
4
4
|
var __uilibHead = document.head || document.getElementsByTagName('head')[0];
|
|
5
5
|
if (__uilibHead) {
|
|
@@ -23,7 +23,7 @@ import S from './Select.styl.js';
|
|
|
23
23
|
const BLUR_CLOSE_DELAY = 60;
|
|
24
24
|
const POINTER_PRESS_TTL = 100;
|
|
25
25
|
function Select2(props) {
|
|
26
|
-
const { className, value, onChange, onChipClick, onSearchChange, disableTriggerArrow, inputProps, popupProps, scrollProps, size = 'm', round, optionsClassName, optionClassName, selectedChipClassName, additionalOptions = [], options = [], variant, isSearchable, label, additionalLabel, error, blur, disabled, trigger, required, hideRequiredStar, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, selectedChipRemoveTooltip, selectedChipIds, onOpen, onClose, onFocus, onBlur, } = props;
|
|
26
|
+
const { className, value, onChange, onChipClick, onSearchChange, disableTriggerArrow, inputProps, popupProps, scrollProps, size = 'm', round, optionsClassName, optionClassName, selectedChipClassName, additionalOptions = [], options = [], variant, isSearchable, label, additionalLabel, error, blur, disabled, trigger, required, hideRequiredStar, presets = [], selectAllButton, clearButton, showSelectedCount, disableLabel, selectedChipRemoveTooltip, selectedChipIds, onOpen, onClose, onFocus, onBlur, inline, } = props;
|
|
27
27
|
const isMultiple$1 = isMultiple(value);
|
|
28
28
|
const closeOnSelect = props.closeOnSelect ?? !isMultiple$1;
|
|
29
29
|
const instanceId = useRef(generateUID());
|
|
@@ -36,6 +36,8 @@ function Select2(props) {
|
|
|
36
36
|
const [labelClipPath, setLabelClipPath] = useState('');
|
|
37
37
|
const [isSearching, setIsSearching] = useState(false);
|
|
38
38
|
const [innerSearchVal, setInnerSearchVal] = useState('');
|
|
39
|
+
/** Inline: keyboard navigation works while focus is inside the list. */
|
|
40
|
+
const [inlineFocused, setInlineFocused] = useState(false);
|
|
39
41
|
const searchVal = props.searchValue ?? innerSearchVal;
|
|
40
42
|
const searchQuery = isSearching ? searchVal : '';
|
|
41
43
|
const { selectedIds, setSelectedIds } = useSelectedIds(value);
|
|
@@ -88,9 +90,14 @@ function Select2(props) {
|
|
|
88
90
|
applySelection(ids, ids);
|
|
89
91
|
}
|
|
90
92
|
else {
|
|
93
|
+
// An inline list always shows a pick: pressing the picked row keeps it.
|
|
94
|
+
if (inline && isSelected(id))
|
|
95
|
+
return;
|
|
91
96
|
const nextValue = isSelected(id) ? null : id;
|
|
92
97
|
applySelection(nextValue === null ? [] : [id], nextValue);
|
|
93
98
|
}
|
|
99
|
+
if (inline)
|
|
100
|
+
return;
|
|
94
101
|
resetSearch();
|
|
95
102
|
if (closeOnSelect)
|
|
96
103
|
close();
|
|
@@ -102,7 +109,7 @@ function Select2(props) {
|
|
|
102
109
|
const dropSelected = () => applySelection([], isMultiple$1 ? [] : null);
|
|
103
110
|
const applyPreset = (ids) => applySelection(ids, isMultiple$1 ? ids : (ids[0] ?? null));
|
|
104
111
|
const { focusedId, setFocusedId } = useKeyboardNav({
|
|
105
|
-
isOpen,
|
|
112
|
+
isOpen: inline ? inlineFocused : isOpen,
|
|
106
113
|
navigableOptions,
|
|
107
114
|
selectedIds,
|
|
108
115
|
onSelect: onItemToggle,
|
|
@@ -133,7 +140,8 @@ function Select2(props) {
|
|
|
133
140
|
setIsSearching(true);
|
|
134
141
|
setInnerSearchVal(val);
|
|
135
142
|
onSearchChange?.(val);
|
|
136
|
-
|
|
143
|
+
if (!inline)
|
|
144
|
+
openIfEnabled();
|
|
137
145
|
};
|
|
138
146
|
const handleFocus = e => {
|
|
139
147
|
window.clearTimeout(blurTimer.current);
|
|
@@ -188,7 +196,7 @@ function Select2(props) {
|
|
|
188
196
|
});
|
|
189
197
|
useEvent({
|
|
190
198
|
event: 'click',
|
|
191
|
-
isActive: isOpen,
|
|
199
|
+
isActive: isOpen && !inline,
|
|
192
200
|
callback: e => {
|
|
193
201
|
// The click concluding a press that started inside must not count as an
|
|
194
202
|
// outside click: the portalled popup can mount under the cursor, which
|
|
@@ -200,9 +208,25 @@ function Select2(props) {
|
|
|
200
208
|
},
|
|
201
209
|
});
|
|
202
210
|
useEffect(() => {
|
|
203
|
-
if (!isOpen)
|
|
211
|
+
if (!isOpen && !inline)
|
|
204
212
|
resetSearch();
|
|
205
213
|
}, [isOpen]);
|
|
214
|
+
// Inline: on mount the selected option is scrolled into the middle of the list.
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
if (!inline)
|
|
217
|
+
return;
|
|
218
|
+
const frame = requestAnimationFrame(() => {
|
|
219
|
+
const list = scrollInnerRef.current;
|
|
220
|
+
const selected = list?.querySelector(`.${S.isSelected}`);
|
|
221
|
+
if (!list || !selected)
|
|
222
|
+
return;
|
|
223
|
+
const listRect = list.getBoundingClientRect();
|
|
224
|
+
const rect = selected.getBoundingClientRect();
|
|
225
|
+
const offset = rect.top - listRect.top + list.scrollTop;
|
|
226
|
+
list.scrollTop = Math.max(0, offset - (list.clientHeight - rect.height) / 2);
|
|
227
|
+
});
|
|
228
|
+
return () => cancelAnimationFrame(frame);
|
|
229
|
+
}, [inline]);
|
|
206
230
|
useEffect(() => {
|
|
207
231
|
if (props.searchValue === undefined)
|
|
208
232
|
return;
|
|
@@ -302,8 +326,25 @@ function Select2(props) {
|
|
|
302
326
|
optionProps.ref = onFocusedElemRef;
|
|
303
327
|
return (jsx("div", { ...optionProps, children: renderLabel(item) }, id));
|
|
304
328
|
};
|
|
305
|
-
const
|
|
329
|
+
const hasPresetPanel = presets.length > 0 || Boolean(selectAllButton) || Boolean(clearButton);
|
|
330
|
+
const optionsList = (jsxs("div", { ref: contentRef, "data-select-id": instanceId.current, children: [renderPresets(), createElement(Scroll, { y: true, ...scrollProps, offset: { y: { before: 10, after: 10 } }, className: cn(S.options, S[`size-${size}`], round && S.round,
|
|
331
|
+
// The first row touches the box top unless the preset buttons are above it.
|
|
332
|
+
!hasPresetPanel && S.flushTop, optionsClassName, scrollProps?.className), onInnerRef: onScrollInnerRef, key: "items-scroll" }, visibleOptions.map(item => renderOption(item)))] }));
|
|
306
333
|
const classes = cn(S.root, className, S[`size-${size}`], variant === 'clear' && S['variant-clear']);
|
|
334
|
+
if (inline) {
|
|
335
|
+
const onInlineBlur = e => {
|
|
336
|
+
onBlur?.(e);
|
|
337
|
+
if (!e.currentTarget.contains(e.relatedTarget))
|
|
338
|
+
setInlineFocused(false);
|
|
339
|
+
};
|
|
340
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: cn(classes, S.inline, round && S.round, blur && S.blur, disabled && S.disabled, isErrorVisible && S.isError), "data-select-id": instanceId.current, tabIndex: isSearchable ? -1 : 0, onFocus: e => {
|
|
341
|
+
setInlineFocused(true);
|
|
342
|
+
handleFocus(e);
|
|
343
|
+
}, onBlur: onInlineBlur, children: [isSearchable && (jsx("div", { className: S.inlineSearch, children: jsx(Input, { size: size, round: round, variant: "clean", ...inputProps, value: searchVal, onChange: handleSearchChange,
|
|
344
|
+
// A floating label would be cut by the box: it is the placeholder here.
|
|
345
|
+
placeholder: inputProps?.placeholder ??
|
|
346
|
+
(hideFieldLabel ? undefined : getFieldLabel(label)) }) })), hasChips && (jsx("div", { className: cn(S.chipContainerInner, S.inlineChips), children: renderSelectedChips() })), renderPresets(), jsx("div", { ref: contentRef, className: S.inlineList, children: jsx(Scroll, { y: true, ...scrollProps, offset: { y: { before: 6, after: 6 } }, className: cn(S.options, S.inlineOptions, S[`size-${size}`], round && S.round, !isSearchable && !hasChips && !hasPresetPanel && S.flushTop, optionsClassName, scrollProps?.className), onInnerRef: onScrollInnerRef, children: visibleOptions.map(item => renderOption(item)) }) })] }), isErrorVisible && (jsx(AssistiveText, { variant: "danger", size: size, children: error }))] }));
|
|
347
|
+
}
|
|
307
348
|
return (jsxs(Fragment, { children: [jsx(Popup, { className: classes, direction: "bottom", size: size, focusControl: true, blur: blur, round: round, disabled: disabled, ...popupProps, isOpen: isOpen, onOpen: openIfEnabled, onClose: close, trigger: renderTrigger(), triggerProps: {
|
|
308
349
|
'data-select-id': instanceId.current,
|
|
309
350
|
onFocus: handleFocus,
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import { Button } from '../Button/Button.js';
|
|
5
|
+
import Dots from '../Gallery/Dots/Dots.js';
|
|
6
|
+
import S from './Stepper.styl.js';
|
|
7
|
+
|
|
8
|
+
function indexOf(steps, id) {
|
|
9
|
+
const i = steps.findIndex(s => s.id === id);
|
|
10
|
+
return i < 0 ? 0 : i;
|
|
11
|
+
}
|
|
12
|
+
function textOf(node) {
|
|
13
|
+
return typeof node === 'string' || typeof node === 'number'
|
|
14
|
+
? String(node)
|
|
15
|
+
: '';
|
|
16
|
+
}
|
|
17
|
+
function Stepper({ steps, activeId, defaultActiveId, onChange, size = 'm', prevLabel = 'Prev', nextLabel = 'Next', prevButtonProps, nextButtonProps, renderPrevButton, renderNextButton, showDots = true, dotsClickable = true, renderAll = false, animation = true, className, headerClassName, contentClassName, footerClassName, }) {
|
|
18
|
+
const controlled = activeId !== undefined;
|
|
19
|
+
const [ownId, setOwnId] = useState(() => defaultActiveId ?? steps[0]?.id);
|
|
20
|
+
const currentId = controlled ? activeId : ownId;
|
|
21
|
+
const index = indexOf(steps, currentId);
|
|
22
|
+
const step = steps[index];
|
|
23
|
+
const count = steps.length;
|
|
24
|
+
// The direction of the last move, for the slide.
|
|
25
|
+
const prevIndex = useRef(index);
|
|
26
|
+
const [dir, setDir] = useState(null);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (index !== prevIndex.current) {
|
|
29
|
+
setDir(index > prevIndex.current ? 'forward' : 'back');
|
|
30
|
+
prevIndex.current = index;
|
|
31
|
+
}
|
|
32
|
+
}, [index]);
|
|
33
|
+
// A step that went away (steps changed): fall back to the nearest one.
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!controlled && step && step.id !== ownId)
|
|
36
|
+
setOwnId(step.id);
|
|
37
|
+
}, [controlled, step?.id, ownId]);
|
|
38
|
+
if (!step)
|
|
39
|
+
return null;
|
|
40
|
+
const go = (i) => {
|
|
41
|
+
const target = steps[Math.max(0, Math.min(count - 1, i))];
|
|
42
|
+
if (!target || target.id === step.id)
|
|
43
|
+
return;
|
|
44
|
+
if (!controlled)
|
|
45
|
+
setOwnId(target.id);
|
|
46
|
+
onChange?.(target.id, steps.indexOf(target));
|
|
47
|
+
};
|
|
48
|
+
const api = {
|
|
49
|
+
index,
|
|
50
|
+
count,
|
|
51
|
+
step,
|
|
52
|
+
isFirst: index === 0,
|
|
53
|
+
isLast: index === count - 1,
|
|
54
|
+
prev: () => go(index - 1),
|
|
55
|
+
next: () => go(index + 1),
|
|
56
|
+
go,
|
|
57
|
+
};
|
|
58
|
+
const button = (kind) => {
|
|
59
|
+
const own = step[kind];
|
|
60
|
+
const common = kind === 'prev' ? prevButtonProps : nextButtonProps;
|
|
61
|
+
if (own === false || (own === undefined && common === false)) {
|
|
62
|
+
return jsx("span", { className: S.placeholder });
|
|
63
|
+
}
|
|
64
|
+
const props = { ...(common || {}), ...(own || {}) };
|
|
65
|
+
const { onClick, children, ...rest } = props;
|
|
66
|
+
const isPrev = kind === 'prev';
|
|
67
|
+
// Nowhere to go and nothing else to do.
|
|
68
|
+
const stuck = isPrev ? api.isFirst : api.isLast && !onClick;
|
|
69
|
+
if (isPrev && api.isFirst && !onClick) {
|
|
70
|
+
return jsx("span", { className: S.placeholder });
|
|
71
|
+
}
|
|
72
|
+
return (jsx(Button, { round: true, size: size, variant: isPrev ? 'clear' : 'primary', disabled: stuck, ...rest, onClick: (e) => {
|
|
73
|
+
if (onClick?.(e) === false || e.defaultPrevented)
|
|
74
|
+
return;
|
|
75
|
+
if (isPrev)
|
|
76
|
+
api.prev();
|
|
77
|
+
else
|
|
78
|
+
api.next();
|
|
79
|
+
}, children: children ?? (isPrev ? prevLabel : nextLabel) }));
|
|
80
|
+
};
|
|
81
|
+
const renderContent = (s) => typeof s.content === 'function'
|
|
82
|
+
? s.content(s === step ? api : { ...api, step: s })
|
|
83
|
+
: s.content;
|
|
84
|
+
const renderStep = (s, active) => (jsxs("div", { className: cn(S.step, active && animation && dir && S[dir], !active && S.hidden), "aria-hidden": !active || undefined, children: [(s.title || s.description) && (jsxs("div", { className: cn(S.header, headerClassName), children: [s.title && jsx("div", { className: S.title, children: s.title }), s.description && (jsx("div", { className: S.description, children: s.description }))] })), jsx("div", { className: cn(S.content, contentClassName), children: renderContent(s) })] }, s.id));
|
|
85
|
+
return (jsxs("div", { className: cn(S.root, S[`size-${size}`], className), children: [jsx("div", { className: S.body, children: steps.map(s => s === step || renderAll || s.forceRender
|
|
86
|
+
? renderStep(s, s === step)
|
|
87
|
+
: null) }), jsxs("div", { className: cn(S.footer, footerClassName), children: [jsx("div", { className: S.prev, children: renderPrevButton
|
|
88
|
+
? renderPrevButton(api, button('prev'))
|
|
89
|
+
: button('prev') }), showDots && count > 1 && (jsx(Dots, { index: index, count: count, className: S.dots, onSelect: dotsClickable ? go : undefined, getLabel: i => textOf(steps[i].title) || String(i + 1) })), jsx("div", { className: S.next, children: renderNextButton
|
|
90
|
+
? renderNextButton(api, button('next'))
|
|
91
|
+
: button('next') })] })] }));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { Stepper };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var css_248z = ".Stepper_root__WET-9{display:flex;flex-direction:column;gap:16px;min-width:0}.Stepper_body__ZRBXe{min-width:0;position:relative}.Stepper_step__e-4NN{display:flex;flex-direction:column;gap:16px;min-width:0}.Stepper_step__e-4NN.Stepper_hidden__ReHDU{display:none}.Stepper_step__e-4NN.Stepper_forward__SY8S2{animation:Stepper_stepFromRight__sFstu .22s ease-out}.Stepper_step__e-4NN.Stepper_back__ko4wh{animation:Stepper_stepFromLeft__AEIpv .22s ease-out}.Stepper_header__Hs5N2{display:flex;flex-direction:column;gap:4px}.Stepper_title__N8esM{font-size:1.4em;font-weight:600;line-height:1.2}.Stepper_description__ng-1A{line-height:1.4;opacity:.6}.Stepper_content__CTnZW{display:flex;flex-direction:column;gap:12px;min-width:0}.Stepper_footer__54ZR5{grid-gap:12px;align-items:center;display:grid;gap:12px;grid-template-columns:1fr auto 1fr}.Stepper_next__MTBhU,.Stepper_prev__eA85V{align-items:center;display:flex;gap:8px;min-width:0}.Stepper_prev__eA85V{grid-column:1;justify-self:start}.Stepper_next__MTBhU{grid-column:3;justify-self:end}.Stepper_placeholder__rpIAG{display:block}.Stepper_dots__cwSqS{grid-column:2;-webkit-mask-image:none;mask-image:none;padding:0;position:static;width:auto}.Stepper_size-s__MZtOL .Stepper_title__N8esM{font-size:1.15em}.Stepper_size-l__IP2y8 .Stepper_title__N8esM{font-size:1.7em}@media (prefers-reduced-motion:reduce){.Stepper_step__e-4NN{animation:none!important}}@keyframes Stepper_stepFromRight__sFstu{0%{opacity:0;transform:translateX(24px)}to{opacity:1;transform:none}}@keyframes Stepper_stepFromLeft__AEIpv{0%{opacity:0;transform:translateX(-24px)}to{opacity:1;transform:none}}";
|
|
2
|
+
var S = {"root":"Stepper_root__WET-9","body":"Stepper_body__ZRBXe","step":"Stepper_step__e-4NN","hidden":"Stepper_hidden__ReHDU","forward":"Stepper_forward__SY8S2","stepFromRight":"Stepper_stepFromRight__sFstu","back":"Stepper_back__ko4wh","stepFromLeft":"Stepper_stepFromLeft__AEIpv","header":"Stepper_header__Hs5N2","title":"Stepper_title__N8esM","description":"Stepper_description__ng-1A","content":"Stepper_content__CTnZW","footer":"Stepper_footer__54ZR5","prev":"Stepper_prev__eA85V","next":"Stepper_next__MTBhU","placeholder":"Stepper_placeholder__rpIAG","dots":"Stepper_dots__cwSqS","size-s":"Stepper_size-s__MZtOL","size-l":"Stepper_size-l__IP2y8"};
|
|
3
|
+
if (typeof document !== 'undefined') {
|
|
4
|
+
var __uilibHead = document.head || document.getElementsByTagName('head')[0];
|
|
5
|
+
if (__uilibHead) {
|
|
6
|
+
var __uilibStyle = document.createElement('style');
|
|
7
|
+
__uilibStyle.setAttribute('data-uilib-css', '');
|
|
8
|
+
__uilibStyle.appendChild(document.createTextNode(css_248z));
|
|
9
|
+
var __uilibLink = __uilibHead.querySelector('link[rel="stylesheet"]');
|
|
10
|
+
var __uilibInline = __uilibHead.querySelector('style:not([data-uilib-css])');
|
|
11
|
+
var __uilibAnchor = __uilibLink || __uilibInline;
|
|
12
|
+
if (__uilibLink && __uilibInline && (__uilibLink.compareDocumentPosition(__uilibInline) & 4) === 0) {
|
|
13
|
+
__uilibAnchor = __uilibInline;
|
|
14
|
+
}
|
|
15
|
+
if (__uilibAnchor) __uilibHead.insertBefore(__uilibStyle, __uilibAnchor);
|
|
16
|
+
else __uilibHead.appendChild(__uilibStyle);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { S as default };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
index:
|
|
3
|
-
count:
|
|
4
|
-
|
|
1
|
+
type Props = {
|
|
2
|
+
index: number;
|
|
3
|
+
count: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
onSelect?: (index: number) => void;
|
|
6
|
+
getLabel?: (index: number) => string;
|
|
7
|
+
};
|
|
8
|
+
export default function Dots({ index, count, className, onSelect, getLabel, }: Props): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as T from './Stepper.types';
|
|
2
|
+
export type { Step as StepperStep, StepButton as StepperButton, StepperApi, Props as StepperProps, } from './Stepper.types';
|
|
3
|
+
export declare function Stepper({ steps, activeId, defaultActiveId, onChange, size, prevLabel, nextLabel, prevButtonProps, nextButtonProps, renderPrevButton, renderNextButton, showDots, dotsClickable, renderAll, animation, className, headerClassName, contentClassName, footerClassName, }: T.Props): import("react").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Props as ButtonProps } from '../Button/Button.types';
|
|
3
|
+
import { Size } from 'uilib/types';
|
|
4
|
+
type ID = string | number;
|
|
5
|
+
export type StepButton = false | (Omit<Partial<ButtonProps>, 'onClick'> & {
|
|
6
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => boolean | void;
|
|
7
|
+
[data: `data-${string}`]: string | undefined;
|
|
8
|
+
});
|
|
9
|
+
export type StepperApi = {
|
|
10
|
+
index: number;
|
|
11
|
+
count: number;
|
|
12
|
+
step: Step;
|
|
13
|
+
isFirst: boolean;
|
|
14
|
+
isLast: boolean;
|
|
15
|
+
prev: () => void;
|
|
16
|
+
next: () => void;
|
|
17
|
+
go: (index: number) => void;
|
|
18
|
+
};
|
|
19
|
+
export type Step = {
|
|
20
|
+
id: ID;
|
|
21
|
+
title?: ReactNode;
|
|
22
|
+
description?: ReactNode;
|
|
23
|
+
content?: ReactNode | ((api: StepperApi) => ReactNode);
|
|
24
|
+
forceRender?: boolean;
|
|
25
|
+
prev?: StepButton;
|
|
26
|
+
next?: StepButton;
|
|
27
|
+
};
|
|
28
|
+
export type Props = {
|
|
29
|
+
steps: Step[];
|
|
30
|
+
activeId?: ID;
|
|
31
|
+
defaultActiveId?: ID;
|
|
32
|
+
onChange?: (id: ID, index: number) => void;
|
|
33
|
+
size?: Size;
|
|
34
|
+
prevLabel?: ReactNode;
|
|
35
|
+
nextLabel?: ReactNode;
|
|
36
|
+
prevButtonProps?: StepButton;
|
|
37
|
+
nextButtonProps?: StepButton;
|
|
38
|
+
renderPrevButton?: (api: StepperApi, button: ReactNode) => ReactNode;
|
|
39
|
+
renderNextButton?: (api: StepperApi, button: ReactNode) => ReactNode;
|
|
40
|
+
showDots?: boolean;
|
|
41
|
+
dotsClickable?: boolean;
|
|
42
|
+
renderAll?: boolean;
|
|
43
|
+
animation?: boolean;
|
|
44
|
+
className?: string;
|
|
45
|
+
headerClassName?: string;
|
|
46
|
+
contentClassName?: string;
|
|
47
|
+
footerClassName?: string;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -53,6 +53,7 @@ export * from './Scroll/Scroll';
|
|
|
53
53
|
export * from './Slider/Slider';
|
|
54
54
|
export * from './Shimmer/Shimmer';
|
|
55
55
|
export * from './Spinner/Spinner';
|
|
56
|
+
export * from './Stepper/Stepper';
|
|
56
57
|
export * from './Table/Table';
|
|
57
58
|
export * from './Tabs/Tabs';
|
|
58
59
|
export * from './TextShimmer/TextShimmer';
|