@nimbus-ds/segmented-control 2.0.1 → 2.1.0
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/CHANGELOG.md +12 -0
- package/dist/CHANGELOG.md +12 -0
- package/dist/index.d.ts +38 -16
- package/dist/index.js +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
The SegmentedControl component is a composite component that allows us to select one or more options from a list.
|
|
4
4
|
|
|
5
|
+
## 2026-02-12 `2.1.0`
|
|
6
|
+
|
|
7
|
+
#### 🎉 New features
|
|
8
|
+
|
|
9
|
+
- Enabled `className` prop forwarding to allow consumers to pass custom CSS classes. ([#426](https://github.com/TiendaNube/nimbus-design-system/pull/426) by [@joacotornello](https://github.com/joacotornello))
|
|
10
|
+
|
|
11
|
+
## 2026-01-13 `2.0.2`
|
|
12
|
+
|
|
13
|
+
#### 🎉 New features
|
|
14
|
+
|
|
15
|
+
- Adds support for React 19. ([#404](https://github.com/TiendaNube/nimbus-design-system/pull/404) by [@joacotornello](https://github.com/joacotornello))
|
|
16
|
+
|
|
5
17
|
## 2025-09-11 `2.0.1`
|
|
6
18
|
|
|
7
19
|
#### 🐛 Bug fixes
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
The SegmentedControl component is a composite component that allows us to select one or more options from a list.
|
|
4
4
|
|
|
5
|
+
## 2026-02-12 `2.1.0`
|
|
6
|
+
|
|
7
|
+
#### 🎉 New features
|
|
8
|
+
|
|
9
|
+
- Enabled `className` prop forwarding to allow consumers to pass custom CSS classes. ([#426](https://github.com/TiendaNube/nimbus-design-system/pull/426) by [@joacotornello](https://github.com/joacotornello))
|
|
10
|
+
|
|
11
|
+
## 2026-01-13 `2.0.2`
|
|
12
|
+
|
|
13
|
+
#### 🎉 New features
|
|
14
|
+
|
|
15
|
+
- Adds support for React 19. ([#404](https://github.com/TiendaNube/nimbus-design-system/pull/404) by [@joacotornello](https://github.com/joacotornello))
|
|
16
|
+
|
|
5
17
|
## 2025-09-11 `2.0.1`
|
|
6
18
|
|
|
7
19
|
#### 🐛 Bug fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -22,10 +22,10 @@ export interface PolymorphicForwardRefComponent<IntrinsicElementString, OwnProps
|
|
|
22
22
|
* so that events are typed when using JSX.IntrinsicElements.
|
|
23
23
|
*/
|
|
24
24
|
<As = IntrinsicElementString>(props: As extends "" ? {
|
|
25
|
-
as: keyof JSX.IntrinsicElements;
|
|
25
|
+
as: keyof React.JSX.IntrinsicElements;
|
|
26
26
|
} : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
|
27
27
|
as: As;
|
|
28
|
-
}> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
|
|
28
|
+
}> : As extends keyof React.JSX.IntrinsicElements ? Merge<React.JSX.IntrinsicElements[As], OwnProps & {
|
|
29
29
|
as: As;
|
|
30
30
|
}> : never): React.ReactElement | null;
|
|
31
31
|
}
|
|
@@ -34,6 +34,7 @@ export interface Conditions<T> {
|
|
|
34
34
|
md?: T;
|
|
35
35
|
lg?: T;
|
|
36
36
|
xl?: T;
|
|
37
|
+
xxl?: T;
|
|
37
38
|
}
|
|
38
39
|
export type BorderStyle = "solid" | "none" | "hidden" | "dashed" | "dotted";
|
|
39
40
|
export type BoxSizing = "border-box" | "content-box";
|
|
@@ -50,6 +51,7 @@ export type Position = "absolute" | "fixed" | "relative" | "static" | "sticky";
|
|
|
50
51
|
export type Overflow = "visible" | "hidden" | "scroll" | "auto";
|
|
51
52
|
export type PointerEvents = "auto" | "none" | "visiblePainted" | "visibleFill" | "visibleStroke" | "visible" | "painted" | "fill" | "stroke" | "all" | "inherit";
|
|
52
53
|
export type TransitionTiming = "ease" | "ease-in" | "ease-out" | "ease-in-out" | "linear" | "step-start" | "step-end";
|
|
54
|
+
export type ScrollbarWidth = "auto" | "none" | "thin";
|
|
53
55
|
declare const propertiesBox: {
|
|
54
56
|
gap: {
|
|
55
57
|
none: string;
|
|
@@ -129,6 +131,14 @@ declare const propertiesBox: {
|
|
|
129
131
|
"neutral-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
130
132
|
"neutral-surfaceDisabled": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
131
133
|
"neutral-textLow": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
134
|
+
"neutral-textHigh": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
135
|
+
"ai-generative-surface": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
136
|
+
"ai-generative-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
137
|
+
transparent: string;
|
|
138
|
+
};
|
|
139
|
+
background: {
|
|
140
|
+
"ai-generative-interactive-border": string;
|
|
141
|
+
"ai-generative-interactive": string;
|
|
132
142
|
transparent: string;
|
|
133
143
|
};
|
|
134
144
|
color: {
|
|
@@ -155,6 +165,9 @@ declare const propertiesBox: {
|
|
|
155
165
|
"neutral-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
156
166
|
"neutral-surfaceDisabled": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
157
167
|
"neutral-textLow": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
168
|
+
"neutral-textHigh": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
169
|
+
"ai-generative-surface": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
170
|
+
"ai-generative-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
158
171
|
transparent: string;
|
|
159
172
|
};
|
|
160
173
|
borderColor: {
|
|
@@ -166,7 +179,9 @@ declare const propertiesBox: {
|
|
|
166
179
|
"success-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
167
180
|
"warning-interactive": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
168
181
|
"warning-surface": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
169
|
-
"warning-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
182
|
+
"warning-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`; /**
|
|
183
|
+
* The gridTemplateAreas property specifies named grid areas, establishing the cells in the grid and assigning them names.
|
|
184
|
+
*/
|
|
170
185
|
"danger-interactive": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
171
186
|
"danger-surface": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
172
187
|
"danger-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
@@ -174,13 +189,11 @@ declare const propertiesBox: {
|
|
|
174
189
|
"neutral-surface": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
175
190
|
"neutral-surfaceDisabled": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
176
191
|
"neutral-surfaceHighlight": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
192
|
+
"ai-generative-interactiveHover": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
177
193
|
transparent: string;
|
|
178
194
|
};
|
|
179
195
|
borderRadius: {
|
|
180
|
-
"0-5": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
181
|
-
* The alignItems property sets the align-self value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis.
|
|
182
|
-
* In Grid Layout, it controls the alignment of items on the Block Axis within their grid area.
|
|
183
|
-
*/
|
|
196
|
+
"0-5": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
184
197
|
"1": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
185
198
|
"2": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
186
199
|
"3": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
@@ -188,10 +201,6 @@ declare const propertiesBox: {
|
|
|
188
201
|
"5": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
189
202
|
"6": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
190
203
|
full: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
191
|
-
/**
|
|
192
|
-
* The alignSelf property overrides a grid or flex item's align-items value. In Grid, it aligns the item inside the grid area.
|
|
193
|
-
* In Flexbox, it aligns the item on the cross axis.
|
|
194
|
-
*/
|
|
195
204
|
base: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
196
205
|
half: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
197
206
|
none: string;
|
|
@@ -206,7 +215,9 @@ declare const propertiesBox: {
|
|
|
206
215
|
};
|
|
207
216
|
borderStyle: BorderStyle[];
|
|
208
217
|
boxSizing: BoxSizing[];
|
|
209
|
-
cursor: Cursor[];
|
|
218
|
+
cursor: Cursor[]; /**
|
|
219
|
+
* The padding properties are used to generate space around an box's content area.
|
|
220
|
+
*/
|
|
210
221
|
spacing: {
|
|
211
222
|
none: string;
|
|
212
223
|
"0-5": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
@@ -268,6 +279,7 @@ declare const propertiesBox: {
|
|
|
268
279
|
"4": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
269
280
|
"5": `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
270
281
|
focusRing: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
282
|
+
aiFocus: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
271
283
|
};
|
|
272
284
|
transitionDuration: {
|
|
273
285
|
base: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
@@ -351,10 +363,8 @@ declare const propertiesBox: {
|
|
|
351
363
|
h4: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
352
364
|
h5: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
353
365
|
h6: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
* @default border-box
|
|
357
|
-
*/
|
|
366
|
+
};
|
|
367
|
+
scrollbarWidth: ScrollbarWidth[];
|
|
358
368
|
};
|
|
359
369
|
export type BoxBorderColorProperties = keyof typeof propertiesBox.borderColor;
|
|
360
370
|
export type BoxBorderRadiusProperties = keyof typeof propertiesBox.borderRadius;
|
|
@@ -371,8 +381,10 @@ export type BoxTransitionDurationProperties = keyof typeof propertiesBox.transit
|
|
|
371
381
|
export type BoxFontSizeProperties = keyof typeof propertiesBox.fontSize;
|
|
372
382
|
export type BoxFontWeightProperties = keyof typeof propertiesBox.fontWeight;
|
|
373
383
|
export type BoxLineHeightProperties = keyof typeof propertiesBox.lineHeight;
|
|
384
|
+
export type BoxBackgroundProperties = keyof typeof propertiesBox.background;
|
|
374
385
|
export interface BoxConditions<T> extends Conditions<T> {
|
|
375
386
|
focus?: T;
|
|
387
|
+
focusVisible?: T;
|
|
376
388
|
focusWithin?: T;
|
|
377
389
|
active?: T;
|
|
378
390
|
hover?: T;
|
|
@@ -631,6 +643,10 @@ export interface BoxSprinkle {
|
|
|
631
643
|
* The zIndex property specifies the stack order of the box.
|
|
632
644
|
*/
|
|
633
645
|
zIndex?: BoxZIndexProperties | BoxConditions<BoxZIndexProperties>;
|
|
646
|
+
/**
|
|
647
|
+
* The background property sets the background of the box.
|
|
648
|
+
*/
|
|
649
|
+
background?: BoxBackgroundProperties | BoxConditions<BoxBackgroundProperties>;
|
|
634
650
|
/**
|
|
635
651
|
* The backgroundImage property sets one or more background images on an element.
|
|
636
652
|
*/
|
|
@@ -749,6 +765,10 @@ export interface BoxSprinkle {
|
|
|
749
765
|
* @default left
|
|
750
766
|
*/
|
|
751
767
|
textAlign?: TextAlign | BoxConditions<TextAlign>;
|
|
768
|
+
/**
|
|
769
|
+
* The scrollbarWidth property specifies the width of the scrollbar.
|
|
770
|
+
*/
|
|
771
|
+
scrollbarWidth?: ScrollbarWidth | BoxConditions<ScrollbarWidth>;
|
|
752
772
|
}
|
|
753
773
|
export interface BoxProperties extends BoxSprinkle {
|
|
754
774
|
/**
|
|
@@ -765,6 +785,8 @@ export interface SegmentedControlButtonSkeletonProps {
|
|
|
765
785
|
width?: string;
|
|
766
786
|
/** Height of the skeleton button */
|
|
767
787
|
height?: string;
|
|
788
|
+
/** Additional CSS class name */
|
|
789
|
+
className?: string;
|
|
768
790
|
}
|
|
769
791
|
export type SegmentedControlButtonProperties = PropsWithChildren<{
|
|
770
792
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nimbus-ds/box"),require("@nimbus-ds/styles"),require("@nimbus-ds/skeleton")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/box","@nimbus-ds/styles","@nimbus-ds/skeleton"],t):"object"==typeof exports?exports["@nimbus-ds/segmented-control"]=t(require("react"),require("@nimbus-ds/box"),require("@nimbus-ds/styles"),require("@nimbus-ds/skeleton")):e["@nimbus-ds/segmented-control"]=t(e.react,e["@nimbus-ds/box"],e["@nimbus-ds/styles"],e["@nimbus-ds/skeleton"])}(global,((e,t,n,r)=>(()=>{"use strict";var o={480:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useRefObjectAsForwardedRef=void 0;const r=n(155);t.useRefObjectAsForwardedRef=function(e,t){(0,r.useImperativeHandle)(e,(()=>t.current))}},849:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControl=void 0;const r=n(769).__importStar(n(155)),o=n(558),a=n(337),i=n(595),l=n(43),u=n(142),s=({children:e,fullWidth:t=!1,...n})=>{const[a,l]=(0,r.useState)([]),s=(0,r.useRef)(new Set),c=(0,i.isControlled)(n),d=(0,r.useMemo)((()=>c?n.selectedSegments:a),[c,a,n]),f=(0,r.useCallback)((e=>{const t=t=>{const n=[...t],r=n.indexOf(e);return-1!==r?(n.splice(r,1),n):(n.push(e),n)};if(c){const e=n;e.onSegmentsSelect&&e.onSegmentsSelect(t(d))}else l(t)}),[c,d,n]),p=(0,r.useCallback)((e=>{s.current.add(e)}),[]),y=(0,r.useCallback)((e=>{s.current.delete(e)}),[]),m=(0,r.useCallback)((e=>d.includes(e)),[d]),b=(0,r.useMemo)((()=>({registerButton:p,unregisterButton:y,toggleSegment:f,isSelected:m,fullWidth:t})),[p,y,f,m,t]),{onSegmentsSelect:_,selectedSegments:g,...v}=n;return r.default.createElement(u.SegmentedControlContext.Provider,{value:b},r.default.createElement(o.Box,{"aria-label":"Segmented control",role:"group","data-testid":"segmented-control-container",maxWidth:t?"100%":"fit-content",alignItems:"center",justifyContent:"center",flexWrap:"nowrap",...v,display:"flex",gap:"1",backgroundColor:"neutral-surface",borderRadius:"2"},e))};t.SegmentedControl=s,s.displayName="SegmentedControl",(s.Button=a.SegmentedControlButton).displayName="SegmentedControl.Button",(s.ButtonSkeleton=l.SegmentedControlButtonSkeleton).displayName="SegmentedControl.ButtonSkeleton"},454:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButton=void 0;const r=n(769).__importStar(n(155)),o=n(480),a=n(367),i=n(43),l=n(142),u=(0,r.forwardRef)((({className:e,style:t,as:n="button",id:i,label:u,disabled:s=!1,fullWidth:c=!1,children:d,onClick:f,...p},y)=>{const m=(0,r.useRef)(null);(0,o.useRefObjectAsForwardedRef)(y,m);const b=(0,l.useSegmentedControlContext)();(0,r.useEffect)((()=>{if(i)return b.registerButton(i),()=>{b.unregisterButton(i)}}),[b,i]),(0,r.useImperativeHandle)(y,(()=>m?.current)),(0,r.useEffect)((()=>{!m.current||m.current instanceof HTMLAnchorElement||m.current instanceof HTMLButtonElement||console.error("Error: Found `SegmentedControlButton` component that renders an inaccessible element",m.current,"Please ensure `SegmentedControlButton` always renders as <a> or <button>")}),[m]);const _=b.isSelected(i),g=b?b.fullWidth:c,{classnames:v}=a.segmentedControl.subcomponents.button,S=[v.appearance[_?"selected":"default"]].concat(g?v.fullWidth:"").join(" ");return r.default.createElement(n,{id:i,role:"button",...p,className:S,"aria-pressed":_,"aria-label":u,disabled:s,onClick:e=>{b&&i&&b.toggleSegment(i),f?.(e)},ref:m},d)}));t.SegmentedControlButton=u,u.Skeleton=i.SegmentedControlButtonSkeleton,u.Skeleton.displayName="SegmentedControlButton.Skeleton"},43:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButtonSkeleton=void 0;const r=n(769).__importDefault(n(155)),o=n(334);t.SegmentedControlButtonSkeleton=({width:e="100%",height:t="2rem",...n})=>r.default.createElement(o.Skeleton,{width:e,height:t,borderRadius:"0.5rem",...n})},207:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButtonSkeleton=void 0;const r=n(43);var o=n(43);Object.defineProperty(t,"SegmentedControlButtonSkeleton",{enumerable:!0,get:function(){return o.SegmentedControlButtonSkeleton}}),t.default=r.SegmentedControlButtonSkeleton},76:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});n(769).__exportStar(n(207),t)},611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButton=t.SegmentedControlButtonSkeleton=void 0;const r=n(454);var o=n(76);Object.defineProperty(t,"SegmentedControlButtonSkeleton",{enumerable:!0,get:function(){return o.SegmentedControlButtonSkeleton}});var a=n(454);Object.defineProperty(t,"SegmentedControlButton",{enumerable:!0,get:function(){return a.SegmentedControlButton}}),t.default=r.SegmentedControlButton},337:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});n(769).__exportStar(n(611),t)},898:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSegmentedControlContext=t.SegmentedControlContext=void 0;const r=n(155);t.SegmentedControlContext=(0,r.createContext)(null);t.useSegmentedControlContext=()=>{const e=(0,r.useContext)(t.SegmentedControlContext);if(!e)throw new Error("useSegmentedControlContext must be used within a SegmentedControl");return e}},142:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSegmentedControlContext=t.SegmentedControlContext=void 0;var r=n(898);Object.defineProperty(t,"SegmentedControlContext",{enumerable:!0,get:function(){return r.SegmentedControlContext}}),Object.defineProperty(t,"useSegmentedControlContext",{enumerable:!0,get:function(){return r.useSegmentedControlContext}})},595:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isControlled=void 0;t.isControlled=e=>"selectedSegments"in e},558:e=>{e.exports=t},334:e=>{e.exports=r},367:e=>{e.exports=n},155:t=>{t.exports=e},769:(e,t,n)=>{n.r(t),n.d(t,{__addDisposableResource:()=>I,__assign:()=>a,__asyncDelegator:()=>j,__asyncGenerator:()=>O,__asyncValues:()=>x,__await:()=>C,__awaiter:()=>y,__classPrivateFieldGet:()=>T,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>M,__createBinding:()=>b,__decorate:()=>l,__disposeResources:()=>A,__esDecorate:()=>s,__exportStar:()=>_,__extends:()=>o,__generator:()=>m,__importDefault:()=>B,__importStar:()=>E,__makeTemplateObject:()=>P,__metadata:()=>p,__param:()=>u,__propKey:()=>d,__read:()=>v,__rest:()=>i,__runInitializers:()=>c,__setFunctionName:()=>f,__spread:()=>S,__spreadArray:()=>w,__spreadArrays:()=>h,__values:()=>g,default:()=>F});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function l(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i}function u(e,t){return function(n,r){t(n,r,e)}}function s(e,t,n,r,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,u=r.kind,s="getter"===u?"get":"setter"===u?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f=!1,p=n.length-1;p>=0;p--){var y={};for(var m in r)y[m]="access"===m?{}:r[m];for(var m in r.access)y.access[m]=r.access[m];y.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var b=(0,n[p])("accessor"===u?{get:d.get,set:d.set}:d[s],y);if("accessor"===u){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(l=i(b.get))&&(d.get=l),(l=i(b.set))&&(d.set=l),(l=i(b.init))&&o.unshift(l)}else(l=i(b))&&("field"===u?o.unshift(l):d[s]=l)}c&&Object.defineProperty(c,r.name,d),f=!0}function c(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function y(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}u((r=r.apply(e,t||[])).next())}))}function m(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(u){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}}var b=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function _(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||b(t,e,n)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function S(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function h(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)r[o]=a[i];return r}function w(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function O(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),a=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=o[e](t)).value instanceof C?Promise.resolve(n.value.v).then(u,s):c(a[0][2],n)}catch(e){c(a[0][3],e)}var n}function u(e){l("next",e)}function s(e){l("throw",e)}function c(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}function j(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:C(e[r](t)),done:!1}:o?o(t):t}:o}}function x(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=g(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function P(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var k=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&b(t,e,n);return k(t,e),t}function B(e){return e&&e.__esModule?e:{default:e}}function T(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function M(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function R(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function I(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var D="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function A(e){function t(t){e.error=e.hasError?new D(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var o=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(o).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const F={__extends:o,__assign:a,__rest:i,__decorate:l,__param:u,__metadata:p,__awaiter:y,__generator:m,__createBinding:b,__exportStar:_,__values:g,__read:v,__spread:S,__spreadArrays:h,__spreadArray:w,__await:C,__asyncGenerator:O,__asyncDelegator:j,__asyncValues:x,__makeTemplateObject:P,__importStar:E,__importDefault:B,__classPrivateFieldGet:T,__classPrivateFieldSet:M,__classPrivateFieldIn:R,__addDisposableResource:I,__disposeResources:A}}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return o[e](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{var e=l;Object.defineProperty(e,"__esModule",{value:!0}),e.useSegmentedControlContext=e.SegmentedControl=void 0;const t=i(849);var n=i(849);Object.defineProperty(e,"SegmentedControl",{enumerable:!0,get:function(){return n.SegmentedControl}});var r=i(142);Object.defineProperty(e,"useSegmentedControlContext",{enumerable:!0,get:function(){return r.useSegmentedControlContext}}),e.default=t.SegmentedControl})(),l})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nimbus-ds/box"),require("@nimbus-ds/styles"),require("@nimbus-ds/skeleton")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/box","@nimbus-ds/styles","@nimbus-ds/skeleton"],t):"object"==typeof exports?exports["@nimbus-ds/segmented-control"]=t(require("react"),require("@nimbus-ds/box"),require("@nimbus-ds/styles"),require("@nimbus-ds/skeleton")):e["@nimbus-ds/segmented-control"]=t(e.react,e["@nimbus-ds/box"],e["@nimbus-ds/styles"],e["@nimbus-ds/skeleton"])}(global,((e,t,n,r)=>(()=>{"use strict";var o={480:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useRefObjectAsForwardedRef=void 0;const r=n(155);t.useRefObjectAsForwardedRef=function(e,t){(0,r.useImperativeHandle)(e,(()=>t.current))}},849:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControl=void 0;const r=n(769).__importStar(n(155)),o=n(558),a=n(337),l=n(595),i=n(43),u=n(142),s=({children:e,fullWidth:t=!1,...n})=>{const[a,i]=(0,r.useState)([]),s=(0,r.useRef)(new Set),c=(0,l.isControlled)(n),d=(0,r.useMemo)((()=>c?n.selectedSegments:a),[c,a,n]),f=(0,r.useCallback)((e=>{const t=t=>{const n=[...t],r=n.indexOf(e);return-1!==r?(n.splice(r,1),n):(n.push(e),n)};if(c){const e=n;e.onSegmentsSelect&&e.onSegmentsSelect(t(d))}else i(t)}),[c,d,n]),p=(0,r.useCallback)((e=>{s.current.add(e)}),[]),y=(0,r.useCallback)((e=>{s.current.delete(e)}),[]),m=(0,r.useCallback)((e=>d.includes(e)),[d]),b=(0,r.useMemo)((()=>({registerButton:p,unregisterButton:y,toggleSegment:f,isSelected:m,fullWidth:t})),[p,y,f,m,t]),{onSegmentsSelect:_,selectedSegments:g,...v}=n;return r.default.createElement(u.SegmentedControlContext.Provider,{value:b},r.default.createElement(o.Box,{"aria-label":"Segmented control",role:"group","data-testid":"segmented-control-container",maxWidth:t?"100%":"fit-content",alignItems:"center",justifyContent:"center",flexWrap:"nowrap",...v,display:"flex",gap:"1",backgroundColor:"neutral-surface",borderRadius:"2"},e))};t.SegmentedControl=s,s.displayName="SegmentedControl",(s.Button=a.SegmentedControlButton).displayName="SegmentedControl.Button",(s.ButtonSkeleton=i.SegmentedControlButtonSkeleton).displayName="SegmentedControl.ButtonSkeleton"},454:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButton=void 0;const r=n(769).__importStar(n(155)),o=n(480),a=n(367),l=n(43),i=n(142),u=(0,r.forwardRef)((({className:e,style:t,as:n="button",id:l,label:u,disabled:s=!1,fullWidth:c=!1,children:d,onClick:f,...p},y)=>{const m=(0,r.useRef)(null);(0,o.useRefObjectAsForwardedRef)(y,m);const b=(0,i.useSegmentedControlContext)();(0,r.useEffect)((()=>{if(l)return b.registerButton(l),()=>{b.unregisterButton(l)}}),[b,l]),(0,r.useImperativeHandle)(y,(()=>m?.current)),(0,r.useEffect)((()=>{!m.current||m.current instanceof HTMLAnchorElement||m.current instanceof HTMLButtonElement||console.error("Error: Found `SegmentedControlButton` component that renders an inaccessible element",m.current,"Please ensure `SegmentedControlButton` always renders as <a> or <button>")}),[m]);const _=b.isSelected(l),g=b?b.fullWidth:c,{classnames:v}=a.segmentedControl.subcomponents.button,S=[e,v.appearance[_?"selected":"default"]].concat(g?v.fullWidth:"").filter(Boolean).join(" ");return r.default.createElement(n,{id:l,role:"button",...p,className:S,"aria-pressed":_,"aria-label":u,disabled:s,onClick:e=>{b&&l&&b.toggleSegment(l),f?.(e)},ref:m},d)}));t.SegmentedControlButton=u,u.Skeleton=l.SegmentedControlButtonSkeleton,u.Skeleton.displayName="SegmentedControlButton.Skeleton"},43:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButtonSkeleton=void 0;const r=n(769).__importDefault(n(155)),o=n(334);t.SegmentedControlButtonSkeleton=({width:e="100%",height:t="2rem",...n})=>r.default.createElement(o.Skeleton,{width:e,height:t,borderRadius:"0.5rem",...n})},207:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButtonSkeleton=void 0;const r=n(43);var o=n(43);Object.defineProperty(t,"SegmentedControlButtonSkeleton",{enumerable:!0,get:function(){return o.SegmentedControlButtonSkeleton}}),t.default=r.SegmentedControlButtonSkeleton},76:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});n(769).__exportStar(n(207),t)},611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentedControlButton=t.SegmentedControlButtonSkeleton=void 0;const r=n(454);var o=n(76);Object.defineProperty(t,"SegmentedControlButtonSkeleton",{enumerable:!0,get:function(){return o.SegmentedControlButtonSkeleton}});var a=n(454);Object.defineProperty(t,"SegmentedControlButton",{enumerable:!0,get:function(){return a.SegmentedControlButton}}),t.default=r.SegmentedControlButton},337:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});n(769).__exportStar(n(611),t)},898:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSegmentedControlContext=t.SegmentedControlContext=void 0;const r=n(155);t.SegmentedControlContext=(0,r.createContext)(null);t.useSegmentedControlContext=()=>{const e=(0,r.useContext)(t.SegmentedControlContext);if(!e)throw new Error("useSegmentedControlContext must be used within a SegmentedControl");return e}},142:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSegmentedControlContext=t.SegmentedControlContext=void 0;var r=n(898);Object.defineProperty(t,"SegmentedControlContext",{enumerable:!0,get:function(){return r.SegmentedControlContext}}),Object.defineProperty(t,"useSegmentedControlContext",{enumerable:!0,get:function(){return r.useSegmentedControlContext}})},595:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isControlled=void 0;t.isControlled=e=>"selectedSegments"in e},558:e=>{e.exports=t},334:e=>{e.exports=r},367:e=>{e.exports=n},155:t=>{t.exports=e},769:(e,t,n)=>{n.r(t),n.d(t,{__addDisposableResource:()=>I,__assign:()=>a,__asyncDelegator:()=>j,__asyncGenerator:()=>O,__asyncValues:()=>x,__await:()=>C,__awaiter:()=>y,__classPrivateFieldGet:()=>T,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>M,__createBinding:()=>b,__decorate:()=>i,__disposeResources:()=>A,__esDecorate:()=>s,__exportStar:()=>_,__extends:()=>o,__generator:()=>m,__importDefault:()=>B,__importStar:()=>E,__makeTemplateObject:()=>P,__metadata:()=>p,__param:()=>u,__propKey:()=>d,__read:()=>v,__rest:()=>l,__runInitializers:()=>c,__setFunctionName:()=>f,__spread:()=>S,__spreadArray:()=>w,__spreadArrays:()=>h,__values:()=>g,default:()=>F});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function l(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function i(e,t,n,r){var o,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(l=(a<3?o(l):a>3?o(t,n,l):o(t,n))||l);return a>3&&l&&Object.defineProperty(t,n,l),l}function u(e,t){return function(n,r){t(n,r,e)}}function s(e,t,n,r,o,a){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,u=r.kind,s="getter"===u?"get":"setter"===u?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f=!1,p=n.length-1;p>=0;p--){var y={};for(var m in r)y[m]="access"===m?{}:r[m];for(var m in r.access)y.access[m]=r.access[m];y.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(l(e||null))};var b=(0,n[p])("accessor"===u?{get:d.get,set:d.set}:d[s],y);if("accessor"===u){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(i=l(b.get))&&(d.get=i),(i=l(b.set))&&(d.set=i),(i=l(b.init))&&o.unshift(i)}else(i=l(b))&&("field"===u?o.unshift(i):d[s]=i)}c&&Object.defineProperty(c,r.name,d),f=!0}function c(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function y(e,t,n,r){return new(n||(n=Promise))((function(o,a){function l(e){try{u(r.next(e))}catch(e){a(e)}}function i(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,i)}u((r=r.apply(e,t||[])).next())}))}function m(e,t){var n,r,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,r=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=l.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var b=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function _(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||b(t,e,n)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)l.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return l}function S(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function h(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],l=0,i=a.length;l<i;l++,o++)r[o]=a[l];return r}function w(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function O(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),a=[];return r={},l("next"),l("throw"),l("return"),r[Symbol.asyncIterator]=function(){return this},r;function l(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||i(e,t)}))})}function i(e,t){try{(n=o[e](t)).value instanceof C?Promise.resolve(n.value.v).then(u,s):c(a[0][2],n)}catch(e){c(a[0][3],e)}var n}function u(e){i("next",e)}function s(e){i("throw",e)}function c(e,t){e(t),a.shift(),a.length&&i(a[0][0],a[0][1])}}function j(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:C(e[r](t)),done:!1}:o?o(t):t}:o}}function x(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=g(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function P(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var k=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&b(t,e,n);return k(t,e),t}function B(e){return e&&e.__esModule?e:{default:e}}function T(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function M(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function R(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function I(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var D="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function A(e){function t(t){e.error=e.hasError?new D(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var o=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(o).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const F={__extends:o,__assign:a,__rest:l,__decorate:i,__param:u,__metadata:p,__awaiter:y,__generator:m,__createBinding:b,__exportStar:_,__values:g,__read:v,__spread:S,__spreadArrays:h,__spreadArray:w,__await:C,__asyncGenerator:O,__asyncDelegator:j,__asyncValues:x,__makeTemplateObject:P,__importStar:E,__importDefault:B,__classPrivateFieldGet:T,__classPrivateFieldSet:M,__classPrivateFieldIn:R,__addDisposableResource:I,__disposeResources:A}}},a={};function l(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return o[e](n,n.exports,l),n.exports}l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.useSegmentedControlContext=e.SegmentedControl=void 0;const t=l(849);var n=l(849);Object.defineProperty(e,"SegmentedControl",{enumerable:!0,get:function(){return n.SegmentedControl}});var r=l(142);Object.defineProperty(e,"useSegmentedControlContext",{enumerable:!0,get:function(){return r.useSegmentedControlContext}}),e.default=t.SegmentedControl})(),i})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbus-ds/segmented-control",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"version": "yarn version"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@nimbus-ds/box": "^4.
|
|
18
|
-
"@nimbus-ds/button": "^2.
|
|
19
|
-
"@nimbus-ds/skeleton": "^3.0
|
|
20
|
-
"@nimbus-ds/typings": "^1.3.
|
|
17
|
+
"@nimbus-ds/box": "^4.4.0",
|
|
18
|
+
"@nimbus-ds/button": "^2.11.0",
|
|
19
|
+
"@nimbus-ds/skeleton": "^3.1.0",
|
|
20
|
+
"@nimbus-ds/typings": "^1.3.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@nimbus-ds/styles": "^9.
|
|
24
|
-
"react": "^16.8 || ^17.0 || ^18.0",
|
|
25
|
-
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
|
23
|
+
"@nimbus-ds/styles": "^9.56.1",
|
|
24
|
+
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0",
|
|
25
|
+
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0"
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://nimbus.nuvemshop.com.br/documentation",
|
|
28
28
|
"repository": {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"url": "https://github.com/TiendaNube/nimbus-design-system/issues"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@nimbus-ds/badge": "^3.
|
|
37
|
-
"@nimbus-ds/icon": "^3.
|
|
38
|
-
"@nimbus-ds/icons": "^1.
|
|
39
|
-
"@nimbus-ds/tooltip": "^2.
|
|
40
|
-
"@nimbus-ds/webpack": "^1.7.
|
|
36
|
+
"@nimbus-ds/badge": "^3.2.0",
|
|
37
|
+
"@nimbus-ds/icon": "^3.4.0",
|
|
38
|
+
"@nimbus-ds/icons": "^1.17.0",
|
|
39
|
+
"@nimbus-ds/tooltip": "^2.7.0",
|
|
40
|
+
"@nimbus-ds/webpack": "^1.7.2"
|
|
41
41
|
}
|
|
42
42
|
}
|