asheeui 1.1.0 → 2.0.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 (154) hide show
  1. package/LICENSE +201 -21
  2. package/NOTICE +10 -0
  3. package/README.md +3 -1
  4. package/dist/components/accordion/Accordion.d.ts +1 -1
  5. package/dist/components/centered/Centered.d.ts +49 -0
  6. package/dist/components/centered/Centered.d.ts.map +1 -0
  7. package/dist/components/centered/Centered.js +32 -0
  8. package/dist/components/centered/centered-config.d.ts +63 -0
  9. package/dist/components/centered/centered-config.d.ts.map +1 -0
  10. package/dist/components/centered/centered-config.js +17 -0
  11. package/dist/components/centered/centered-styles.d.ts +11 -0
  12. package/dist/components/centered/centered-styles.d.ts.map +1 -0
  13. package/dist/components/centered/centered-styles.js +9 -0
  14. package/dist/components/centered/index.d.ts +3 -0
  15. package/dist/components/centered/index.d.ts.map +1 -0
  16. package/dist/components/centered/index.js +3 -0
  17. package/dist/components/chip/Chip.d.ts +8 -0
  18. package/dist/components/chip/Chip.d.ts.map +1 -1
  19. package/dist/components/chip/Chip.js +15 -15
  20. package/dist/components/data-table/DataTable.d.ts +137 -0
  21. package/dist/components/data-table/DataTable.d.ts.map +1 -0
  22. package/dist/components/data-table/DataTable.js +101 -0
  23. package/dist/components/data-table/data-table-config.d.ts +75 -0
  24. package/dist/components/data-table/data-table-config.d.ts.map +1 -0
  25. package/dist/components/data-table/data-table-config.js +24 -0
  26. package/dist/components/data-table/data-table-styles.d.ts +25 -0
  27. package/dist/components/data-table/data-table-styles.d.ts.map +1 -0
  28. package/dist/components/data-table/data-table-styles.js +5 -0
  29. package/dist/components/data-table/index.d.ts +3 -0
  30. package/dist/components/data-table/index.d.ts.map +1 -0
  31. package/dist/components/data-table/index.js +3 -0
  32. package/dist/components/docs-layout/DocsLayout.d.ts +94 -0
  33. package/dist/components/docs-layout/DocsLayout.d.ts.map +1 -0
  34. package/dist/components/docs-layout/DocsLayout.js +62 -0
  35. package/dist/components/docs-layout/docs-layout-config.d.ts +61 -0
  36. package/dist/components/docs-layout/docs-layout-config.d.ts.map +1 -0
  37. package/dist/components/docs-layout/docs-layout-config.js +22 -0
  38. package/dist/components/docs-layout/docs-layout-styles.d.ts +31 -0
  39. package/dist/components/docs-layout/docs-layout-styles.d.ts.map +1 -0
  40. package/dist/components/docs-layout/docs-layout-styles.js +5 -0
  41. package/dist/components/docs-layout/index.d.ts +3 -0
  42. package/dist/components/docs-layout/index.d.ts.map +1 -0
  43. package/dist/components/docs-layout/index.js +3 -0
  44. package/dist/components/empty-state/EmptyState.d.ts +19 -1
  45. package/dist/components/empty-state/EmptyState.d.ts.map +1 -1
  46. package/dist/components/empty-state/EmptyState.js +10 -9
  47. package/dist/components/error-state/ErrorState.d.ts +98 -0
  48. package/dist/components/error-state/ErrorState.d.ts.map +1 -0
  49. package/dist/components/error-state/ErrorState.js +57 -0
  50. package/dist/components/error-state/error-state-config.d.ts +66 -0
  51. package/dist/components/error-state/error-state-config.d.ts.map +1 -0
  52. package/dist/components/error-state/error-state-config.js +20 -0
  53. package/dist/components/error-state/error-state-styles.d.ts +17 -0
  54. package/dist/components/error-state/error-state-styles.d.ts.map +1 -0
  55. package/dist/components/error-state/error-state-styles.js +5 -0
  56. package/dist/components/error-state/index.d.ts +3 -0
  57. package/dist/components/error-state/index.d.ts.map +1 -0
  58. package/dist/components/error-state/index.js +3 -0
  59. package/dist/components/file-upload/FileUpload.d.ts +112 -0
  60. package/dist/components/file-upload/FileUpload.d.ts.map +1 -0
  61. package/dist/components/file-upload/FileUpload.js +83 -0
  62. package/dist/components/file-upload/file-upload-config.d.ts +41 -0
  63. package/dist/components/file-upload/file-upload-config.d.ts.map +1 -0
  64. package/dist/components/file-upload/file-upload-config.js +16 -0
  65. package/dist/components/file-upload/file-upload-styles.d.ts +22 -0
  66. package/dist/components/file-upload/file-upload-styles.d.ts.map +1 -0
  67. package/dist/components/file-upload/file-upload-styles.js +9 -0
  68. package/dist/components/file-upload/file-upload.helpers.d.ts +26 -0
  69. package/dist/components/file-upload/file-upload.helpers.d.ts.map +1 -0
  70. package/dist/components/file-upload/file-upload.helpers.js +17 -0
  71. package/dist/components/file-upload/index.d.ts +3 -0
  72. package/dist/components/file-upload/index.d.ts.map +1 -0
  73. package/dist/components/file-upload/index.js +4 -0
  74. package/dist/components/loading-state/LoadingState.d.ts +57 -0
  75. package/dist/components/loading-state/LoadingState.d.ts.map +1 -0
  76. package/dist/components/loading-state/LoadingState.js +44 -0
  77. package/dist/components/loading-state/index.d.ts +3 -0
  78. package/dist/components/loading-state/index.d.ts.map +1 -0
  79. package/dist/components/loading-state/index.js +3 -0
  80. package/dist/components/loading-state/loading-state-config.d.ts +49 -0
  81. package/dist/components/loading-state/loading-state-config.d.ts.map +1 -0
  82. package/dist/components/loading-state/loading-state-config.js +18 -0
  83. package/dist/components/loading-state/loading-state-styles.d.ts +12 -0
  84. package/dist/components/loading-state/loading-state-styles.d.ts.map +1 -0
  85. package/dist/components/loading-state/loading-state-styles.js +9 -0
  86. package/dist/components/marketing-layout/MarketingLayout.d.ts +83 -0
  87. package/dist/components/marketing-layout/MarketingLayout.d.ts.map +1 -0
  88. package/dist/components/marketing-layout/MarketingLayout.js +40 -0
  89. package/dist/components/marketing-layout/index.d.ts +3 -0
  90. package/dist/components/marketing-layout/index.d.ts.map +1 -0
  91. package/dist/components/marketing-layout/index.js +3 -0
  92. package/dist/components/marketing-layout/marketing-layout-config.d.ts +60 -0
  93. package/dist/components/marketing-layout/marketing-layout-config.d.ts.map +1 -0
  94. package/dist/components/marketing-layout/marketing-layout-config.js +16 -0
  95. package/dist/components/marketing-layout/marketing-layout-styles.d.ts +8 -0
  96. package/dist/components/marketing-layout/marketing-layout-styles.d.ts.map +1 -0
  97. package/dist/components/marketing-layout/marketing-layout-styles.js +8 -0
  98. package/dist/components/search-input/SearchInput.d.ts +111 -0
  99. package/dist/components/search-input/SearchInput.d.ts.map +1 -0
  100. package/dist/components/search-input/SearchInput.js +86 -0
  101. package/dist/components/search-input/index.d.ts +3 -0
  102. package/dist/components/search-input/index.d.ts.map +1 -0
  103. package/dist/components/search-input/index.js +3 -0
  104. package/dist/components/search-input/search-input-config.d.ts +55 -0
  105. package/dist/components/search-input/search-input-config.d.ts.map +1 -0
  106. package/dist/components/search-input/search-input-config.js +20 -0
  107. package/dist/components/search-input/search-input-styles.d.ts +16 -0
  108. package/dist/components/search-input/search-input-styles.d.ts.map +1 -0
  109. package/dist/components/search-input/search-input-styles.js +9 -0
  110. package/dist/components/section-kit/ActionGroup.d.ts +8 -1
  111. package/dist/components/section-kit/ActionGroup.d.ts.map +1 -1
  112. package/dist/components/section-kit/ActionGroup.js +13 -9
  113. package/dist/components/section-kit/SkipLink.d.ts +50 -0
  114. package/dist/components/section-kit/SkipLink.d.ts.map +1 -0
  115. package/dist/components/section-kit/SkipLink.js +14 -0
  116. package/dist/components/section-kit/index.d.ts +5 -4
  117. package/dist/components/section-kit/index.d.ts.map +1 -1
  118. package/dist/components/section-kit/index.js +1 -0
  119. package/dist/components/sidebar-layout/SidebarLayout.d.ts.map +1 -1
  120. package/dist/components/sidebar-layout/SidebarLayout.js +25 -25
  121. package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts +10 -3
  122. package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts.map +1 -1
  123. package/dist/components/sidebar-layout/sidebar-layout-styles.js +2 -2
  124. package/dist/components/split/Split.d.ts +68 -0
  125. package/dist/components/split/Split.d.ts.map +1 -0
  126. package/dist/components/split/Split.js +36 -0
  127. package/dist/components/split/index.d.ts +3 -0
  128. package/dist/components/split/index.d.ts.map +1 -0
  129. package/dist/components/split/index.js +3 -0
  130. package/dist/components/split/split-config.d.ts +83 -0
  131. package/dist/components/split/split-config.d.ts.map +1 -0
  132. package/dist/components/split/split-config.js +20 -0
  133. package/dist/components/split/split-styles.d.ts +36 -0
  134. package/dist/components/split/split-styles.d.ts.map +1 -0
  135. package/dist/components/split/split-styles.js +76 -0
  136. package/dist/components/stepper/Stepper.d.ts +94 -0
  137. package/dist/components/stepper/Stepper.d.ts.map +1 -0
  138. package/dist/components/stepper/Stepper.js +71 -0
  139. package/dist/components/stepper/index.d.ts +3 -0
  140. package/dist/components/stepper/index.d.ts.map +1 -0
  141. package/dist/components/stepper/index.js +3 -0
  142. package/dist/components/stepper/stepper-config.d.ts +51 -0
  143. package/dist/components/stepper/stepper-config.d.ts.map +1 -0
  144. package/dist/components/stepper/stepper-config.js +16 -0
  145. package/dist/components/stepper/stepper-styles.d.ts +30 -0
  146. package/dist/components/stepper/stepper-styles.d.ts.map +1 -0
  147. package/dist/components/stepper/stepper-styles.js +25 -0
  148. package/dist/index.d.ts +10 -0
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +93 -73
  151. package/dist/shared/spacing.d.ts +8 -0
  152. package/dist/shared/spacing.d.ts.map +1 -1
  153. package/dist/shared/spacing.js +9 -1
  154. package/package.json +5 -3
@@ -0,0 +1,68 @@
1
+ import { ElementType, HTMLAttributes, ReactNode } from 'react';
2
+ import { SplitConfig } from './split-config';
3
+ type BaseSplitProps = SplitConfig & Omit<HTMLAttributes<HTMLDivElement>, "color">;
4
+ /**
5
+ * Props for the Split component.
6
+ */
7
+ export interface SplitProps extends BaseSplitProps {
8
+ /**
9
+ * The first pane.
10
+ * Left out when the layout has one pane only, which is what a page that grows
11
+ * a second pane at a breakpoint starts as.
12
+ */
13
+ start?: ReactNode;
14
+ /**
15
+ * The second pane.
16
+ * Left out when the layout has one pane only.
17
+ */
18
+ end?: ReactNode;
19
+ /**
20
+ * Element to render.
21
+ * Defaults to a `div`.
22
+ *
23
+ * @default "div"
24
+ */
25
+ as?: ElementType;
26
+ }
27
+ /**
28
+ * Two panes that stack on a narrow screen and sit side by side on a wide one.
29
+ *
30
+ * Split resolves its options through the standard configuration cascade, so
31
+ * `components.split` states the application's breakpoint and ratio once. It
32
+ * carries no width, no gutter and no background of its own: panes are as wide as
33
+ * the layout allows, and the content inside them decides its own presentation.
34
+ *
35
+ * The primitive never hides a pane. Below the breakpoint the panes stack, so
36
+ * everything stays in the document, reachable with the keyboard and read by a
37
+ * screen reader in a sensible order.
38
+ *
39
+ * @param props - Split configuration options and element attributes.
40
+ * @param props.start - The first pane.
41
+ * @param props.end - The second pane.
42
+ * @param props.stackAt - Breakpoint from which the panes sit side by side.
43
+ * Defaults to "lg".
44
+ * @param props.ratio - How the panes divide the width. Defaults to "equal".
45
+ * @param props.gap - Space between the panes. Defaults to "lg".
46
+ * @param props.align - Cross-axis alignment. Defaults to "stretch".
47
+ * @param props.divider - Draw a rule between the panes. Defaults to false.
48
+ * @param props.stickyEnd - Keep the second pane in view. Defaults to false.
49
+ * @param props.as - Element to render. Defaults to "div".
50
+ * @returns The rendered layout.
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * <Split
55
+ * stackAt="xl"
56
+ * ratio="start"
57
+ * start={<Typography role="body-md">The article.</Typography>}
58
+ * end={<TableOfContents items={items} />}
59
+ * stickyEnd
60
+ * />
61
+ * ```
62
+ *
63
+ * @see Grid - The two-dimensional layout, for more than two regions.
64
+ * @see SidebarLayout - The application shell, when a pane is navigation.
65
+ */
66
+ export declare const Split: import('react').ForwardRefExoticComponent<SplitProps & import('react').RefAttributes<HTMLDivElement>>;
67
+ export {};
68
+ //# sourceMappingURL=Split.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Split.d.ts","sourceRoot":"","sources":["../../../src/components/split/Split.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAWzE,KAAK,cAAc,GAAG,WAAW,GAC/B,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,GAAG,CAAC,EAAE,SAAS,CAAC;IAEhB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,KAAK,uGAwDjB,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn as e } from "../../utils/cn.js";
4
+ import { SPACE_GAP_CLASS as t } from "../../shared/spacing.js";
5
+ import { useAsheeConfig as n } from "../../libs/context.js";
6
+ import { resolveConfigCascade as r } from "../../utils/resolve-token.js";
7
+ import { FALLBACK_SPLIT_CONFIG as i } from "./split-config.js";
8
+ import { SPLIT_ALIGN_CLASS as a, SPLIT_BASE_CLASS as o, SPLIT_DIVIDER_CLASS as s, SPLIT_PANE_WIDTH_CLASS as c, SPLIT_STACK_CLASS as l } from "./split-styles.js";
9
+ import { forwardRef as u } from "react";
10
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
+ //#region src/components/split/Split.tsx
12
+ var p = u(({ as: u, start: p, end: m, stackAt: h, ratio: g, gap: _, align: v, divider: y, stickyEnd: b, className: x, ...S }, C) => {
13
+ let w = n(), T = r({
14
+ stackAt: h,
15
+ ratio: g,
16
+ gap: _,
17
+ align: v,
18
+ divider: y,
19
+ stickyEnd: b
20
+ }, w.components?.split, i), E = c[T.stackAt][T.ratio];
21
+ return /* @__PURE__ */ f(u ?? "div", {
22
+ ref: C,
23
+ className: e(o, l[T.stackAt], a[T.align], t[T.gap], T.divider && s[T.stackAt], x),
24
+ ...S,
25
+ children: [p !== void 0 && /* @__PURE__ */ d("div", {
26
+ className: e("w-full min-w-0", E.start),
27
+ children: p
28
+ }), m !== void 0 && /* @__PURE__ */ d("div", {
29
+ className: e("w-full min-w-0", E.end, T.stickyEnd && "sticky top-0 self-start"),
30
+ children: m
31
+ })]
32
+ });
33
+ });
34
+ p.displayName = "Split";
35
+ //#endregion
36
+ export { p as Split };
@@ -0,0 +1,3 @@
1
+ export * from './Split';
2
+ export * from './split-config';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/split/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./Split.js";
2
+ export * from "./split-config.js";
3
+ export * from "./split-styles.js";
@@ -0,0 +1,83 @@
1
+ import { Space } from '../../shared';
2
+ /**
3
+ * The breakpoints at which two panes stop stacking.
4
+ * `sm` is a wide phone in landscape, `md` a tablet, `lg` a laptop and `xl` a
5
+ * large desktop, which are the framework's shared breakpoints.
6
+ */
7
+ export type SplitStackAt = "sm" | "md" | "lg" | "xl";
8
+ /**
9
+ * How the two panes divide the width once they sit side by side.
10
+ *
11
+ * - `equal`: the panes share the width, for a comparison or a media pair.
12
+ * - `start`: the first pane takes two thirds, for a content column beside a
13
+ * narrower aside.
14
+ * - `end`: the second pane takes two thirds, for a narrow navigation column
15
+ * beside a wide content column.
16
+ */
17
+ export type SplitRatio = "equal" | "start" | "end";
18
+ /**
19
+ * Cross-axis alignment of the two panes on the wide layout.
20
+ */
21
+ export type SplitAlign = "start" | "center" | "stretch";
22
+ /**
23
+ * Theme configuration options for the Split component.
24
+ *
25
+ * Set under `components.split` in the AsheeUI config. Values feed the
26
+ * component-level tier of the theme cascade.
27
+ */
28
+ export interface SplitConfig {
29
+ /**
30
+ * Breakpoint from which the panes sit side by side instead of stacking.
31
+ *
32
+ * @default "lg"
33
+ */
34
+ stackAt?: SplitStackAt;
35
+ /**
36
+ * How the panes divide the width.
37
+ *
38
+ * @default "equal"
39
+ */
40
+ ratio?: SplitRatio;
41
+ /**
42
+ * Space between the two panes.
43
+ *
44
+ * @default "lg"
45
+ */
46
+ gap?: Space;
47
+ /**
48
+ * Cross-axis alignment of the panes.
49
+ *
50
+ * @default "stretch"
51
+ */
52
+ align?: SplitAlign;
53
+ /**
54
+ * Whether a border is drawn between the panes on the wide layout.
55
+ * On the narrow layout the panes stack, so there is nothing to separate.
56
+ *
57
+ * @default false
58
+ */
59
+ divider?: boolean;
60
+ /**
61
+ * Whether the second pane sticks to the top of the viewport while the first
62
+ * pane scrolls. It suits a table of contents or a summary column.
63
+ *
64
+ * @default false
65
+ */
66
+ stickyEnd?: boolean;
67
+ }
68
+ /**
69
+ * Default config values registered for the Split component.
70
+ * The breakpoint and the ratio are pinned; alignment, divider and stickiness
71
+ * stay unset so a consumer's own value is the only one the cascade sees.
72
+ */
73
+ export declare const defaultSplitConfig: SplitConfig;
74
+ declare module "../../libs/registry" {
75
+ interface ComponentTypeConfigRegistry {
76
+ split: SplitConfig;
77
+ }
78
+ }
79
+ /**
80
+ * Hard fallback values used when no config tier provides a value.
81
+ */
82
+ export declare const FALLBACK_SPLIT_CONFIG: Required<SplitConfig>;
83
+ //# sourceMappingURL=split-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-config.d.ts","sourceRoot":"","sources":["../../../src/components/split/split-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;OAIG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC;IAEZ;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAKhC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,KAAK,EAAE,WAAW,CAAC;KACpB;CACF;AAID;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAOvD,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { registerComponentDefaults as e } from "../../libs/registry.js";
3
+ //#region src/components/split/split-config.ts
4
+ var t = {
5
+ stackAt: "lg",
6
+ ratio: "equal",
7
+ gap: "lg",
8
+ align: "stretch"
9
+ };
10
+ e("split", t);
11
+ var n = {
12
+ stackAt: "lg",
13
+ ratio: "equal",
14
+ gap: "lg",
15
+ align: "stretch",
16
+ divider: !1,
17
+ stickyEnd: !1
18
+ };
19
+ //#endregion
20
+ export { n as FALLBACK_SPLIT_CONFIG, t as defaultSplitConfig };
@@ -0,0 +1,36 @@
1
+ import { SplitAlign, SplitRatio, SplitStackAt } from './split-config';
2
+ /** Shared classes for every split. */
3
+ export declare const SPLIT_BASE_CLASS = "flex w-full min-w-0";
4
+ /**
5
+ * Stacking classes per breakpoint.
6
+ * Below the breakpoint the panes are a column, so a narrow screen reads the
7
+ * panes in the order they are written rather than side by side.
8
+ */
9
+ export declare const SPLIT_STACK_CLASS: Record<SplitStackAt, string>;
10
+ /** Cross-axis alignment classes for the wide layout. */
11
+ export declare const SPLIT_ALIGN_CLASS: Record<SplitAlign, string>;
12
+ /** Shared classes for every pane. */
13
+ export declare const SPLIT_PANE_BASE_CLASS = "w-full min-w-0";
14
+ /**
15
+ * Width each pane takes once the panes sit side by side, per breakpoint and
16
+ * ratio. `flex-basis` decides the main size of a flex item, so it settles the
17
+ * division of the width without the panes having to grow.
18
+ */
19
+ export declare const SPLIT_PANE_WIDTH_CLASS: Record<SplitStackAt, Record<SplitRatio, {
20
+ start: string;
21
+ end: string;
22
+ }>>;
23
+ /**
24
+ * Divider classes per breakpoint.
25
+ * Stacked panes are separated by a horizontal rule; side-by-side panes by a
26
+ * vertical one, which the same utility produces because it follows the flex
27
+ * direction.
28
+ */
29
+ export declare const SPLIT_DIVIDER_CLASS: Record<SplitStackAt, string>;
30
+ /**
31
+ * Sticky classes for a pane that stays in view.
32
+ * A sticky flex item also needs to stop stretching, or it has no room to move
33
+ * within its parent.
34
+ */
35
+ export declare const SPLIT_STICKY_CLASS = "sticky top-0 self-start";
36
+ //# sourceMappingURL=split-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-styles.d.ts","sourceRoot":"","sources":["../../../src/components/split/split-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE3E,sCAAsC;AACtC,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAK1D,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAIxD,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,YAAY,EACZ,MAAM,CAAC,UAAU,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAsBnD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAK5D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,4BAA4B,CAAC"}
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ //#region src/components/split/split-styles.ts
3
+ var e = "flex w-full min-w-0", t = {
4
+ sm: "flex-col sm:flex-row",
5
+ md: "flex-col md:flex-row",
6
+ lg: "flex-col lg:flex-row",
7
+ xl: "flex-col xl:flex-row"
8
+ }, n = {
9
+ start: "items-start",
10
+ center: "items-center",
11
+ stretch: "items-stretch"
12
+ }, r = "w-full min-w-0", i = {
13
+ sm: {
14
+ equal: {
15
+ start: "sm:basis-1/2",
16
+ end: "sm:basis-1/2"
17
+ },
18
+ start: {
19
+ start: "sm:basis-2/3",
20
+ end: "sm:basis-1/3"
21
+ },
22
+ end: {
23
+ start: "sm:basis-1/3",
24
+ end: "sm:basis-2/3"
25
+ }
26
+ },
27
+ md: {
28
+ equal: {
29
+ start: "md:basis-1/2",
30
+ end: "md:basis-1/2"
31
+ },
32
+ start: {
33
+ start: "md:basis-2/3",
34
+ end: "md:basis-1/3"
35
+ },
36
+ end: {
37
+ start: "md:basis-1/3",
38
+ end: "md:basis-2/3"
39
+ }
40
+ },
41
+ lg: {
42
+ equal: {
43
+ start: "lg:basis-1/2",
44
+ end: "lg:basis-1/2"
45
+ },
46
+ start: {
47
+ start: "lg:basis-2/3",
48
+ end: "lg:basis-1/3"
49
+ },
50
+ end: {
51
+ start: "lg:basis-1/3",
52
+ end: "lg:basis-2/3"
53
+ }
54
+ },
55
+ xl: {
56
+ equal: {
57
+ start: "xl:basis-1/2",
58
+ end: "xl:basis-1/2"
59
+ },
60
+ start: {
61
+ start: "xl:basis-2/3",
62
+ end: "xl:basis-1/3"
63
+ },
64
+ end: {
65
+ start: "xl:basis-1/3",
66
+ end: "xl:basis-2/3"
67
+ }
68
+ }
69
+ }, a = {
70
+ sm: "divide-y divide-border sm:divide-y-0 sm:divide-x",
71
+ md: "divide-y divide-border md:divide-y-0 md:divide-x",
72
+ lg: "divide-y divide-border lg:divide-y-0 lg:divide-x",
73
+ xl: "divide-y divide-border xl:divide-y-0 xl:divide-x"
74
+ }, o = "sticky top-0 self-start";
75
+ //#endregion
76
+ export { n as SPLIT_ALIGN_CLASS, e as SPLIT_BASE_CLASS, a as SPLIT_DIVIDER_CLASS, r as SPLIT_PANE_BASE_CLASS, i as SPLIT_PANE_WIDTH_CLASS, t as SPLIT_STACK_CLASS, o as SPLIT_STICKY_CLASS };
@@ -0,0 +1,94 @@
1
+ import { ElementType, HTMLAttributes, ReactNode } from 'react';
2
+ import { StepperConfig } from './stepper-config';
3
+ /**
4
+ * One step of a stepper.
5
+ */
6
+ export interface StepperStep {
7
+ /**
8
+ * Stable identifier of the step.
9
+ */
10
+ key: string;
11
+ /**
12
+ * Name of the step.
13
+ */
14
+ label: ReactNode;
15
+ /**
16
+ * What the step asks for, shown under the label when descriptions are on.
17
+ */
18
+ description?: ReactNode;
19
+ }
20
+ type BaseStepperProps = StepperConfig & Omit<HTMLAttributes<HTMLOListElement>, "color">;
21
+ /**
22
+ * Props for the Stepper component.
23
+ */
24
+ export interface StepperProps extends BaseStepperProps {
25
+ /**
26
+ * The steps, in order.
27
+ */
28
+ steps: StepperStep[];
29
+ /**
30
+ * Zero-based index of the step the reader is on.
31
+ */
32
+ currentStep: number;
33
+ /**
34
+ * Called with the index of the step a reader asked for.
35
+ * Its presence is what makes the steps the reader has not reached yet
36
+ * interactive; without it the stepper only reports progress.
37
+ */
38
+ onStepChange?: (index: number) => void;
39
+ /**
40
+ * Name of the list, for a page that has more than one.
41
+ */
42
+ label?: string;
43
+ /**
44
+ * Element to render.
45
+ * Defaults to an `ol`, which is what makes the sequence a list.
46
+ *
47
+ * @default "ol"
48
+ */
49
+ as?: ElementType;
50
+ }
51
+ /**
52
+ * The reader's progress through a sequence of steps.
53
+ *
54
+ * Each step reports its own state: the steps before the current one are
55
+ * complete, the current one carries `aria-current="step"`, and the rest are
56
+ * upcoming. The state is carried by the marker's colour and by text as well, so
57
+ * the sequence does not depend on colour alone.
58
+ *
59
+ * The arrangement follows the breakpoint rather than a fixed choice: by default
60
+ * the steps are a column on a narrow screen and a row from the `md` breakpoint,
61
+ * which is the shape a checkout summary takes without a media query at each use.
62
+ *
63
+ * @param props - Stepper configuration options and list attributes.
64
+ * @param props.steps - The steps, in order.
65
+ * @param props.currentStep - Zero-based index of the current step.
66
+ * @param props.onStepChange - Called with the index a reader asked for.
67
+ * @param props.orientation - How the steps are arranged. Defaults to
68
+ * "responsive".
69
+ * @param props.size - Density of markers and labels. Defaults to "md".
70
+ * @param props.showDescriptions - Show each step's description. Defaults to
71
+ * true.
72
+ * @param props.label - Name of the list, for a page with more than one.
73
+ * @param props.as - Element to render. Defaults to "ol".
74
+ * @returns The rendered stepper.
75
+ *
76
+ * @example
77
+ * ```tsx
78
+ * <Stepper
79
+ * currentStep={1}
80
+ * onStepChange={setStep}
81
+ * steps={[
82
+ * { key: "cart", label: "Cart" },
83
+ * { key: "address", label: "Address", description: "Where it ships" },
84
+ * { key: "payment", label: "Payment" },
85
+ * ]}
86
+ * />
87
+ * ```
88
+ *
89
+ * @see Tabs - Switching between panels rather than reporting progress.
90
+ * @see Pagination - Moving through pages of a collection.
91
+ */
92
+ export declare const Stepper: import('react').ForwardRefExoticComponent<StepperProps & import('react').RefAttributes<HTMLOListElement>>;
93
+ export {};
94
+ //# sourceMappingURL=Stepper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/components/stepper/Stepper.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAMf,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAe/E;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,KAAK,gBAAgB,GAAG,aAAa,GACnC,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD;;OAEG;IACH,KAAK,EAAE,WAAW,EAAE,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEvC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,OAAO,2GAwHnB,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn as e } from "../../utils/cn.js";
4
+ import { useAsheeConfig as t } from "../../libs/context.js";
5
+ import { resolveConfigCascade as n } from "../../utils/resolve-token.js";
6
+ import { CheckIcon as r } from "../../icons/CheckIcon.js";
7
+ import { Typography as i } from "../typography/Typography.js";
8
+ import { FALLBACK_STEPPER_CONFIG as a } from "./stepper-config.js";
9
+ import { STEPPER_CONNECTOR_CLASS as o, STEPPER_ITEM_BUTTON_CLASS as s, STEPPER_ITEM_CLASS as c, STEPPER_LABEL_CLASS as l, STEPPER_LIST_CLASS as u, STEPPER_MARKER_CLASS as d, STEPPER_MARKER_SIZE_CLASS as f, STEPPER_MARKER_STATE_CLASS as p, STEPPER_STATE_TEXT_CLASS as m } from "./stepper-styles.js";
10
+ import { forwardRef as h } from "react";
11
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
12
+ //#region src/components/stepper/Stepper.tsx
13
+ var y = h(({ steps: h, currentStep: y, onStepChange: b, label: x, orientation: S, size: C, showDescriptions: w, as: T, className: E, ...D }, O) => {
14
+ let k = t(), A = n({
15
+ orientation: S,
16
+ size: C,
17
+ showDescriptions: w
18
+ }, k.components?.stepper, a);
19
+ return /* @__PURE__ */ _(T ?? "ol", {
20
+ ref: O,
21
+ "aria-label": x,
22
+ className: e(u[A.orientation], E),
23
+ ...D,
24
+ children: h.map((t, n) => {
25
+ let a = n < y ? "complete" : n === y ? "current" : "upcoming", u = !!b && a !== "current", x = n === h.length - 1, S = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
26
+ "aria-hidden": "true",
27
+ className: e(d, f[A.size], p[a]),
28
+ children: a === "complete" ? /* @__PURE__ */ _(r, { className: "size-4" }) : n + 1
29
+ }), /* @__PURE__ */ v("span", {
30
+ className: "flex min-w-0 flex-col",
31
+ children: [/* @__PURE__ */ _(i, {
32
+ as: "span",
33
+ role: "label",
34
+ className: l[a],
35
+ children: t.label
36
+ }), A.showDescriptions && t.description && /* @__PURE__ */ _(i, {
37
+ as: "span",
38
+ role: "caption",
39
+ className: "text-xs text-foreground/60",
40
+ children: t.description
41
+ })]
42
+ })] });
43
+ return /* @__PURE__ */ v("li", {
44
+ "aria-current": a === "current" ? "step" : void 0,
45
+ className: c,
46
+ children: [
47
+ /* @__PURE__ */ _("span", {
48
+ className: m,
49
+ children: a === "complete" ? "Completed:" : a === "current" ? "Current step:" : "Not started:"
50
+ }),
51
+ u ? /* @__PURE__ */ _("button", {
52
+ type: "button",
53
+ className: s,
54
+ onClick: () => b?.(n),
55
+ children: S
56
+ }) : /* @__PURE__ */ _("span", {
57
+ className: "flex min-w-0 items-center gap-2",
58
+ children: S
59
+ }),
60
+ !x && /* @__PURE__ */ _("span", {
61
+ "aria-hidden": "true",
62
+ className: o[A.orientation]
63
+ })
64
+ ]
65
+ }, t.key);
66
+ })
67
+ });
68
+ });
69
+ y.displayName = "Stepper";
70
+ //#endregion
71
+ export { y as Stepper };
@@ -0,0 +1,3 @@
1
+ export * from './Stepper';
2
+ export * from './stepper-config';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/stepper/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./Stepper.js";
2
+ export * from "./stepper-config.js";
3
+ export * from "./stepper-styles.js";
@@ -0,0 +1,51 @@
1
+ import { Size } from '../../shared';
2
+ /**
3
+ * How the steps are arranged.
4
+ *
5
+ * - `responsive`: a column on a narrow screen and a row from the `md`
6
+ * breakpoint, which is the arrangement a checkout summary wants.
7
+ * - `horizontal`: a row at every width, for a stepper of two or three short
8
+ * steps.
9
+ * - `vertical`: a column at every width, for a long sequence or a sidebar.
10
+ */
11
+ export type StepperOrientation = "responsive" | "horizontal" | "vertical";
12
+ /**
13
+ * Theme configuration options for the Stepper component.
14
+ *
15
+ * Set under `components.stepper` in the AsheeUI config. Values feed the
16
+ * component-level tier of the theme cascade.
17
+ */
18
+ export interface StepperConfig {
19
+ /**
20
+ * How the steps are arranged.
21
+ *
22
+ * @default "responsive"
23
+ */
24
+ orientation?: StepperOrientation;
25
+ /**
26
+ * Density of the step markers and their labels.
27
+ *
28
+ * @default "md"
29
+ */
30
+ size?: Size;
31
+ /**
32
+ * Whether each step's description is shown under its label.
33
+ *
34
+ * @default true
35
+ */
36
+ showDescriptions?: boolean;
37
+ }
38
+ /**
39
+ * Default config values registered for the Stepper component.
40
+ */
41
+ export declare const defaultStepperConfig: StepperConfig;
42
+ declare module "../../libs/registry" {
43
+ interface ComponentTypeConfigRegistry {
44
+ stepper: StepperConfig;
45
+ }
46
+ }
47
+ /**
48
+ * Hard fallback values used when no config tier provides a value.
49
+ */
50
+ export declare const FALLBACK_STEPPER_CONFIG: Required<StepperConfig>;
51
+ //# sourceMappingURL=stepper-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepper-config.d.ts","sourceRoot":"","sources":["../../../src/components/stepper/stepper-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAEjC;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAIlC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,OAAO,EAAE,aAAa,CAAC;KACxB;CACF;AAID;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,aAAa,CAI3D,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { registerComponentDefaults as e } from "../../libs/registry.js";
3
+ //#region src/components/stepper/stepper-config.ts
4
+ var t = {
5
+ orientation: "responsive",
6
+ size: "md",
7
+ showDescriptions: !0
8
+ };
9
+ e("stepper", t);
10
+ var n = {
11
+ orientation: "responsive",
12
+ size: "md",
13
+ showDescriptions: !0
14
+ };
15
+ //#endregion
16
+ export { n as FALLBACK_STEPPER_CONFIG, t as defaultStepperConfig };
@@ -0,0 +1,30 @@
1
+ import { Size } from '../../shared';
2
+ import { StepperOrientation } from './stepper-config';
3
+ /** The state a step is in, relative to the current step. */
4
+ export type StepperStepState = "complete" | "current" | "upcoming";
5
+ /** The list, which is a column on a narrow screen and a row on a wide one. */
6
+ export declare const STEPPER_LIST_CLASS: Record<StepperOrientation, string>;
7
+ /** Shared classes for one step. */
8
+ export declare const STEPPER_ITEM_CLASS = "flex min-w-0 items-center gap-2";
9
+ /** The control a consumer can move between steps with. */
10
+ export declare const STEPPER_ITEM_BUTTON_CLASS = "flex min-w-0 items-center gap-2 rounded-md text-left outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2";
11
+ /** The marker, which holds a number or a tick. */
12
+ export declare const STEPPER_MARKER_SIZE_CLASS: Record<Size, string>;
13
+ /** Shared classes for the marker. */
14
+ export declare const STEPPER_MARKER_CLASS = "flex shrink-0 items-center justify-center rounded-full border font-medium";
15
+ /** The marker's treatment for each state. */
16
+ export declare const STEPPER_MARKER_STATE_CLASS: Record<StepperStepState, string>;
17
+ /** The label of each step, and the tone that follows its state. */
18
+ export declare const STEPPER_LABEL_CLASS: Record<StepperStepState, string>;
19
+ /** The description under a label. */
20
+ export declare const STEPPER_DESCRIPTION_CLASS = "text-xs text-foreground/60";
21
+ /**
22
+ * The rule between two steps.
23
+ * It is drawn only in the row arrangement: stacked, the order of the steps and
24
+ * their states carry the sequence, and a rule would add noise rather than
25
+ * information.
26
+ */
27
+ export declare const STEPPER_CONNECTOR_CLASS: Record<StepperOrientation, string>;
28
+ /** Visually hidden text that states a step's position for assistive technology. */
29
+ export declare const STEPPER_STATE_TEXT_CLASS = "sr-only";
30
+ //# sourceMappingURL=stepper-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepper-styles.d.ts","sourceRoot":"","sources":["../../../src/components/stepper/stepper-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,4DAA4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnE,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAKjE,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,kBAAkB,oCAAoC,CAAC;AAEpE,0DAA0D;AAC1D,eAAO,MAAM,yBAAyB,kJAC2G,CAAC;AAElJ,kDAAkD;AAClD,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAI1D,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,oBAAoB,8EAC4C,CAAC;AAE9E,6CAA6C;AAC7C,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAIvE,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAIhE,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,yBAAyB,+BAA+B,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAItE,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,YAAY,CAAC"}