jaci-ui 0.5.0 → 0.6.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +31 -0
  3. package/dist/components/navigation-menu/navigation-menu.cjs +3 -3
  4. package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
  5. package/dist/components/navigation-menu/navigation-menu.js +3 -3
  6. package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
  7. package/dist/components/sidebar/sidebar.cjs +59 -11
  8. package/dist/components/sidebar/sidebar.cjs.map +1 -1
  9. package/dist/components/sidebar/sidebar.d.cts +13 -0
  10. package/dist/components/sidebar/sidebar.d.ts +13 -0
  11. package/dist/components/sidebar/sidebar.js +59 -13
  12. package/dist/components/sidebar/sidebar.js.map +1 -1
  13. package/dist/components/stepper/index.d.cts +2 -0
  14. package/dist/components/stepper/index.d.ts +2 -0
  15. package/dist/components/stepper/stepper.cjs +341 -0
  16. package/dist/components/stepper/stepper.cjs.map +1 -0
  17. package/dist/components/stepper/stepper.d.cts +52 -0
  18. package/dist/components/stepper/stepper.d.ts +52 -0
  19. package/dist/components/stepper/stepper.js +330 -0
  20. package/dist/components/stepper/stepper.js.map +1 -0
  21. package/dist/components/toast/toast.cjs +3 -1
  22. package/dist/components/toast/toast.cjs.map +1 -1
  23. package/dist/components/toast/toast.js +3 -1
  24. package/dist/components/toast/toast.js.map +1 -1
  25. package/dist/index.cjs +13 -0
  26. package/dist/index.d.cts +3 -1
  27. package/dist/index.d.ts +3 -1
  28. package/dist/index.js +2 -1
  29. package/dist/styled-system/recipes/sidebar.cjs +3 -0
  30. package/dist/styled-system/recipes/sidebar.cjs.map +1 -1
  31. package/dist/styled-system/recipes/sidebar.js +3 -0
  32. package/dist/styled-system/recipes/sidebar.js.map +1 -1
  33. package/dist/styled-system/recipes/stepper.cjs +53 -0
  34. package/dist/styled-system/recipes/stepper.cjs.map +1 -0
  35. package/dist/styled-system/recipes/stepper.js +53 -0
  36. package/dist/styled-system/recipes/stepper.js.map +1 -0
  37. package/dist/styles.css +365 -17
  38. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","names":[],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n { children, className, defaultOpen = true, onOpenChange, open: controlledOpen, ...props },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n\n return (\n <SidebarContext.Provider value={context}>\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n </SidebarContext.Provider>\n );\n});\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarL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C;EACL,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,eAAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAe,WAA+C,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
1
+ {"version":3,"file":"sidebar.js","names":["BaseDialog"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Renders the sidebar as a modal mobile surface when set to overlay. */\n mode?: \"static\" | \"overlay\";\n /** Allows Escape to be disabled for overlay mode. */\n closeOnEscape?: boolean;\n /** Allows outside presses to be disabled for overlay mode. */\n closeOnOutsidePress?: boolean;\n /** Restores focus to the element that opened the overlay. */\n restoreFocus?: boolean;\n /** Controls whether the overlay traps focus and locks page scroll. */\n modal?: boolean | \"trap-focus\";\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n {\n children,\n className,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n defaultOpen = true,\n modal = true,\n mode = \"static\",\n onOpenChange,\n open: controlledOpen,\n restoreFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n\n const surface = (\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n );\n\n if (mode === \"overlay\") {\n return (\n <SidebarContext.Provider value={context}>\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(nextOpen, details) => {\n if (\n !nextOpen &&\n ((!closeOnEscape && details.reason === \"escape-key\") ||\n (!closeOnOutsidePress && details.reason === \"outside-press\"))\n ) {\n details.cancel();\n return;\n }\n setOpen(nextOpen);\n }}\n >\n <BaseDialog.Portal>\n <BaseDialog.Backdrop\n className={cx(styles.backdrop)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-backdrop\"\n />\n <BaseDialog.Viewport className={cx(styles.viewport)} data-slot=\"sidebar-viewport\">\n <BaseDialog.Popup\n aria-label={props[\"aria-label\"] ?? \"Sidebar navigation\"}\n className={cx(styles.popup)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-popup\"\n finalFocus={restoreFocus}\n initialFocus\n >\n {surface}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n </SidebarContext.Provider>\n );\n }\n\n return <SidebarContext.Provider value={context}>{surface}</SidebarContext.Provider>;\n});\n\nexport type SidebarPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\nexport const SidebarPortal: typeof BaseDialog.Portal = BaseDialog.Portal;\n\nexport type SidebarBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\nexport const SidebarBackdrop = forwardRef<HTMLDivElement, SidebarBackdropProps>(\n function SidebarBackdrop({ className, ...props }, ref) {\n const { open } = useSidebar();\n return (\n <BaseDialog.Backdrop\n {...props}\n className={withRecipeClassName(sidebar({ open }).backdrop, className)}\n data-slot=\"sidebar-backdrop\"\n ref={ref}\n />\n );\n },\n);\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Portal: SidebarPortal,\n Backdrop: SidebarBackdrop,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarLabel,\n};\n"],"mappings":";;;;;;;;AAmBA,MAAM,iBAAiB,cAA0C,IAAI;;;;;;AAOrE,SAAgB,aAAa;CAC3B,MAAM,UAAU,WAAW,cAAc;CAEzC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,0DAA0D;CAG5E,OAAO;AACT;AAEA,SAAS,mBAAmB;CAC1B,MAAM,EAAE,SAAS,WAAW;CAC5B,OAAO,QAAQ,EAAE,KAAK,CAAC;AACzB;;;;AAyBA,MAAa,cAAc,WAA0C,SAAS,YAC5E,EACE,UACA,WACA,gBAAgB,MAChB,sBAAsB,MACtB,cAAc,MACd,QAAQ,MACR,OAAO,UACP,cACA,MAAM,gBACN,eAAe,MACf,GAAG,SAEL,KACA;CACA,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,WAAW;CACpE,MAAM,eAAe,mBAAmB,KAAA;CACxC,MAAM,OAAO,kBAAkB;CAE/B,MAAM,UAAU,aACb,aAAsB;EACrB,IAAI,CAAC,cACH,oBAAoB,QAAQ;EAG9B,eAAe,QAAQ;CACzB,GACA,CAAC,cAAc,YAAY,CAC7B;CAEA,MAAM,SAAS,kBAAkB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AAW,GAAG,OAAO,QAAQ,SAAS;EACtC,aAAU;CACX,CAAA;AAEL,CAAC;;;;;;AAYD,MAAa,cAAc,WAAgD,SAAS,YAClF,EAAE,gBAAgB,aAAa,SAAS,OAAO,WAAW,GAAG,SAC7D,KACA;CACA,MAAM,EAAE,SAAS,WAAW;CAC5B,MAAM,SAAS,QAAQ;EAAE;EAAQ;CAAK,CAAC;CAEvC,OACE,oBAAC,KAAD;EACE,GAAI;EACJ,gBAAc,gBAAgB,SAAS,SAAS,KAAA;EAC3C;EACL,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,eAAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAe,WAA+C,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
@@ -0,0 +1,2 @@
1
+ import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperItemProps, StepperList, StepperNavigationButtonProps, StepperNext, StepperOrientation, StepperPrevious, StepperRoot, StepperRootProps, StepperSeparator, StepperStatus, StepperTitle, StepperTrigger, StepperTriggerProps } from "./stepper.cjs";
2
+ export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, type StepperItemProps, StepperList, type StepperNavigationButtonProps, StepperNext, type StepperOrientation, StepperPrevious, StepperRoot, type StepperRootProps, StepperSeparator, type StepperStatus, StepperTitle, StepperTrigger, type StepperTriggerProps };
@@ -0,0 +1,2 @@
1
+ import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperItemProps, StepperList, StepperNavigationButtonProps, StepperNext, StepperOrientation, StepperPrevious, StepperRoot, StepperRootProps, StepperSeparator, StepperStatus, StepperTitle, StepperTrigger, StepperTriggerProps } from "./stepper.js";
2
+ export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, type StepperItemProps, StepperList, type StepperNavigationButtonProps, StepperNext, type StepperOrientation, StepperPrevious, StepperRoot, type StepperRootProps, StepperSeparator, type StepperStatus, StepperTitle, StepperTrigger, type StepperTriggerProps };
@@ -0,0 +1,341 @@
1
+ "use client";
2
+ const require_cx = require("../../styled-system/css/cx.cjs");
3
+ const require_stepper = require("../../styled-system/recipes/stepper.cjs");
4
+ let react = require("react");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ //#region src/components/stepper/stepper.tsx
7
+ const StepperContext = (0, react.createContext)(null);
8
+ const StepperItemContext = (0, react.createContext)(null);
9
+ function useStepperContext() {
10
+ const context = (0, react.useContext)(StepperContext);
11
+ if (!context) throw new Error("Stepper parts must be rendered inside Stepper.Root.");
12
+ return context;
13
+ }
14
+ function useStepperItemContext() {
15
+ const context = (0, react.useContext)(StepperItemContext);
16
+ if (!context) throw new Error("This Stepper part must be rendered inside Stepper.Item.");
17
+ return context;
18
+ }
19
+ const StepperRoot = (0, react.forwardRef)(function StepperRoot({ allowStepSelect = true, "aria-label": ariaLabel, children, className, defaultValue, disabled = false, form, linear = false, name, onValueChange, orientation = "horizontal", value: controlledValue, ...props }, ref) {
20
+ const [uncontrolledValue, setUncontrolledValue] = (0, react.useState)(defaultValue);
21
+ const [records, setRecords] = (0, react.useState)([]);
22
+ const activeValue = controlledValue ?? uncontrolledValue ?? records[0]?.value;
23
+ const register = (0, react.useCallback)((record) => {
24
+ setRecords((current) => {
25
+ const index = current.findIndex((item) => item.value === record.value);
26
+ if (index === -1) return [...current, record];
27
+ const currentRecord = current[index];
28
+ if (!currentRecord) return current;
29
+ if (currentRecord.disabled === record.disabled && currentRecord.status === record.status) return current;
30
+ const next = current.slice();
31
+ next[index] = record;
32
+ return next;
33
+ });
34
+ }, []);
35
+ const unregister = (0, react.useCallback)((valueToRemove) => {
36
+ setRecords((current) => current.filter((item) => item.value !== valueToRemove));
37
+ }, []);
38
+ const goTo = (0, react.useCallback)((nextValue, options) => {
39
+ if (disabled) return;
40
+ const targetIndex = records.findIndex((item) => item.value === nextValue);
41
+ const activeIndex = records.findIndex((item) => item.value === activeValue);
42
+ const target = records[targetIndex];
43
+ if (!target || target.disabled) return;
44
+ if (nextValue === activeValue) return;
45
+ if (!allowStepSelect && !options?.fromNavigation && nextValue !== activeValue) return;
46
+ if (linear && activeIndex >= 0 && targetIndex > activeIndex + 1) return;
47
+ if (controlledValue === void 0) setUncontrolledValue(nextValue);
48
+ onValueChange?.(nextValue);
49
+ }, [
50
+ activeValue,
51
+ allowStepSelect,
52
+ controlledValue,
53
+ disabled,
54
+ linear,
55
+ onValueChange,
56
+ records
57
+ ]);
58
+ const move = (0, react.useCallback)((direction) => {
59
+ let index = records.findIndex((item) => item.value === activeValue) + direction;
60
+ while (index >= 0 && index < records.length && records[index]?.disabled) index += direction;
61
+ const target = records[index];
62
+ if (target) goTo(target.value, { fromNavigation: true });
63
+ }, [
64
+ activeValue,
65
+ goTo,
66
+ records
67
+ ]);
68
+ const moveToBoundary = (0, react.useCallback)((direction) => {
69
+ const target = (direction === -1 ? records : records.slice().reverse()).find((record) => !record.disabled);
70
+ if (target) goTo(target.value, { fromNavigation: true });
71
+ }, [goTo, records]);
72
+ const getStatus = (0, react.useCallback)((itemValue, explicitStatus, itemDisabled = false) => {
73
+ if (itemDisabled || disabled) return "disabled";
74
+ if (explicitStatus) return explicitStatus;
75
+ const itemIndex = records.findIndex((item) => item.value === itemValue);
76
+ const activeIndex = records.findIndex((item) => item.value === activeValue);
77
+ if (itemValue === activeValue || activeIndex < 0 && itemIndex === 0) return "current";
78
+ if (itemIndex >= 0 && activeIndex >= 0 && itemIndex < activeIndex) return "complete";
79
+ return "upcoming";
80
+ }, [
81
+ activeValue,
82
+ disabled,
83
+ records
84
+ ]);
85
+ const context = (0, react.useMemo)(() => ({
86
+ activeValue,
87
+ allowStepSelect,
88
+ disabled,
89
+ getStatus,
90
+ goTo,
91
+ linear,
92
+ move,
93
+ moveToBoundary,
94
+ orientation,
95
+ register,
96
+ unregister
97
+ }), [
98
+ activeValue,
99
+ allowStepSelect,
100
+ disabled,
101
+ getStatus,
102
+ goTo,
103
+ linear,
104
+ move,
105
+ moveToBoundary,
106
+ orientation,
107
+ register,
108
+ unregister
109
+ ]);
110
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepperContext.Provider, {
111
+ value: context,
112
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
113
+ ...props,
114
+ "aria-label": ariaLabel ?? "Progress",
115
+ className: require_cx.cx(require_stepper.stepper({ orientation }).root, className),
116
+ "data-jaci-component": "stepper",
117
+ "data-orientation": orientation,
118
+ "data-slot": "stepper",
119
+ "data-state": disabled ? "disabled" : "active",
120
+ ref,
121
+ children: [children, name ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
122
+ "aria-hidden": "true",
123
+ name,
124
+ type: "hidden",
125
+ value: activeValue ?? "",
126
+ form
127
+ }) : null]
128
+ })
129
+ });
130
+ });
131
+ const StepperList = (0, react.forwardRef)(function StepperList({ className, ...props }, ref) {
132
+ const { orientation } = useStepperContext();
133
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
134
+ ...props,
135
+ className: require_cx.cx(require_stepper.stepper({ orientation }).list, className),
136
+ "data-slot": "stepper-list",
137
+ ref
138
+ });
139
+ });
140
+ const StepperItem = (0, react.forwardRef)(function StepperItem({ children, className, disabled = false, status, value, ...props }, ref) {
141
+ const context = useStepperContext();
142
+ const resolvedStatus = context.getStatus(value, status, disabled);
143
+ (0, react.useEffect)(() => {
144
+ const record = {
145
+ disabled: disabled || status === "disabled",
146
+ value
147
+ };
148
+ if (status !== void 0) record.status = status;
149
+ context.register(record);
150
+ return () => context.unregister(value);
151
+ }, [
152
+ context.register,
153
+ context.unregister,
154
+ disabled,
155
+ status,
156
+ value
157
+ ]);
158
+ const itemContext = (0, react.useMemo)(() => ({
159
+ disabled: disabled || context.disabled || resolvedStatus === "disabled",
160
+ status: resolvedStatus,
161
+ value
162
+ }), [
163
+ context.disabled,
164
+ disabled,
165
+ resolvedStatus,
166
+ value
167
+ ]);
168
+ const styles = require_stepper.stepper({
169
+ orientation: context.orientation,
170
+ status: resolvedStatus
171
+ });
172
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepperItemContext.Provider, {
173
+ value: itemContext,
174
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
175
+ ...props,
176
+ "aria-disabled": itemContext.disabled || void 0,
177
+ className: require_cx.cx(styles.item, className),
178
+ "data-disabled": itemContext.disabled || void 0,
179
+ "data-jaci-component": "stepper-item",
180
+ "data-slot": "stepper-item",
181
+ "data-status": resolvedStatus,
182
+ "data-value": value,
183
+ ref,
184
+ children
185
+ })
186
+ });
187
+ });
188
+ const StepperTrigger = (0, react.forwardRef)(function StepperTrigger({ className, onClick, onKeyDown, type = "button", ...props }, ref) {
189
+ const context = useStepperContext();
190
+ const item = useStepperItemContext();
191
+ const styles = require_stepper.stepper({
192
+ orientation: context.orientation,
193
+ status: item.status
194
+ });
195
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
196
+ ...props,
197
+ "aria-current": item.status === "current" ? "step" : void 0,
198
+ "aria-disabled": item.disabled || !context.allowStepSelect && item.status !== "current" || void 0,
199
+ className: require_cx.cx(styles.trigger, className),
200
+ "data-disabled": item.disabled || void 0,
201
+ "data-slot": "stepper-trigger",
202
+ "data-status": item.status,
203
+ disabled: context.disabled || item.disabled,
204
+ onClick: (event) => {
205
+ if (!event.defaultPrevented) context.goTo(item.value);
206
+ onClick?.(event);
207
+ },
208
+ onKeyDown: (event) => {
209
+ const isForwardKey = context.orientation === "horizontal" && event.key === "ArrowRight" || context.orientation === "vertical" && event.key === "ArrowDown";
210
+ const isBackwardKey = context.orientation === "horizontal" && event.key === "ArrowLeft" || context.orientation === "vertical" && event.key === "ArrowUp";
211
+ if (isForwardKey) {
212
+ event.preventDefault();
213
+ context.move(1);
214
+ } else if (isBackwardKey) {
215
+ event.preventDefault();
216
+ context.move(-1);
217
+ } else if (event.key === "Home") {
218
+ event.preventDefault();
219
+ context.moveToBoundary(-1);
220
+ } else if (event.key === "End") {
221
+ event.preventDefault();
222
+ context.moveToBoundary(1);
223
+ }
224
+ onKeyDown?.(event);
225
+ },
226
+ ref,
227
+ type
228
+ });
229
+ });
230
+ const StepperIndicator = (0, react.forwardRef)(function StepperIndicator({ children, className, ...props }, ref) {
231
+ const { orientation } = useStepperContext();
232
+ const item = useStepperItemContext();
233
+ const styles = require_stepper.stepper({
234
+ orientation,
235
+ status: item.status
236
+ });
237
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
238
+ ...props,
239
+ "aria-hidden": props["aria-hidden"] ?? true,
240
+ className: require_cx.cx(styles.indicator, className),
241
+ "data-slot": "stepper-indicator",
242
+ "data-status": item.status,
243
+ ref,
244
+ children: children ?? (item.status === "complete" ? "✓" : "")
245
+ });
246
+ });
247
+ function createSpanSlot(slot) {
248
+ return (0, react.forwardRef)(function StepperSlot({ className, ...props }, ref) {
249
+ const { orientation } = useStepperContext();
250
+ const styles = require_stepper.stepper({
251
+ orientation,
252
+ status: useStepperItemContext().status
253
+ });
254
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
255
+ ...props,
256
+ className: require_cx.cx(styles[slot], className),
257
+ "data-slot": `stepper-${slot}`,
258
+ ref
259
+ });
260
+ });
261
+ }
262
+ const StepperTitle = createSpanSlot("title");
263
+ const StepperDescription = createSpanSlot("description");
264
+ const StepperContent = (0, react.forwardRef)(function StepperContent({ className, hidden, ...props }, ref) {
265
+ const item = useStepperItemContext();
266
+ const { orientation } = useStepperContext();
267
+ const styles = require_stepper.stepper({
268
+ orientation,
269
+ status: item.status
270
+ });
271
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
272
+ ...props,
273
+ className: require_cx.cx(styles.content, className),
274
+ "data-slot": "stepper-content",
275
+ hidden: hidden ?? item.status !== "current",
276
+ ref
277
+ });
278
+ });
279
+ const StepperSeparator = createSpanSlot("separator");
280
+ const StepperPrevious = (0, react.forwardRef)(function StepperPrevious({ children = "Previous", className, disabled: disabledProp, ...props }, ref) {
281
+ const context = useStepperContext();
282
+ const styles = require_stepper.stepper({ orientation: context.orientation });
283
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
284
+ ...props,
285
+ className: require_cx.cx(styles.previous, className),
286
+ "data-slot": "stepper-previous",
287
+ disabled: disabledProp || context.disabled,
288
+ onClick: (event) => {
289
+ context.move(-1);
290
+ props.onClick?.(event);
291
+ },
292
+ ref,
293
+ type: props.type ?? "button",
294
+ children
295
+ });
296
+ });
297
+ const StepperNext = (0, react.forwardRef)(function StepperNext({ children = "Next", className, disabled: disabledProp, ...props }, ref) {
298
+ const context = useStepperContext();
299
+ const styles = require_stepper.stepper({ orientation: context.orientation });
300
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
301
+ ...props,
302
+ className: require_cx.cx(styles.next, className),
303
+ "data-slot": "stepper-next",
304
+ disabled: disabledProp || context.disabled,
305
+ onClick: (event) => {
306
+ context.move(1);
307
+ props.onClick?.(event);
308
+ },
309
+ ref,
310
+ type: props.type ?? "button",
311
+ children
312
+ });
313
+ });
314
+ const Stepper = {
315
+ Root: StepperRoot,
316
+ List: StepperList,
317
+ Item: StepperItem,
318
+ Trigger: StepperTrigger,
319
+ Indicator: StepperIndicator,
320
+ Title: StepperTitle,
321
+ Description: StepperDescription,
322
+ Content: StepperContent,
323
+ Separator: StepperSeparator,
324
+ Previous: StepperPrevious,
325
+ Next: StepperNext
326
+ };
327
+ //#endregion
328
+ exports.Stepper = Stepper;
329
+ exports.StepperContent = StepperContent;
330
+ exports.StepperDescription = StepperDescription;
331
+ exports.StepperIndicator = StepperIndicator;
332
+ exports.StepperItem = StepperItem;
333
+ exports.StepperList = StepperList;
334
+ exports.StepperNext = StepperNext;
335
+ exports.StepperPrevious = StepperPrevious;
336
+ exports.StepperRoot = StepperRoot;
337
+ exports.StepperSeparator = StepperSeparator;
338
+ exports.StepperTitle = StepperTitle;
339
+ exports.StepperTrigger = StepperTrigger;
340
+
341
+ //# sourceMappingURL=stepper.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepper.cjs","names":["cx","stepper"],"sources":["../../../src/components/stepper/stepper.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stepper } from \"../../styled-system/recipes\";\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\nexport type StepperStatus = \"current\" | \"complete\" | \"upcoming\" | \"disabled\";\n\ninterface StepRecord {\n value: string;\n disabled: boolean;\n status?: StepperStatus;\n}\n\ninterface StepperContextValue {\n activeValue: string | undefined;\n allowStepSelect: boolean;\n disabled: boolean;\n getStatus: (value: string, status?: StepperStatus, disabled?: boolean) => StepperStatus;\n goTo: (value: string, options?: { fromNavigation?: boolean }) => void;\n linear: boolean;\n orientation: StepperOrientation;\n register: (record: StepRecord) => void;\n unregister: (value: string) => void;\n move: (direction: -1 | 1) => void;\n moveToBoundary: (direction: -1 | 1) => void;\n}\n\ninterface StepperItemContextValue {\n disabled: boolean;\n status: StepperStatus;\n value: string;\n}\n\nconst StepperContext = createContext<StepperContextValue | null>(null);\nconst StepperItemContext = createContext<StepperItemContextValue | null>(null);\n\nfunction useStepperContext() {\n const context = useContext(StepperContext);\n if (!context) throw new Error(\"Stepper parts must be rendered inside Stepper.Root.\");\n return context;\n}\n\nfunction useStepperItemContext() {\n const context = useContext(StepperItemContext);\n if (!context) throw new Error(\"This Stepper part must be rendered inside Stepper.Item.\");\n return context;\n}\n\nexport interface StepperRootProps extends Omit<ComponentPropsWithoutRef<\"nav\">, \"children\"> {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n orientation?: StepperOrientation;\n linear?: boolean;\n allowStepSelect?: boolean;\n disabled?: boolean;\n name?: string;\n form?: string;\n children?: ReactNode;\n}\n\nexport const StepperRoot = forwardRef<HTMLElement, StepperRootProps>(function StepperRoot(\n {\n allowStepSelect = true,\n \"aria-label\": ariaLabel,\n children,\n className,\n defaultValue,\n disabled = false,\n form,\n linear = false,\n name,\n onValueChange,\n orientation = \"horizontal\",\n value: controlledValue,\n ...props\n },\n ref,\n) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [records, setRecords] = useState<StepRecord[]>([]);\n const activeValue = controlledValue ?? uncontrolledValue ?? records[0]?.value;\n\n const register = useCallback((record: StepRecord) => {\n setRecords((current) => {\n const index = current.findIndex((item) => item.value === record.value);\n if (index === -1) return [...current, record];\n const currentRecord = current[index];\n if (!currentRecord) return current;\n if (currentRecord.disabled === record.disabled && currentRecord.status === record.status) {\n return current;\n }\n const next = current.slice();\n next[index] = record;\n return next;\n });\n }, []);\n\n const unregister = useCallback((valueToRemove: string) => {\n setRecords((current) => current.filter((item) => item.value !== valueToRemove));\n }, []);\n\n const goTo = useCallback(\n (nextValue: string, options?: { fromNavigation?: boolean }) => {\n if (disabled) return;\n const targetIndex = records.findIndex((item) => item.value === nextValue);\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n const target = records[targetIndex];\n if (!target || target.disabled) return;\n if (nextValue === activeValue) return;\n if (!allowStepSelect && !options?.fromNavigation && nextValue !== activeValue) return;\n if (linear && activeIndex >= 0 && targetIndex > activeIndex + 1) return;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [activeValue, allowStepSelect, controlledValue, disabled, linear, onValueChange, records],\n );\n\n const move = useCallback(\n (direction: -1 | 1) => {\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n let index = activeIndex + direction;\n while (index >= 0 && index < records.length && records[index]?.disabled) index += direction;\n const target = records[index];\n if (target) goTo(target.value, { fromNavigation: true });\n },\n [activeValue, goTo, records],\n );\n\n const moveToBoundary = useCallback(\n (direction: -1 | 1) => {\n const candidates = direction === -1 ? records : records.slice().reverse();\n const target = candidates.find((record) => !record.disabled);\n if (target) goTo(target.value, { fromNavigation: true });\n },\n [goTo, records],\n );\n\n const getStatus = useCallback(\n (itemValue: string, explicitStatus?: StepperStatus, itemDisabled = false) => {\n if (itemDisabled || disabled) return \"disabled\";\n if (explicitStatus) return explicitStatus;\n const itemIndex = records.findIndex((item) => item.value === itemValue);\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n if (itemValue === activeValue || (activeIndex < 0 && itemIndex === 0)) return \"current\";\n if (itemIndex >= 0 && activeIndex >= 0 && itemIndex < activeIndex) return \"complete\";\n return \"upcoming\";\n },\n [activeValue, disabled, records],\n );\n\n const context = useMemo(\n () => ({\n activeValue,\n allowStepSelect,\n disabled,\n getStatus,\n goTo,\n linear,\n move,\n moveToBoundary,\n orientation,\n register,\n unregister,\n }),\n [\n activeValue,\n allowStepSelect,\n disabled,\n getStatus,\n goTo,\n linear,\n move,\n moveToBoundary,\n orientation,\n register,\n unregister,\n ],\n );\n\n return (\n <StepperContext.Provider value={context}>\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Progress\"}\n className={cx(stepper({ orientation }).root, className)}\n data-jaci-component=\"stepper\"\n data-orientation={orientation}\n data-slot=\"stepper\"\n data-state={disabled ? \"disabled\" : \"active\"}\n ref={ref}\n >\n {children}\n {name ? (\n <input\n aria-hidden=\"true\"\n name={name}\n type=\"hidden\"\n value={activeValue ?? \"\"}\n form={form}\n />\n ) : null}\n </nav>\n </StepperContext.Provider>\n );\n});\n\nexport type StepperListProps = ComponentPropsWithoutRef<\"ol\">;\nexport const StepperList = forwardRef<HTMLOListElement, StepperListProps>(function StepperList(\n { className, ...props },\n ref,\n) {\n const { orientation } = useStepperContext();\n return (\n <ol\n {...props}\n className={cx(stepper({ orientation }).list, className)}\n data-slot=\"stepper-list\"\n ref={ref}\n />\n );\n});\n\nexport interface StepperItemProps extends ComponentPropsWithoutRef<\"li\"> {\n value: string;\n status?: StepperStatus;\n disabled?: boolean;\n}\n\nexport const StepperItem = forwardRef<HTMLLIElement, StepperItemProps>(function StepperItem(\n { children, className, disabled = false, status, value, ...props },\n ref,\n) {\n const context = useStepperContext();\n const resolvedStatus = context.getStatus(value, status, disabled);\n useEffect(() => {\n const record: StepRecord = { disabled: disabled || status === \"disabled\", value };\n if (status !== undefined) record.status = status;\n context.register(record);\n return () => context.unregister(value);\n }, [context.register, context.unregister, disabled, status, value]);\n const itemContext = useMemo<StepperItemContextValue>(\n () => ({\n disabled: disabled || context.disabled || resolvedStatus === \"disabled\",\n status: resolvedStatus,\n value,\n }),\n [context.disabled, disabled, resolvedStatus, value],\n );\n const styles = stepper({ orientation: context.orientation, status: resolvedStatus });\n\n return (\n <StepperItemContext.Provider value={itemContext}>\n <li\n {...props}\n aria-disabled={itemContext.disabled || undefined}\n className={cx(styles.item, className)}\n data-disabled={itemContext.disabled || undefined}\n data-jaci-component=\"stepper-item\"\n data-slot=\"stepper-item\"\n data-status={resolvedStatus}\n data-value={value}\n ref={ref}\n >\n {children}\n </li>\n </StepperItemContext.Provider>\n );\n});\n\nexport type StepperTriggerProps = ComponentPropsWithoutRef<\"button\">;\nexport const StepperTrigger = forwardRef<HTMLButtonElement, StepperTriggerProps>(\n function StepperTrigger({ className, onClick, onKeyDown, type = \"button\", ...props }, ref) {\n const context = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation: context.orientation, status: item.status });\n return (\n <button\n {...props}\n aria-current={item.status === \"current\" ? \"step\" : undefined}\n aria-disabled={\n item.disabled || (!context.allowStepSelect && item.status !== \"current\") || undefined\n }\n className={cx(styles.trigger, className)}\n data-disabled={item.disabled || undefined}\n data-slot=\"stepper-trigger\"\n data-status={item.status}\n disabled={context.disabled || item.disabled}\n onClick={(event) => {\n if (!event.defaultPrevented) context.goTo(item.value);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n const isForwardKey =\n (context.orientation === \"horizontal\" && event.key === \"ArrowRight\") ||\n (context.orientation === \"vertical\" && event.key === \"ArrowDown\");\n const isBackwardKey =\n (context.orientation === \"horizontal\" && event.key === \"ArrowLeft\") ||\n (context.orientation === \"vertical\" && event.key === \"ArrowUp\");\n if (isForwardKey) {\n event.preventDefault();\n context.move(1);\n } else if (isBackwardKey) {\n event.preventDefault();\n context.move(-1);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n context.moveToBoundary(-1);\n } else if (event.key === \"End\") {\n event.preventDefault();\n context.moveToBoundary(1);\n }\n onKeyDown?.(event);\n }}\n ref={ref}\n type={type}\n />\n );\n },\n);\n\nexport type StepperIndicatorProps = ComponentPropsWithoutRef<\"span\">;\nexport const StepperIndicator = forwardRef<HTMLSpanElement, StepperIndicatorProps>(\n function StepperIndicator({ children, className, ...props }, ref) {\n const { orientation } = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <span\n {...props}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(styles.indicator, className)}\n data-slot=\"stepper-indicator\"\n data-status={item.status}\n ref={ref}\n >\n {children ?? (item.status === \"complete\" ? \"✓\" : \"\")}\n </span>\n );\n },\n);\n\nfunction createSpanSlot(slot: \"title\" | \"description\" | \"separator\") {\n return forwardRef<HTMLSpanElement, ComponentPropsWithoutRef<\"span\">>(function StepperSlot(\n { className, ...props },\n ref,\n ) {\n const { orientation } = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <span\n {...props}\n className={cx(styles[slot], className)}\n data-slot={`stepper-${slot}`}\n ref={ref}\n />\n );\n });\n}\n\nexport const StepperTitle = createSpanSlot(\"title\");\nexport const StepperDescription = createSpanSlot(\"description\");\n\nexport const StepperContent = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<\"div\">>(\n function StepperContent({ className, hidden, ...props }, ref) {\n const item = useStepperItemContext();\n const { orientation } = useStepperContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <div\n {...props}\n className={cx(styles.content, className)}\n data-slot=\"stepper-content\"\n hidden={hidden ?? item.status !== \"current\"}\n ref={ref}\n />\n );\n },\n);\n\nexport const StepperSeparator = createSpanSlot(\"separator\");\n\nexport interface StepperNavigationButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\n\nexport const StepperPrevious = forwardRef<HTMLButtonElement, StepperNavigationButtonProps>(\n function StepperPrevious(\n { children = \"Previous\", className, disabled: disabledProp, ...props },\n ref,\n ) {\n const context = useStepperContext();\n const styles = stepper({ orientation: context.orientation });\n return (\n <button\n {...props}\n className={cx(styles.previous, className)}\n data-slot=\"stepper-previous\"\n disabled={disabledProp || context.disabled}\n onClick={(event) => {\n context.move(-1);\n props.onClick?.(event);\n }}\n ref={ref}\n type={props.type ?? \"button\"}\n >\n {children}\n </button>\n );\n },\n);\n\nexport const StepperNext = forwardRef<HTMLButtonElement, StepperNavigationButtonProps>(\n function StepperNext({ children = \"Next\", className, disabled: disabledProp, ...props }, ref) {\n const context = useStepperContext();\n const styles = stepper({ orientation: context.orientation });\n return (\n <button\n {...props}\n className={cx(styles.next, className)}\n data-slot=\"stepper-next\"\n disabled={disabledProp || context.disabled}\n onClick={(event) => {\n context.move(1);\n props.onClick?.(event);\n }}\n ref={ref}\n type={props.type ?? \"button\"}\n >\n {children}\n </button>\n );\n },\n);\n\nexport const Stepper = {\n Root: StepperRoot,\n List: StepperList,\n Item: StepperItem,\n Trigger: StepperTrigger,\n Indicator: StepperIndicator,\n Title: StepperTitle,\n Description: StepperDescription,\n Content: StepperContent,\n Separator: StepperSeparator,\n Previous: StepperPrevious,\n Next: StepperNext,\n};\n"],"mappings":";;;;;;AA6CA,MAAM,kBAAA,GAAA,MAAA,cAAA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AClC,MAAM,SAASC,gBAAAA,QAAQ,EAAE,aAAa,QAAQ,YAAY,CAAC;CAC3D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACJ,WAAWD,WAAAA,GAAG,OAAO,UAAU,SAAS;EACxC,aAAU;EACV,UAAU,gBAAgB,QAAQ;EAClC,UAAU,UAAU;GAClB,QAAQ,KAAK,EAAE;GACf,MAAM,UAAU,KAAK;EACvB;EACK;EACL,MAAM,MAAM,QAAQ;EAEnB;CACK,CAAA;AAEZ,CACF;AAEA,MAAa,eAAA,GAAA,MAAA,WAAA,CACX,SAAS,YAAY,EAAE,WAAW,QAAQ,WAAW,UAAU,cAAc,GAAG,SAAS,KAAK;CAC5F,MAAM,UAAU,kBAAkB;CAClC,MAAM,SAASC,gBAAAA,QAAQ,EAAE,aAAa,QAAQ,YAAY,CAAC;CAC3D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACJ,WAAWD,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,aAAU;EACV,UAAU,gBAAgB,QAAQ;EAClC,UAAU,UAAU;GAClB,QAAQ,KAAK,CAAC;GACd,MAAM,UAAU,KAAK;EACvB;EACK;EACL,MAAM,MAAM,QAAQ;EAEnB;CACK,CAAA;AAEZ,CACF;AAEA,MAAa,UAAU;CACrB,MAAM;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,WAAW;CACX,OAAO;CACP,aAAa;CACb,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;AACR"}
@@ -0,0 +1,52 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ //#region src/components/stepper/stepper.d.ts
3
+ type StepperOrientation = "horizontal" | "vertical";
4
+ type StepperStatus = "current" | "complete" | "upcoming" | "disabled";
5
+ interface StepperRootProps extends Omit<ComponentPropsWithoutRef<"nav">, "children"> {
6
+ value?: string;
7
+ defaultValue?: string;
8
+ onValueChange?: (value: string) => void;
9
+ orientation?: StepperOrientation;
10
+ linear?: boolean;
11
+ allowStepSelect?: boolean;
12
+ disabled?: boolean;
13
+ name?: string;
14
+ form?: string;
15
+ children?: ReactNode;
16
+ }
17
+ declare const StepperRoot: import("react").ForwardRefExoticComponent<StepperRootProps & import("react").RefAttributes<HTMLElement>>;
18
+ declare const StepperList: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & import("react").RefAttributes<HTMLOListElement>>;
19
+ interface StepperItemProps extends ComponentPropsWithoutRef<"li"> {
20
+ value: string;
21
+ status?: StepperStatus;
22
+ disabled?: boolean;
23
+ }
24
+ declare const StepperItem: import("react").ForwardRefExoticComponent<StepperItemProps & import("react").RefAttributes<HTMLLIElement>>;
25
+ type StepperTriggerProps = ComponentPropsWithoutRef<"button">;
26
+ declare const StepperTrigger: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
27
+ declare const StepperIndicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
28
+ declare const StepperTitle: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
29
+ declare const StepperDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
30
+ declare const StepperContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
31
+ declare const StepperSeparator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
32
+ interface StepperNavigationButtonProps extends ComponentPropsWithoutRef<"button"> {
33
+ children?: ReactNode;
34
+ }
35
+ declare const StepperPrevious: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
36
+ declare const StepperNext: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
37
+ declare const Stepper: {
38
+ Root: import("react").ForwardRefExoticComponent<StepperRootProps & import("react").RefAttributes<HTMLElement>>;
39
+ List: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & import("react").RefAttributes<HTMLOListElement>>;
40
+ Item: import("react").ForwardRefExoticComponent<StepperItemProps & import("react").RefAttributes<HTMLLIElement>>;
41
+ Trigger: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
42
+ Indicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
43
+ Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
44
+ Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
45
+ Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
46
+ Separator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
47
+ Previous: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
48
+ Next: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
49
+ };
50
+ //#endregion
51
+ export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperItemProps, StepperList, StepperNavigationButtonProps, StepperNext, StepperOrientation, StepperPrevious, StepperRoot, StepperRootProps, StepperSeparator, StepperStatus, StepperTitle, StepperTrigger, StepperTriggerProps };
52
+ //# sourceMappingURL=stepper.d.cts.map
@@ -0,0 +1,52 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ //#region src/components/stepper/stepper.d.ts
3
+ type StepperOrientation = "horizontal" | "vertical";
4
+ type StepperStatus = "current" | "complete" | "upcoming" | "disabled";
5
+ interface StepperRootProps extends Omit<ComponentPropsWithoutRef<"nav">, "children"> {
6
+ value?: string;
7
+ defaultValue?: string;
8
+ onValueChange?: (value: string) => void;
9
+ orientation?: StepperOrientation;
10
+ linear?: boolean;
11
+ allowStepSelect?: boolean;
12
+ disabled?: boolean;
13
+ name?: string;
14
+ form?: string;
15
+ children?: ReactNode;
16
+ }
17
+ declare const StepperRoot: import("react").ForwardRefExoticComponent<StepperRootProps & import("react").RefAttributes<HTMLElement>>;
18
+ declare const StepperList: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & import("react").RefAttributes<HTMLOListElement>>;
19
+ interface StepperItemProps extends ComponentPropsWithoutRef<"li"> {
20
+ value: string;
21
+ status?: StepperStatus;
22
+ disabled?: boolean;
23
+ }
24
+ declare const StepperItem: import("react").ForwardRefExoticComponent<StepperItemProps & import("react").RefAttributes<HTMLLIElement>>;
25
+ type StepperTriggerProps = ComponentPropsWithoutRef<"button">;
26
+ declare const StepperTrigger: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
27
+ declare const StepperIndicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
28
+ declare const StepperTitle: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
29
+ declare const StepperDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
30
+ declare const StepperContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
31
+ declare const StepperSeparator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
32
+ interface StepperNavigationButtonProps extends ComponentPropsWithoutRef<"button"> {
33
+ children?: ReactNode;
34
+ }
35
+ declare const StepperPrevious: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
36
+ declare const StepperNext: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
37
+ declare const Stepper: {
38
+ Root: import("react").ForwardRefExoticComponent<StepperRootProps & import("react").RefAttributes<HTMLElement>>;
39
+ List: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & import("react").RefAttributes<HTMLOListElement>>;
40
+ Item: import("react").ForwardRefExoticComponent<StepperItemProps & import("react").RefAttributes<HTMLLIElement>>;
41
+ Trigger: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
42
+ Indicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
43
+ Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
44
+ Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
45
+ Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
46
+ Separator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
47
+ Previous: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
48
+ Next: import("react").ForwardRefExoticComponent<StepperNavigationButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
49
+ };
50
+ //#endregion
51
+ export { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperItemProps, StepperList, StepperNavigationButtonProps, StepperNext, StepperOrientation, StepperPrevious, StepperRoot, StepperRootProps, StepperSeparator, StepperStatus, StepperTitle, StepperTrigger, StepperTriggerProps };
52
+ //# sourceMappingURL=stepper.d.ts.map