@sixthshift/design-system 0.7.0 → 0.8.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/dist/components/DataTable/DataTable.d.ts +89 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +107 -0
- package/dist/components/DataTable/DataTable.js.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/DataTable/index.js +2 -0
- package/dist/components/DataTable/index.js.map +1 -0
- package/dist/components/FileDropzone/FileDropzone.d.ts +87 -0
- package/dist/components/FileDropzone/FileDropzone.d.ts.map +1 -0
- package/dist/components/FileDropzone/FileDropzone.js +146 -0
- package/dist/components/FileDropzone/FileDropzone.js.map +1 -0
- package/dist/components/FileDropzone/index.d.ts +2 -0
- package/dist/components/FileDropzone/index.d.ts.map +1 -0
- package/dist/components/FileDropzone/index.js +2 -0
- package/dist/components/FileDropzone/index.js.map +1 -0
- package/dist/components/ImageGallery/ImageGallery.d.ts +93 -0
- package/dist/components/ImageGallery/ImageGallery.d.ts.map +1 -0
- package/dist/components/ImageGallery/ImageGallery.js +121 -0
- package/dist/components/ImageGallery/ImageGallery.js.map +1 -0
- package/dist/components/ImageGallery/index.d.ts +2 -0
- package/dist/components/ImageGallery/index.d.ts.map +1 -0
- package/dist/components/ImageGallery/index.js +2 -0
- package/dist/components/ImageGallery/index.js.map +1 -0
- package/dist/components/NumberStepper/NumberStepper.d.ts +78 -0
- package/dist/components/NumberStepper/NumberStepper.d.ts.map +1 -0
- package/dist/components/NumberStepper/NumberStepper.js +129 -0
- package/dist/components/NumberStepper/NumberStepper.js.map +1 -0
- package/dist/components/NumberStepper/index.d.ts +2 -0
- package/dist/components/NumberStepper/index.d.ts.map +1 -0
- package/dist/components/NumberStepper/index.js +2 -0
- package/dist/components/NumberStepper/index.js.map +1 -0
- package/dist/components/Steps/Steps.d.ts +65 -0
- package/dist/components/Steps/Steps.d.ts.map +1 -0
- package/dist/components/Steps/Steps.js +62 -0
- package/dist/components/Steps/Steps.js.map +1 -0
- package/dist/components/Steps/index.d.ts +2 -0
- package/dist/components/Steps/index.d.ts.map +1 -0
- package/dist/components/Steps/index.js +2 -0
- package/dist/components/Steps/index.js.map +1 -0
- package/package.json +21 -1
- package/src/components/DataTable/DataTable.tsx +261 -0
- package/src/components/DataTable/data-table.recipe.css +28 -0
- package/src/components/DataTable/index.ts +10 -0
- package/src/components/FileDropzone/FileDropzone.tsx +239 -0
- package/src/components/FileDropzone/file-dropzone.recipe.css +38 -0
- package/src/components/FileDropzone/index.ts +1 -0
- package/src/components/ImageGallery/ImageGallery.tsx +285 -0
- package/src/components/ImageGallery/image-gallery.recipe.css +50 -0
- package/src/components/ImageGallery/index.ts +7 -0
- package/src/components/NumberStepper/NumberStepper.tsx +227 -0
- package/src/components/NumberStepper/index.ts +1 -0
- package/src/components/NumberStepper/number-stepper.recipe.css +31 -0
- package/src/components/Steps/Steps.tsx +149 -0
- package/src/components/Steps/index.ts +1 -0
- package/src/components/Steps/steps.recipe.css +51 -0
- package/src/theming/tailwind.css +5 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useControllableState } from "@sixthshift/design-system/hooks";
|
|
4
|
+
import { cn } from "@sixthshift/design-system/utils";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
/**
|
|
9
|
+
* Geometry only. Every colour reads an `--image-gallery-*` component token
|
|
10
|
+
* whose value is decided by src/components/ImageGallery/image-gallery.recipe.css.
|
|
11
|
+
*
|
|
12
|
+
* `ratio` is the frame's shape, not the images': every slide is cropped to it
|
|
13
|
+
* with `object-cover`, so a mixed set of uploads still produces a steady
|
|
14
|
+
* frame that does not jump as you swipe. `portrait` is 4:5, the tallest crop
|
|
15
|
+
* Instagram allows in a feed — photography shot for the feed lands on it
|
|
16
|
+
* uncropped.
|
|
17
|
+
*/
|
|
18
|
+
const frameVariants = cva("relative overflow-hidden rounded-lg bg-(--image-gallery-bg)", {
|
|
19
|
+
variants: {
|
|
20
|
+
ratio: {
|
|
21
|
+
square: "aspect-square",
|
|
22
|
+
portrait: "aspect-[4/5]",
|
|
23
|
+
landscape: "aspect-[4/3]",
|
|
24
|
+
wide: "aspect-video",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
ratio: "square",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
function prefersReducedMotion() {
|
|
32
|
+
return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A product photo carousel: one frame, swipeable on touch, with previous/next
|
|
36
|
+
* buttons, arrow-key navigation and an optional thumbnail strip or dots.
|
|
37
|
+
*
|
|
38
|
+
* Swiping is native scrolling — a horizontal `scroll-snap` track, not a
|
|
39
|
+
* pointer-event reimplementation — so it has the platform's own momentum and
|
|
40
|
+
* edge behaviour on phones. The shown index follows the scroll position, and
|
|
41
|
+
* setting the index (by button, key, thumbnail or a controlled `index`)
|
|
42
|
+
* scrolls the track. Both directions meet at one rule: the effect only scrolls
|
|
43
|
+
* when the track is not already showing the index, so a swipe that updates
|
|
44
|
+
* the index never fights itself.
|
|
45
|
+
*
|
|
46
|
+
* Controlled or uncontrolled through `index`/`defaultIndex`/`onIndexChange`.
|
|
47
|
+
*
|
|
48
|
+
* Follows the WAI-ARIA carousel pattern: the root is a `<section>` with
|
|
49
|
+
* `aria-roledescription="carousel"` (a landmark region once `label` names
|
|
50
|
+
* it), each slide a group named "n of total", and slides out of view are
|
|
51
|
+
* `aria-hidden`. The first image loads eagerly and
|
|
52
|
+
* the rest lazily, so a gallery of ten costs one download up front.
|
|
53
|
+
*/
|
|
54
|
+
export const ImageGallery = React.forwardRef(({ className, images, index: controlledIndex, defaultIndex = 0, onIndexChange, ratio = "square", indicator = "thumbnails", label, previousLabel = "Previous image", nextLabel = "Next image", placeholder, onKeyDown, ...props }, ref) => {
|
|
55
|
+
const count = images.length;
|
|
56
|
+
const [rawIndex, setIndex] = useControllableState({
|
|
57
|
+
value: controlledIndex,
|
|
58
|
+
defaultValue: defaultIndex,
|
|
59
|
+
onChange: onIndexChange,
|
|
60
|
+
});
|
|
61
|
+
const index = count === 0 ? 0 : Math.min(Math.max(rawIndex, 0), count - 1);
|
|
62
|
+
const trackRef = React.useRef(null);
|
|
63
|
+
// The slide a programmatic scroll is heading for. While set, the slides it
|
|
64
|
+
// passes on the way are not reported — jumping from 1 to 4 reports 4, not
|
|
65
|
+
// 2, 3 and 4. Any touch, wheel or pointer on the track hands control back.
|
|
66
|
+
const scrollTargetRef = React.useRef(null);
|
|
67
|
+
// Index → scroll. Skipped when the track already shows `index`, which is
|
|
68
|
+
// always the case right after a swipe reported it.
|
|
69
|
+
React.useEffect(() => {
|
|
70
|
+
const track = trackRef.current;
|
|
71
|
+
if (!track || track.clientWidth === 0)
|
|
72
|
+
return;
|
|
73
|
+
if (Math.round(track.scrollLeft / track.clientWidth) === index)
|
|
74
|
+
return;
|
|
75
|
+
scrollTargetRef.current = index;
|
|
76
|
+
track.scrollTo({ left: index * track.clientWidth, behavior: prefersReducedMotion() ? "auto" : "smooth" });
|
|
77
|
+
}, [index]);
|
|
78
|
+
// Scroll → index. Rounds, so the index flips at the halfway point of a swipe.
|
|
79
|
+
const handleScroll = () => {
|
|
80
|
+
const track = trackRef.current;
|
|
81
|
+
if (!track || track.clientWidth === 0)
|
|
82
|
+
return;
|
|
83
|
+
const shown = Math.round(track.scrollLeft / track.clientWidth);
|
|
84
|
+
if (scrollTargetRef.current !== null) {
|
|
85
|
+
if (shown !== scrollTargetRef.current)
|
|
86
|
+
return;
|
|
87
|
+
scrollTargetRef.current = null;
|
|
88
|
+
}
|
|
89
|
+
if (shown !== index && shown >= 0 && shown < count)
|
|
90
|
+
setIndex(shown);
|
|
91
|
+
};
|
|
92
|
+
const releaseScroll = () => {
|
|
93
|
+
scrollTargetRef.current = null;
|
|
94
|
+
};
|
|
95
|
+
const go = (next) => {
|
|
96
|
+
if (next >= 0 && next < count && next !== index)
|
|
97
|
+
setIndex(next);
|
|
98
|
+
};
|
|
99
|
+
const handleKeyDown = (event) => {
|
|
100
|
+
onKeyDown?.(event);
|
|
101
|
+
if (event.defaultPrevented)
|
|
102
|
+
return;
|
|
103
|
+
const targets = { ArrowLeft: index - 1, ArrowRight: index + 1, Home: 0, End: count - 1 };
|
|
104
|
+
const target = targets[event.key];
|
|
105
|
+
if (target === undefined)
|
|
106
|
+
return;
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
go(target);
|
|
109
|
+
};
|
|
110
|
+
const controlClass = "image-gallery-control focus-visible:ring-(color:--image-gallery-control-ring) absolute top-1/2 flex size-9 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-(--image-gallery-control-bg) text-(--image-gallery-control-fg) shadow transition-opacity hover:bg-(--image-gallery-control-bg-hovered) focus-visible:outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-0 max-sm:hidden [&_svg]:size-5";
|
|
111
|
+
return (_jsxs("section", { ref: ref, "aria-roledescription": "carousel", "aria-label": label, className: cn("image-gallery flex flex-col gap-3", className), onKeyDown: handleKeyDown, ...props, children: [_jsxs("div", { className: frameVariants({ ratio }), children: [count === 0 ? (_jsx("div", { className: "flex h-full w-full items-center justify-center text-(--image-gallery-placeholder-fg) text-sm", children: placeholder })) : (_jsx("div", { ref: trackRef, onScroll: handleScroll, onPointerDown: releaseScroll, onTouchStart: releaseScroll, onWheel: releaseScroll,
|
|
112
|
+
// Focusable so the arrow keys work without first reaching a button,
|
|
113
|
+
// and because a scrollable region must be keyboard-reachable.
|
|
114
|
+
// biome-ignore lint/a11y/noNoninteractiveTabindex: scrollable regions must be focusable (axe `scrollable-region-focusable`)
|
|
115
|
+
tabIndex: 0, className: "focus-visible:ring-(color:--image-gallery-control-ring) flex h-full w-full snap-x snap-mandatory overflow-x-auto overscroll-x-contain [scrollbar-width:none] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset [&::-webkit-scrollbar]:hidden", children: images.map((image, i) => (
|
|
116
|
+
// biome-ignore lint/a11y/useSemanticElements: the WAI-ARIA carousel pattern names each slide a `group`; a <fieldset> is for form controls
|
|
117
|
+
_jsx("div", { role: "group", "aria-roledescription": "slide", "aria-label": `${i + 1} of ${count}`, "aria-hidden": i !== index, className: "h-full w-full shrink-0 snap-center snap-always", children: _jsx("img", { src: image.src, srcSet: image.srcSet, sizes: image.sizes, width: image.width, height: image.height, alt: image.alt, loading: i === 0 ? "eager" : "lazy", decoding: "async", draggable: false, className: "h-full w-full select-none object-cover" }) }, i))) })), count > 1 && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", "aria-label": previousLabel, disabled: index === 0, onClick: () => go(index - 1), className: cn(controlClass, "left-2"), children: _jsx(ChevronLeft, { "aria-hidden": "true" }) }), _jsx("button", { type: "button", "aria-label": nextLabel, disabled: index === count - 1, onClick: () => go(index + 1), className: cn(controlClass, "right-2"), children: _jsx(ChevronRight, { "aria-hidden": "true" }) })] }))] }), count > 1 && indicator === "thumbnails" && (_jsx("div", { className: "flex gap-2 overflow-x-auto p-0.5", children: images.map((image, i) => (_jsx("button", { type: "button", "aria-label": `Show image ${i + 1} of ${count}`, "aria-current": i === index ? "true" : undefined, "data-selected": i === index, onClick: () => go(i), className: "image-gallery-thumb border-(color:--image-gallery-thumb-border) focus-visible:ring-(color:--image-gallery-control-ring) hover:border-(color:--image-gallery-thumb-border-hovered) size-16 shrink-0 cursor-pointer overflow-hidden rounded-md border-2 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2", children: _jsx("img", { src: image.src, srcSet: image.srcSet, sizes: "64px", alt: "", loading: "lazy", decoding: "async", draggable: false, className: "h-full w-full object-cover" }) }, i))) })), count > 1 && indicator === "dots" && (_jsx("div", { className: "flex justify-center gap-1.5", children: images.map((_, i) => (_jsx("button", { type: "button", "aria-label": `Show image ${i + 1} of ${count}`, "aria-current": i === index ? "true" : undefined, "data-selected": i === index, onClick: () => go(i), className: "image-gallery-dot focus-visible:ring-(color:--image-gallery-control-ring) flex size-6 cursor-pointer items-center justify-center rounded-full focus-visible:outline-hidden focus-visible:ring-2", children: _jsx("span", { "aria-hidden": "true", className: "block size-2 rounded-full bg-(--image-gallery-dot-bg) transition-colors" }) }, i))) }))] }));
|
|
118
|
+
});
|
|
119
|
+
ImageGallery.displayName = "ImageGallery";
|
|
120
|
+
export { frameVariants as imageGalleryFrameVariants };
|
|
121
|
+
//# sourceMappingURL=ImageGallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageGallery.js","sourceRoot":"","sources":["../../../src/components/ImageGallery/ImageGallery.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;GASG;AACH,MAAM,aAAa,GAAG,GAAG,CAAC,6DAA6D,EAAE;IACvF,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,MAAM,EAAE,eAAe;YACvB,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE,cAAc;YACzB,IAAI,EAAE,cAAc;SACrB;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC,CAAC;AAsCH,SAAS,oBAAoB;IAC3B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Aa,IAAI,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ImageGallery/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ImageGallery/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIZ,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Geometry only. Every colour reads a `--number-stepper-*` component token
|
|
5
|
+
* whose value is decided by src/components/NumberStepper/number-stepper.recipe.css.
|
|
6
|
+
*
|
|
7
|
+
* `size` tracks Input's and Button's heights (`sm` 32px, `md` 36px, `lg`
|
|
8
|
+
* 40px) so a stepper sits on the same baseline as the fields beside it.
|
|
9
|
+
*/
|
|
10
|
+
declare const numberStepperVariants: (props?: ({
|
|
11
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
export type NumberStepperSize = NonNullable<VariantProps<typeof numberStepperVariants>["size"]>;
|
|
14
|
+
export type NumberStepperProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "size" | "min" | "max" | "step" | "type"> & VariantProps<typeof numberStepperVariants> & {
|
|
15
|
+
/** Controlled value. */
|
|
16
|
+
value?: number;
|
|
17
|
+
/** Initial value in uncontrolled mode. Defaults to `min`, or `0` without one. */
|
|
18
|
+
defaultValue?: number;
|
|
19
|
+
/** Called with the new, already-clamped value. */
|
|
20
|
+
onValueChange?: (value: number) => void;
|
|
21
|
+
/** Lowest reachable value. Defaults to `0` — quantities are the common case. */
|
|
22
|
+
min?: number;
|
|
23
|
+
/** Highest reachable value. Unbounded when omitted. */
|
|
24
|
+
max?: number;
|
|
25
|
+
/** Increment for the buttons and arrow keys. `PageUp`/`PageDown` move ten of them. */
|
|
26
|
+
step?: number;
|
|
27
|
+
/** Accessible name for the decrement button. */
|
|
28
|
+
decrementLabel?: string;
|
|
29
|
+
/** Accessible name for the increment button. */
|
|
30
|
+
incrementLabel?: string;
|
|
31
|
+
/** Extra classes for the inner `<input>`; `className` styles the surrounding group. */
|
|
32
|
+
inputClassName?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A whole-number field with decrement and increment buttons — a cart
|
|
36
|
+
* quantity, a guest count, a per-day capacity.
|
|
37
|
+
*
|
|
38
|
+
* Implements the WAI-ARIA spinbutton pattern on the `<input>` itself:
|
|
39
|
+
* `role="spinbutton"` with `aria-valuenow`/`min`/`max`, `ArrowUp`/`ArrowDown`
|
|
40
|
+
* step, `PageUp`/`PageDown` step by ten, and `Home`/`End` jump to the bounds
|
|
41
|
+
* that exist. The two buttons are pointer affordances and stay out of the tab
|
|
42
|
+
* order, so the field is one tab stop — the same reason RadioButtonGroup is.
|
|
43
|
+
*
|
|
44
|
+
* Typing is free-form while focused and committed on blur or `Enter`: the
|
|
45
|
+
* draft is parsed, rounded to the nearest `step` from `min`, and clamped.
|
|
46
|
+
* Anything unparseable reverts to the last committed value rather than
|
|
47
|
+
* reporting `NaN`. Every value `onValueChange` receives is in range.
|
|
48
|
+
*
|
|
49
|
+
* Controlled or uncontrolled through the `value`/`defaultValue`/
|
|
50
|
+
* `onValueChange` triad. `name` submits the committed value with a form, since
|
|
51
|
+
* the input is a real `<input>`. The ref and every unlisted prop land on that
|
|
52
|
+
* input — so `FormField`'s `id`/`aria-describedby` wiring reaches the control
|
|
53
|
+
* — while `className` styles the surrounding group.
|
|
54
|
+
*/
|
|
55
|
+
export declare const NumberStepper: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "step" | "size" | "type" | "value" | "max" | "min"> & VariantProps<(props?: ({
|
|
56
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
57
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
58
|
+
/** Controlled value. */
|
|
59
|
+
value?: number;
|
|
60
|
+
/** Initial value in uncontrolled mode. Defaults to `min`, or `0` without one. */
|
|
61
|
+
defaultValue?: number;
|
|
62
|
+
/** Called with the new, already-clamped value. */
|
|
63
|
+
onValueChange?: (value: number) => void;
|
|
64
|
+
/** Lowest reachable value. Defaults to `0` — quantities are the common case. */
|
|
65
|
+
min?: number;
|
|
66
|
+
/** Highest reachable value. Unbounded when omitted. */
|
|
67
|
+
max?: number;
|
|
68
|
+
/** Increment for the buttons and arrow keys. `PageUp`/`PageDown` move ten of them. */
|
|
69
|
+
step?: number;
|
|
70
|
+
/** Accessible name for the decrement button. */
|
|
71
|
+
decrementLabel?: string;
|
|
72
|
+
/** Accessible name for the increment button. */
|
|
73
|
+
incrementLabel?: string;
|
|
74
|
+
/** Extra classes for the inner `<input>`; `className` styles the surrounding group. */
|
|
75
|
+
inputClassName?: string;
|
|
76
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
77
|
+
export { numberStepperVariants };
|
|
78
|
+
//# sourceMappingURL=NumberStepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberStepper.d.ts","sourceRoot":"","sources":["../../../src/components/NumberStepper/NumberStepper.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;GAMG;AACH,QAAA,MAAM,qBAAqB;;8EAe1B,CAAC;AAgBF,MAAM,MAAM,iBAAiB,G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|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useControllableState } from "@sixthshift/design-system/hooks";
|
|
4
|
+
import { cn } from "@sixthshift/design-system/utils";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { Minus, Plus } from "lucide-react";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
/**
|
|
9
|
+
* Geometry only. Every colour reads a `--number-stepper-*` component token
|
|
10
|
+
* whose value is decided by src/components/NumberStepper/number-stepper.recipe.css.
|
|
11
|
+
*
|
|
12
|
+
* `size` tracks Input's and Button's heights (`sm` 32px, `md` 36px, `lg`
|
|
13
|
+
* 40px) so a stepper sits on the same baseline as the fields beside it.
|
|
14
|
+
*/
|
|
15
|
+
const numberStepperVariants = cva(
|
|
16
|
+
// One literal, deliberately — see Button.tsx for why a `+` concatenation is a trap.
|
|
17
|
+
"number-stepper border-(color:--number-stepper-border) focus-within:ring-(color:--number-stepper-ring) inline-flex w-fit items-stretch overflow-hidden rounded-md border bg-(--number-stepper-bg) text-(--number-stepper-fg) shadow-xs transition-colors focus-within:ring-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50", {
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
sm: "h-8 text-xs [&_svg]:size-3.5",
|
|
21
|
+
md: "h-9 text-sm [&_svg]:size-4",
|
|
22
|
+
lg: "h-10 text-sm [&_svg]:size-4",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
size: "md",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
/** Button width per size — square against the field's height. */
|
|
30
|
+
const buttonGeometry = {
|
|
31
|
+
sm: "w-8",
|
|
32
|
+
md: "w-9",
|
|
33
|
+
lg: "w-10",
|
|
34
|
+
};
|
|
35
|
+
/** Input width per size — room for three digits before it grows. */
|
|
36
|
+
const inputGeometry = {
|
|
37
|
+
sm: "w-10",
|
|
38
|
+
md: "w-12",
|
|
39
|
+
lg: "w-14",
|
|
40
|
+
};
|
|
41
|
+
function clamp(value, min, max) {
|
|
42
|
+
const floored = Math.max(min, value);
|
|
43
|
+
return max === undefined ? floored : Math.min(max, floored);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A whole-number field with decrement and increment buttons — a cart
|
|
47
|
+
* quantity, a guest count, a per-day capacity.
|
|
48
|
+
*
|
|
49
|
+
* Implements the WAI-ARIA spinbutton pattern on the `<input>` itself:
|
|
50
|
+
* `role="spinbutton"` with `aria-valuenow`/`min`/`max`, `ArrowUp`/`ArrowDown`
|
|
51
|
+
* step, `PageUp`/`PageDown` step by ten, and `Home`/`End` jump to the bounds
|
|
52
|
+
* that exist. The two buttons are pointer affordances and stay out of the tab
|
|
53
|
+
* order, so the field is one tab stop — the same reason RadioButtonGroup is.
|
|
54
|
+
*
|
|
55
|
+
* Typing is free-form while focused and committed on blur or `Enter`: the
|
|
56
|
+
* draft is parsed, rounded to the nearest `step` from `min`, and clamped.
|
|
57
|
+
* Anything unparseable reverts to the last committed value rather than
|
|
58
|
+
* reporting `NaN`. Every value `onValueChange` receives is in range.
|
|
59
|
+
*
|
|
60
|
+
* Controlled or uncontrolled through the `value`/`defaultValue`/
|
|
61
|
+
* `onValueChange` triad. `name` submits the committed value with a form, since
|
|
62
|
+
* the input is a real `<input>`. The ref and every unlisted prop land on that
|
|
63
|
+
* input — so `FormField`'s `id`/`aria-describedby` wiring reaches the control
|
|
64
|
+
* — while `className` styles the surrounding group.
|
|
65
|
+
*/
|
|
66
|
+
export const NumberStepper = React.forwardRef(({ className, inputClassName, size = "md", value: controlledValue, defaultValue, onValueChange, min = 0, max, step = 1, disabled = false, readOnly = false, decrementLabel = "Decrease", incrementLabel = "Increase", onKeyDown, onBlur, onFocus, ...props }, ref) => {
|
|
67
|
+
const [value, setValue] = useControllableState({
|
|
68
|
+
value: controlledValue,
|
|
69
|
+
defaultValue: clamp(defaultValue ?? min, min, max),
|
|
70
|
+
onChange: onValueChange,
|
|
71
|
+
});
|
|
72
|
+
// The text being typed, or `null` when the field shows the committed value.
|
|
73
|
+
const [draft, setDraft] = React.useState(null);
|
|
74
|
+
const commit = (next) => {
|
|
75
|
+
const snapped = min + Math.round((next - min) / step) * step;
|
|
76
|
+
const clamped = clamp(snapped, min, max);
|
|
77
|
+
if (clamped !== value)
|
|
78
|
+
setValue(clamped);
|
|
79
|
+
};
|
|
80
|
+
const commitDraft = () => {
|
|
81
|
+
if (draft === null)
|
|
82
|
+
return;
|
|
83
|
+
const parsed = Number.parseFloat(draft);
|
|
84
|
+
setDraft(null);
|
|
85
|
+
if (Number.isFinite(parsed))
|
|
86
|
+
commit(parsed);
|
|
87
|
+
};
|
|
88
|
+
const interactive = !disabled && !readOnly;
|
|
89
|
+
const atMin = value <= min;
|
|
90
|
+
const atMax = max !== undefined && value >= max;
|
|
91
|
+
const handleKeyDown = (event) => {
|
|
92
|
+
onKeyDown?.(event);
|
|
93
|
+
if (event.defaultPrevented || !interactive)
|
|
94
|
+
return;
|
|
95
|
+
const moves = {
|
|
96
|
+
ArrowUp: () => value + step,
|
|
97
|
+
ArrowDown: () => value - step,
|
|
98
|
+
PageUp: () => value + step * 10,
|
|
99
|
+
PageDown: () => value - step * 10,
|
|
100
|
+
Home: () => min,
|
|
101
|
+
End: max === undefined ? undefined : () => max,
|
|
102
|
+
};
|
|
103
|
+
const move = moves[event.key];
|
|
104
|
+
if (event.key === "Enter") {
|
|
105
|
+
commitDraft();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (!move)
|
|
109
|
+
return;
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
setDraft(null);
|
|
112
|
+
commit(move());
|
|
113
|
+
};
|
|
114
|
+
const handleBlur = (event) => {
|
|
115
|
+
commitDraft();
|
|
116
|
+
onBlur?.(event);
|
|
117
|
+
};
|
|
118
|
+
const stepBy = (direction) => {
|
|
119
|
+
setDraft(null);
|
|
120
|
+
commit(value + step * direction);
|
|
121
|
+
};
|
|
122
|
+
const buttonClass = cn("number-stepper-button flex shrink-0 cursor-pointer items-center justify-center text-(--number-stepper-button-fg) transition-colors enabled:active:bg-(--number-stepper-button-bg-pressed) enabled:hover:bg-(--number-stepper-button-bg-hovered) disabled:cursor-not-allowed disabled:text-(--number-stepper-button-fg-disabled)", buttonGeometry[size ?? "md"]);
|
|
123
|
+
return (
|
|
124
|
+
// biome-ignore lint/a11y/useSemanticElements: a <fieldset> brings a border, min-width and legend semantics this inline control does not want; role="group" only ties the buttons to the field
|
|
125
|
+
_jsxs("div", { role: "group", "data-disabled": disabled, className: numberStepperVariants({ size, className }), children: [_jsx("button", { type: "button", tabIndex: -1, "aria-label": decrementLabel, disabled: !interactive || atMin, onClick: () => stepBy(-1), className: buttonClass, children: _jsx(Minus, { "aria-hidden": "true" }) }), _jsx("input", { ref: ref, type: "text", inputMode: "numeric", role: "spinbutton", autoComplete: "off", "aria-valuenow": value, "aria-valuemin": min, "aria-valuemax": max, disabled: disabled, readOnly: readOnly, value: draft ?? String(value), onChange: (event) => setDraft(event.target.value), onKeyDown: handleKeyDown, onBlur: handleBlur, onFocus: onFocus, className: cn("border-(color:--number-stepper-divider-border) min-w-0 border-x bg-transparent text-center text-[length:inherit] tabular-nums outline-hidden disabled:cursor-not-allowed", inputGeometry[size ?? "md"], inputClassName), ...props }), _jsx("button", { type: "button", tabIndex: -1, "aria-label": incrementLabel, disabled: !interactive || atMax, onClick: () => stepBy(1), className: buttonClass, children: _jsx(Plus, { "aria-hidden": "true" }) })] }));
|
|
126
|
+
});
|
|
127
|
+
NumberStepper.displayName = "NumberStepper";
|
|
128
|
+
export { numberStepperVariants };
|
|
129
|
+
//# sourceMappingURL=NumberStepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberStepper.js","sourceRoot":"","sources":["../../../src/components/NumberStepper/NumberStepper.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;A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CAAC,gBAAc,cAAc,EAAE,QAAQ,EAAE,CAAC,WAAW,IAAI,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,YAC/I,KAAC,IAAI,mBAAa,MAAM,GAAG,GACpB,IACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberStepper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NumberStepper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAmD,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Geometry only. Every colour reads a `--steps-*` component token whose value
|
|
4
|
+
* is decided by src/components/Steps/steps.recipe.css, selected by the
|
|
5
|
+
* `data-state` each item renders (`complete`, `current`, `upcoming`).
|
|
6
|
+
*/
|
|
7
|
+
declare const stepsVariants: (props?: ({
|
|
8
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export type StepsOrientation = "horizontal" | "vertical";
|
|
11
|
+
/** Where a step sits relative to `current`. Rendered as `data-state`. */
|
|
12
|
+
export type StepState = "complete" | "current" | "upcoming";
|
|
13
|
+
export type StepItem = {
|
|
14
|
+
/** Visible step name. */
|
|
15
|
+
label: React.ReactNode;
|
|
16
|
+
/** Secondary line under the label. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export type StepsProps = Omit<React.OlHTMLAttributes<HTMLOListElement>, "children"> & {
|
|
20
|
+
/** The steps, in order. */
|
|
21
|
+
steps: readonly StepItem[];
|
|
22
|
+
/** Zero-based index of the step in progress. `steps.length` marks every step complete. */
|
|
23
|
+
current: number;
|
|
24
|
+
/**
|
|
25
|
+
* Makes completed steps clickable, for going back in a wizard. Upcoming
|
|
26
|
+
* steps never are — skipping ahead is the flow's decision, not the
|
|
27
|
+
* indicator's.
|
|
28
|
+
*/
|
|
29
|
+
onStepClick?: (index: number) => void;
|
|
30
|
+
/** Layout direction. `horizontal` collapses labels to the current step's on narrow screens. */
|
|
31
|
+
orientation?: StepsOrientation;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Progress through a fixed sequence — checkout, onboarding, a multi-page
|
|
35
|
+
* form. Display-only: the step in progress is the `current` prop, owned by
|
|
36
|
+
* whatever runs the flow, so there is no internal state to control.
|
|
37
|
+
*
|
|
38
|
+
* Renders an `<ol>` (pass `aria-label`, e.g. "Checkout progress"); the
|
|
39
|
+
* current item carries `aria-current="step"`, and each indicator has a
|
|
40
|
+
* visually hidden status ("completed", "current") so the sequence reads
|
|
41
|
+
* correctly without the colours.
|
|
42
|
+
*
|
|
43
|
+
* With `onStepClick`, completed steps become buttons. Current and upcoming
|
|
44
|
+
* steps stay plain text: a step indicator that let you jump forward would be
|
|
45
|
+
* making the flow's validation decisions for it.
|
|
46
|
+
*
|
|
47
|
+
* Horizontally, every label shows from `sm` up; below that only the current
|
|
48
|
+
* step's label does, so four steps still fit a phone.
|
|
49
|
+
*/
|
|
50
|
+
export declare const Steps: React.ForwardRefExoticComponent<Omit<React.OlHTMLAttributes<HTMLOListElement>, "children"> & {
|
|
51
|
+
/** The steps, in order. */
|
|
52
|
+
steps: readonly StepItem[];
|
|
53
|
+
/** Zero-based index of the step in progress. `steps.length` marks every step complete. */
|
|
54
|
+
current: number;
|
|
55
|
+
/**
|
|
56
|
+
* Makes completed steps clickable, for going back in a wizard. Upcoming
|
|
57
|
+
* steps never are — skipping ahead is the flow's decision, not the
|
|
58
|
+
* indicator's.
|
|
59
|
+
*/
|
|
60
|
+
onStepClick?: (index: number) => void;
|
|
61
|
+
/** Layout direction. `horizontal` collapses labels to the current step's on narrow screens. */
|
|
62
|
+
orientation?: StepsOrientation;
|
|
63
|
+
} & React.RefAttributes<HTMLOListElement>>;
|
|
64
|
+
export { stepsVariants };
|
|
65
|
+
//# sourceMappingURL=Steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;GAIG;AACH,QAAA,MAAM,aAAa;;8EAUjB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,UAAU,CAAC;AAEzD,yEAAyE;AACzE,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG;IACrB,yBAAyB;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,sCAAsC;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,2BAA2B;IAC3B,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC3B,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,+FAA+F;IAC/F,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC,CAAC;AAQF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK;IArChB,2BAA2B;WACpB,SAAS,QAAQ,EAAE;IAC1B,0FAA0F;aACjF,MAAM;IACf;;;;OAIG;kBACW,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;IACrC,+FAA+F;kBACjF,gBAAgB;0CAiG9B,CAAC;AAGH,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@sixthshift/design-system/utils";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Check } from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
/**
|
|
8
|
+
* Geometry only. Every colour reads a `--steps-*` component token whose value
|
|
9
|
+
* is decided by src/components/Steps/steps.recipe.css, selected by the
|
|
10
|
+
* `data-state` each item renders (`complete`, `current`, `upcoming`).
|
|
11
|
+
*/
|
|
12
|
+
const stepsVariants = cva("steps flex", {
|
|
13
|
+
variants: {
|
|
14
|
+
orientation: {
|
|
15
|
+
horizontal: "w-full flex-row items-start",
|
|
16
|
+
vertical: "flex-col",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
orientation: "horizontal",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
function stateOf(index, current) {
|
|
24
|
+
if (index < current)
|
|
25
|
+
return "complete";
|
|
26
|
+
if (index === current)
|
|
27
|
+
return "current";
|
|
28
|
+
return "upcoming";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Progress through a fixed sequence — checkout, onboarding, a multi-page
|
|
32
|
+
* form. Display-only: the step in progress is the `current` prop, owned by
|
|
33
|
+
* whatever runs the flow, so there is no internal state to control.
|
|
34
|
+
*
|
|
35
|
+
* Renders an `<ol>` (pass `aria-label`, e.g. "Checkout progress"); the
|
|
36
|
+
* current item carries `aria-current="step"`, and each indicator has a
|
|
37
|
+
* visually hidden status ("completed", "current") so the sequence reads
|
|
38
|
+
* correctly without the colours.
|
|
39
|
+
*
|
|
40
|
+
* With `onStepClick`, completed steps become buttons. Current and upcoming
|
|
41
|
+
* steps stay plain text: a step indicator that let you jump forward would be
|
|
42
|
+
* making the flow's validation decisions for it.
|
|
43
|
+
*
|
|
44
|
+
* Horizontally, every label shows from `sm` up; below that only the current
|
|
45
|
+
* step's label does, so four steps still fit a phone.
|
|
46
|
+
*/
|
|
47
|
+
export const Steps = React.forwardRef(({ className, steps, current, onStepClick, orientation = "horizontal", ...props }, ref) => {
|
|
48
|
+
const isHorizontal = orientation === "horizontal";
|
|
49
|
+
return (_jsx("ol", { ref: ref, "data-orientation": orientation, className: stepsVariants({ orientation, className }), ...props, children: steps.map((step, index) => {
|
|
50
|
+
const state = stateOf(index, current);
|
|
51
|
+
const isLast = index === steps.length - 1;
|
|
52
|
+
const clickable = state === "complete" && onStepClick !== undefined;
|
|
53
|
+
const indicator = (_jsx("span", { className: "steps-indicator border-(color:--steps-indicator-border) relative z-10 flex size-8 shrink-0 items-center justify-center rounded-full border-2 bg-(--steps-indicator-bg) font-semibold text-(--steps-indicator-fg) text-sm transition-colors", children: state === "complete" ? _jsx(Check, { "aria-hidden": "true", className: "size-4", strokeWidth: 3 }) : index + 1 }));
|
|
54
|
+
const text = (_jsxs("span", { className: cn("flex min-w-0 flex-col", isHorizontal ? "items-center text-center" : "pt-1", isHorizontal && state !== "current" && "max-sm:sr-only"), children: [_jsx("span", { className: "font-medium text-(--steps-label-fg) text-sm", children: step.label }), step.description !== undefined && _jsx("span", { className: "text-(--steps-description-fg) text-xs", children: step.description }), state !== "upcoming" && _jsx("span", { className: "sr-only", children: state === "complete" ? "(completed)" : "(current)" })] }));
|
|
55
|
+
const body = (_jsxs(_Fragment, { children: [indicator, text] }));
|
|
56
|
+
const bodyClass = cn("flex gap-2", isHorizontal ? "flex-col items-center" : "flex-row items-start gap-3");
|
|
57
|
+
return (_jsxs("li", { "data-state": state, "aria-current": state === "current" ? "step" : undefined, className: cn("steps-item relative", isHorizontal ? "flex flex-1 justify-center" : "flex pb-6 last:pb-0"), children: [!isLast && (_jsx("span", { "aria-hidden": "true", className: cn("steps-connector absolute bg-(--steps-connector-bg)", isHorizontal ? "top-4 left-1/2 h-0.5 w-full -translate-y-1/2" : "top-8 bottom-0 left-4 w-0.5 -translate-x-1/2") })), clickable ? (_jsx("button", { type: "button", onClick: () => onStepClick(index), className: cn(bodyClass, "focus-visible:ring-(color:--steps-ring) cursor-pointer rounded-md focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 [&:hover_.steps-indicator]:bg-(--steps-indicator-bg-hovered)"), children: body })) : (_jsx("span", { className: bodyClass, children: body }))] }, index));
|
|
58
|
+
}) }));
|
|
59
|
+
});
|
|
60
|
+
Steps.displayName = "Steps";
|
|
61
|
+
export { stepsVariants };
|
|
62
|
+
//# sourceMappingURL=Steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../../src/components/Steps/Steps.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;GAIG;AACH,MAAM,aAAa,GAAG,GAAG,CAAC,YAAY,EAAE;IACtC,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,UAAU,EAAE,6BAA6B;YACzC,QAAQ,EAAE,UAAU;SACrB;KACF;IACD,eAAe,EAAE;QACf,WAAW,EAAE,YAAY;KAC1B;CACF,CAAC,CAAC;AA6BH,SAAS,OA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AC,GACC,CACN,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Steps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,EAA0C,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixthshift/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Personal design system - tokens, theme, and component library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -314,6 +314,26 @@
|
|
|
314
314
|
"./bar-chart": {
|
|
315
315
|
"types": "./dist/components/BarChart/index.d.ts",
|
|
316
316
|
"import": "./dist/components/BarChart/index.js"
|
|
317
|
+
},
|
|
318
|
+
"./data-table": {
|
|
319
|
+
"types": "./dist/components/DataTable/index.d.ts",
|
|
320
|
+
"import": "./dist/components/DataTable/index.js"
|
|
321
|
+
},
|
|
322
|
+
"./file-dropzone": {
|
|
323
|
+
"types": "./dist/components/FileDropzone/index.d.ts",
|
|
324
|
+
"import": "./dist/components/FileDropzone/index.js"
|
|
325
|
+
},
|
|
326
|
+
"./image-gallery": {
|
|
327
|
+
"types": "./dist/components/ImageGallery/index.d.ts",
|
|
328
|
+
"import": "./dist/components/ImageGallery/index.js"
|
|
329
|
+
},
|
|
330
|
+
"./number-stepper": {
|
|
331
|
+
"types": "./dist/components/NumberStepper/index.d.ts",
|
|
332
|
+
"import": "./dist/components/NumberStepper/index.js"
|
|
333
|
+
},
|
|
334
|
+
"./steps": {
|
|
335
|
+
"types": "./dist/components/Steps/index.d.ts",
|
|
336
|
+
"import": "./dist/components/Steps/index.js"
|
|
317
337
|
}
|
|
318
338
|
},
|
|
319
339
|
"scripts": {
|