@financedistrict/apps-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +119 -0
  3. package/dist/Radio-BYWz1n7p.d.cts +32 -0
  4. package/dist/Radio-BYWz1n7p.d.ts +32 -0
  5. package/dist/SelectTrigger-By0iPBI3.d.cts +78 -0
  6. package/dist/SelectTrigger-By0iPBI3.d.ts +78 -0
  7. package/dist/accordion.cjs +322 -0
  8. package/dist/accordion.d.cts +156 -0
  9. package/dist/accordion.d.ts +156 -0
  10. package/dist/accordion.js +2 -0
  11. package/dist/apps-ui.umd.js +1 -0
  12. package/dist/button.cjs +366 -0
  13. package/dist/button.d.cts +52 -0
  14. package/dist/button.d.ts +52 -0
  15. package/dist/button.js +3 -0
  16. package/dist/checkbox.cjs +74 -0
  17. package/dist/checkbox.d.cts +63 -0
  18. package/dist/checkbox.d.ts +63 -0
  19. package/dist/checkbox.js +2 -0
  20. package/dist/chunk-3RU7JMFE.js +27 -0
  21. package/dist/chunk-5TWRK4NW.js +783 -0
  22. package/dist/chunk-7EOSDFS3.js +9 -0
  23. package/dist/chunk-AIQ4UOGK.js +142 -0
  24. package/dist/chunk-B3MMGTPV.js +200 -0
  25. package/dist/chunk-DAHQYLUI.js +146 -0
  26. package/dist/chunk-DGBXADSS.js +1 -0
  27. package/dist/chunk-E6KPNTWW.js +295 -0
  28. package/dist/chunk-EOAB6G2D.js +149 -0
  29. package/dist/chunk-FAOVKDVM.js +32 -0
  30. package/dist/chunk-FV76Z4Z2.js +78 -0
  31. package/dist/chunk-GLTLBUZ7.js +285 -0
  32. package/dist/chunk-GTZFV43T.js +154 -0
  33. package/dist/chunk-HRGZNL4A.js +88 -0
  34. package/dist/chunk-IEVN3J2F.js +98 -0
  35. package/dist/chunk-IRS3T6LF.js +352 -0
  36. package/dist/chunk-IYYHCQXG.js +146 -0
  37. package/dist/chunk-JIXW3455.js +89 -0
  38. package/dist/chunk-N4VAP2GB.js +77 -0
  39. package/dist/chunk-SJ2ZRYVV.js +167 -0
  40. package/dist/chunk-SNU4YXOR.js +66 -0
  41. package/dist/chunk-TT6JQATV.js +99 -0
  42. package/dist/chunk-UPQ3ZPCO.js +66 -0
  43. package/dist/chunk-UVUSVFOH.js +264 -0
  44. package/dist/chunk-WJFPGGJB.js +255 -0
  45. package/dist/chunk-WXEBQA7A.js +371 -0
  46. package/dist/chunk-Y2O4YYZQ.js +184 -0
  47. package/dist/cut-corner.cjs +111 -0
  48. package/dist/cut-corner.d.cts +49 -0
  49. package/dist/cut-corner.d.ts +49 -0
  50. package/dist/cut-corner.js +1 -0
  51. package/dist/dialog.cjs +441 -0
  52. package/dist/dialog.d.cts +240 -0
  53. package/dist/dialog.d.ts +240 -0
  54. package/dist/dialog.js +3 -0
  55. package/dist/feature-card.cjs +182 -0
  56. package/dist/feature-card.d.cts +54 -0
  57. package/dist/feature-card.d.ts +54 -0
  58. package/dist/feature-card.js +2 -0
  59. package/dist/filter.cjs +873 -0
  60. package/dist/filter.d.cts +129 -0
  61. package/dist/filter.d.ts +129 -0
  62. package/dist/filter.js +6 -0
  63. package/dist/index.cjs +4583 -0
  64. package/dist/index.d.cts +29 -0
  65. package/dist/index.d.ts +29 -0
  66. package/dist/index.js +27 -0
  67. package/dist/inline-select.cjs +856 -0
  68. package/dist/inline-select.d.cts +92 -0
  69. package/dist/inline-select.d.ts +92 -0
  70. package/dist/inline-select.js +6 -0
  71. package/dist/input.cjs +263 -0
  72. package/dist/input.d.cts +157 -0
  73. package/dist/input.d.ts +157 -0
  74. package/dist/input.js +4 -0
  75. package/dist/panel.cjs +185 -0
  76. package/dist/panel.d.cts +103 -0
  77. package/dist/panel.d.ts +103 -0
  78. package/dist/panel.js +2 -0
  79. package/dist/property-grid.cjs +110 -0
  80. package/dist/property-grid.d.cts +56 -0
  81. package/dist/property-grid.d.ts +56 -0
  82. package/dist/property-grid.js +2 -0
  83. package/dist/radio.cjs +74 -0
  84. package/dist/radio.d.cts +39 -0
  85. package/dist/radio.d.ts +39 -0
  86. package/dist/radio.js +2 -0
  87. package/dist/scrollbar.cjs +34 -0
  88. package/dist/scrollbar.d.cts +35 -0
  89. package/dist/scrollbar.d.ts +35 -0
  90. package/dist/scrollbar.js +1 -0
  91. package/dist/search-bar.cjs +408 -0
  92. package/dist/search-bar.d.cts +42 -0
  93. package/dist/search-bar.d.ts +42 -0
  94. package/dist/search-bar.js +4 -0
  95. package/dist/select.cjs +998 -0
  96. package/dist/select.d.cts +357 -0
  97. package/dist/select.d.ts +357 -0
  98. package/dist/select.js +5 -0
  99. package/dist/selectable-feature-card.cjs +159 -0
  100. package/dist/selectable-feature-card.d.cts +74 -0
  101. package/dist/selectable-feature-card.d.ts +74 -0
  102. package/dist/selectable-feature-card.js +3 -0
  103. package/dist/sidebar-item.cjs +175 -0
  104. package/dist/sidebar-item.d.cts +75 -0
  105. package/dist/sidebar-item.d.ts +75 -0
  106. package/dist/sidebar-item.js +2 -0
  107. package/dist/switch.cjs +86 -0
  108. package/dist/switch.d.cts +72 -0
  109. package/dist/switch.d.ts +72 -0
  110. package/dist/switch.js +2 -0
  111. package/dist/table-cell.cjs +196 -0
  112. package/dist/table-cell.d.cts +76 -0
  113. package/dist/table-cell.d.ts +76 -0
  114. package/dist/table-cell.js +2 -0
  115. package/dist/table-title.cjs +34 -0
  116. package/dist/table-title.d.cts +16 -0
  117. package/dist/table-title.d.ts +16 -0
  118. package/dist/table-title.js +2 -0
  119. package/dist/tabs.cjs +299 -0
  120. package/dist/tabs.d.cts +116 -0
  121. package/dist/tabs.d.ts +116 -0
  122. package/dist/tabs.js +2 -0
  123. package/dist/toast.cjs +87 -0
  124. package/dist/toast.d.cts +48 -0
  125. package/dist/toast.d.ts +48 -0
  126. package/dist/toast.js +2 -0
  127. package/dist/token-input.cjs +415 -0
  128. package/dist/token-input.d.cts +90 -0
  129. package/dist/token-input.d.ts +90 -0
  130. package/dist/token-input.js +3 -0
  131. package/dist/tooltip.cjs +384 -0
  132. package/dist/tooltip.d.cts +142 -0
  133. package/dist/tooltip.d.ts +142 -0
  134. package/dist/tooltip.js +2 -0
  135. package/package.json +200 -0
  136. package/src/fonts.css +33 -0
@@ -0,0 +1,157 @@
1
+ import * as React from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ /**
6
+ * Input styling — mirrors the Figma `BaseInput` component (node 4973:6816) and
7
+ * binds ONLY to the semantic `--input-*` token layer (never primitives, never
8
+ * arbitrary values). Theme switching is automatic via the `.dark` class, so no
9
+ * `dark:` variants are needed.
10
+ *
11
+ * This cva styles the FIELD wrapper (the row that holds the leading icon, the
12
+ * real `<input>`, and the trailing icon) — NOT the bare `<input>`, whose own
13
+ * classes live in <Input> so the token that colours typed text
14
+ * (`text-input-foreground-accent`) and the placeholder
15
+ * (`text-input-foreground-muted`) can sit on the element itself.
16
+ *
17
+ * The 7 Figma "states" (default / hover / focused&active / active&filled /
18
+ * filled …) are runtime DOM states of a real `<input>`, NOT a prop:
19
+ * - hover → a text (I-beam) cursor affordance ONLY (`cursor-text` in the
20
+ * base). Hover does NOT recolour the border/underline. This is a
21
+ * deliberate, user-authorized deviation from the Figma (which draws
22
+ * the accent border on hover): the team decided hover is a pointer
23
+ * affordance, not a colour change.
24
+ * - focus → `focus-within:` on the field wrapper recolours the border (field)
25
+ * / bottom line (line) to `input-border-accent`. The input is the
26
+ * focusable descendant; the visible treatment lives on its wrapper.
27
+ * There is NO system outline ring on this control (see below).
28
+ * - filled → whether the input holds a value (no styling delta in this token
29
+ * set beyond the typed-text colour, applied on the input directly).
30
+ * Only `disabled` and `error` are real props (handled below + in <Input>).
31
+ *
32
+ * Focus model — user-authorized exception to ADR-0010 #4 / ADR-0011:
33
+ * text inputs do NOT use the system `:focus-visible` outline ring. A keyboard
34
+ * user never triggers `:hover`, and (since hover no longer changes colour) the
35
+ * gray→accent border recolour on ANY focus is itself a clear, unambiguous
36
+ * WCAG 2.1 AA (2.4.7) focus indicator. Text inputs also hold focus while the
37
+ * user types, so `focus-within` (any focus, not just `:focus-visible`) is the
38
+ * correct trigger. The ring is intentionally omitted here; do NOT re-add it.
39
+ *
40
+ * Variant × size axes (both independent, 4 combinations):
41
+ * - variation `field`: bordered rounded box (`bg-input-background`, `border`,
42
+ * `rounded-sm`, horizontal padding). Focus strengthens the border to
43
+ * `input-border-accent` (hover does not change colour).
44
+ * - variation `line`: no box/background — a single bottom border only
45
+ * (`border-b`), no horizontal padding. Focus strengthens the bottom line
46
+ * (hover does not change colour).
47
+ *
48
+ * Sizes reuse the sibling sm/lg scale (Button = `h-8` / `h-10`):
49
+ * - lg: `h-10`, `gap-2`, `py-2`; field adds `px-3` (Figma field-lg = 12px).
50
+ * - sm: `h-8`, `gap-1`; line uses `py-2.5` (Figma line-sm = 10px), field uses
51
+ * `py-2` (matches lg vertical rhythm inside the shorter box).
52
+ *
53
+ * field-sm horizontal padding is DERIVED (Figma only draws field-lg): we use
54
+ * `px-2` (8px = `spacing/2`), stepping down from field-lg's `px-3` (12px) and
55
+ * matching field-sm's own `py-2` (8px) for a uniform `spacing/2` inset on all
56
+ * sides. (This is a deliberate token-aligned choice; it does NOT match
57
+ * Button's sm `px-2.5`.)
58
+ *
59
+ * Error is a prop, not an interaction state: it recolours the border/bottom
60
+ * line to the destructive accent and out-ranks focus (an errored field stays
61
+ * red when focused — it never flips to the purple accent), so its border
62
+ * utilities are declared with matching-but-later specificity via the `error`
63
+ * variant below (a plain destructive border for the resting state plus a
64
+ * `focus-within:` destructive form that out-ranks the variation's
65
+ * `focus-within:` accent by class order).
66
+ *
67
+ * `showBottomLine` (LINE ONLY) toggles the resting visibility of the bottom
68
+ * line without any layout shift. The `border-b` (1px width) is ALWAYS present;
69
+ * only the border COLOUR changes. When `false`, a compound variant recolours
70
+ * the resting bottom line to `border-transparent` (invisible), while focus
71
+ * (`focus-within:border-input-border-accent`) and error still win — so the
72
+ * line reappears on focus and on error. The compound is gated on `error:false`
73
+ * so an errored field's destructive rest border is NOT overridden by
74
+ * transparent (tailwind-merge last-wins would otherwise drop it). On the
75
+ * `field` variation `showBottomLine` has NO effect: the compound is scoped to
76
+ * `variation:line`, so `field`'s box border is untouched.
77
+ */
78
+ declare const inputVariants: (props?: ({
79
+ variation?: "line" | "field" | null | undefined;
80
+ size?: "sm" | "lg" | null | undefined;
81
+ error?: boolean | null | undefined;
82
+ showBottomLine?: boolean | null | undefined;
83
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
84
+ type InputVariantsProps = VariantProps<typeof inputVariants>;
85
+
86
+ interface InputProps extends Omit<React.ComponentProps<"input">, "size">, Omit<InputVariantsProps, "error"> {
87
+ /**
88
+ * Uppercase label shown above the field. When omitted the label row is not
89
+ * rendered. Always paired with the `<input>` via generated `id`/`htmlFor`
90
+ * (or your own `id`), so the control is properly named for assistive tech.
91
+ */
92
+ label?: React.ReactNode;
93
+ /**
94
+ * Marks the field as not required — renders an "Optional" tag on the right of
95
+ * the label row (Figma). Has no effect without a `label`.
96
+ */
97
+ optional?: boolean;
98
+ /**
99
+ * Helper text shown below the field, with a leading 16px icon (info by
100
+ * default, warning when `error`). Linked to the input via `aria-describedby`.
101
+ */
102
+ hint?: React.ReactNode;
103
+ /**
104
+ * Error state (a prop, not an interaction state): sets `aria-invalid`, turns
105
+ * the label, border/bottom-line, icons and hint to the destructive accent,
106
+ * and swaps the hint icon to a warning.
107
+ */
108
+ error?: boolean;
109
+ /** Leading adornment (usually a 16px Phosphor icon). Decorative — kept out of the a11y tree via `aria-hidden`. */
110
+ leftSlot?: React.ReactNode;
111
+ /**
112
+ * Trailing adornment. Usually a 16px Phosphor icon (decorative), but MAY be an
113
+ * interactive control (e.g. SearchBar's clear `<button>`). The wrapper is NOT
114
+ * `aria-hidden` (that would hide a focusable child from assistive tech — an
115
+ * ARIA violation); decorative bare `<svg>` icons are silent to AT on their own
116
+ * (no role, no accessible name), so they stay unannounced without it. An
117
+ * interactive control placed here must carry its own accessible name.
118
+ */
119
+ rightSlot?: React.ReactNode;
120
+ /** Class names for the outer wrapper (the vertical label/field/hint stack). */
121
+ wrapperClassName?: string;
122
+ /** Class names for the field row (border/background box), not the `<input>`. */
123
+ fieldClassName?: string;
124
+ /**
125
+ * Toggles the resting visibility of the bottom line on the **`line`**
126
+ * variation only. Default `true` (line visible at rest). When `false`, the
127
+ * bottom line is hidden at rest (recoloured to transparent) but still appears
128
+ * on focus (accent) and on error (destructive); the 1px `border-b` is kept in
129
+ * all cases so there is no layout shift — only the border colour changes.
130
+ *
131
+ * Has NO effect on the `field` variation (its box border is out of scope).
132
+ */
133
+ showBottomLine?: boolean;
134
+ }
135
+ /**
136
+ * Text input — the Figma `BaseInput` component (node 4973:6816), rendered as a
137
+ * real `<input>` wrapped in a field row with optional `leftSlot`/`rightSlot`
138
+ * icon slots, an optional uppercase label row, and an optional hint message.
139
+ *
140
+ * Follows the ADR-0010 form-control conventions: the native `<input>` is the
141
+ * single source of truth (uncontrolled `defaultValue` or controlled
142
+ * `value` + `onChange`); the component holds no React state. `ref` is a normal
143
+ * prop (React 19). Not `asChild` — the root must stay a void, platform-behaviour
144
+ * -bearing `<input>` (ADR-0010).
145
+ *
146
+ * Two independent axes (4 combinations): `variation` (`field` bordered box /
147
+ * `line` bottom-border-only) × `size` (`sm` / `lg`, reusing the sibling scale).
148
+ * The Figma "states" (hover/focus/filled) are runtime DOM states: hover is an
149
+ * I-beam cursor affordance only (no colour change), focus recolours the border
150
+ * via `focus-within:` (no system outline ring — a user-authorized exception to
151
+ * ADR-0010 #4 / ADR-0011, see `inputVariants.ts`), and filled shows the typed-
152
+ * text colour. Only `disabled` (native attribute) and `error` (prop) are real
153
+ * props.
154
+ */
155
+ declare function Input({ className, fieldClassName, wrapperClassName, variation, size, error, showBottomLine, label, optional, hint, leftSlot, rightSlot, disabled, id: idProp, ref, ...props }: InputProps): React.JSX.Element;
156
+
157
+ export { Input, type InputProps, type InputVariantsProps, inputVariants };
package/dist/input.js ADDED
@@ -0,0 +1,4 @@
1
+ import './chunk-DGBXADSS.js';
2
+ export { Input } from './chunk-AIQ4UOGK.js';
3
+ export { inputVariants } from './chunk-IEVN3J2F.js';
4
+ import './chunk-7EOSDFS3.js';
package/dist/panel.cjs ADDED
@@ -0,0 +1,185 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var react = require('@phosphor-icons/react');
5
+ var clsx = require('clsx');
6
+ var tailwindMerge = require('tailwind-merge');
7
+ var classVarianceAuthority = require('class-variance-authority');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
+
30
+ // src/panel/Panel.tsx
31
+ function cn(...inputs) {
32
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
33
+ }
34
+ var panelVariants = classVarianceAuthority.cva([
35
+ "flex w-80 flex-col gap-4 rounded-md border border-card-border bg-card-background p-5"
36
+ ]);
37
+ var panelHeaderVariants = classVarianceAuthority.cva(["flex items-start gap-4"]);
38
+ var panelHeaderContentVariants = classVarianceAuthority.cva([
39
+ "flex min-w-0 flex-1 items-center gap-3"
40
+ ]);
41
+ var panelHeaderIconVariants = classVarianceAuthority.cva([
42
+ "flex items-center text-card-foreground [&_svg]:size-6 [&_svg]:shrink-0"
43
+ ]);
44
+ var panelHeaderTextVariants = classVarianceAuthority.cva(["flex min-w-0 flex-col"]);
45
+ var panelCloseButtonVariants = classVarianceAuthority.cva([
46
+ "flex shrink-0 cursor-pointer items-center justify-center rounded-xs",
47
+ "text-card-foreground-muted transition-colors hover:text-card-foreground",
48
+ "[&_svg]:size-4 [&_svg]:shrink-0",
49
+ "outline-none focus-visible:text-card-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"
50
+ ]);
51
+ var panelBodyVariants = classVarianceAuthority.cva(["text-card-foreground"]);
52
+ var panelFooterVariants = classVarianceAuthority.cva(["flex items-start gap-2"]);
53
+ var PanelContext = React__namespace.createContext(null);
54
+ function usePanelContext() {
55
+ return React__namespace.useContext(PanelContext);
56
+ }
57
+ function PanelRoot({
58
+ className,
59
+ children,
60
+ ref,
61
+ "aria-label": ariaLabel,
62
+ "aria-labelledby": ariaLabelledby,
63
+ ...props
64
+ }) {
65
+ const reactId = React__namespace.useId();
66
+ const titleId = `${reactId}-title`;
67
+ const [hasTitle, setHasTitle] = React__namespace.useState(false);
68
+ const labelledBy = hasTitle ? titleId : ariaLabelledby;
69
+ const hasName = Boolean(labelledBy || ariaLabel);
70
+ const value = { titleId, setHasTitle };
71
+ return /* @__PURE__ */ jsxRuntime.jsx(PanelContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
72
+ "div",
73
+ {
74
+ ref,
75
+ role: hasName ? "region" : void 0,
76
+ "aria-label": ariaLabel,
77
+ "aria-labelledby": labelledBy,
78
+ "data-slot": "panel",
79
+ className: cn(panelVariants(), className),
80
+ ...props,
81
+ children
82
+ }
83
+ ) });
84
+ }
85
+ function PanelHeader({
86
+ icon,
87
+ title,
88
+ description,
89
+ showClose = true,
90
+ onClose,
91
+ className,
92
+ ref,
93
+ ...props
94
+ }) {
95
+ const context = usePanelContext();
96
+ const titleId = context?.titleId;
97
+ const setHasTitle = context?.setHasTitle;
98
+ const hasDescription = description != null;
99
+ React__namespace.useEffect(() => {
100
+ if (!setHasTitle) return;
101
+ setHasTitle(true);
102
+ return () => setHasTitle(false);
103
+ }, [setHasTitle]);
104
+ return /* @__PURE__ */ jsxRuntime.jsxs(
105
+ "div",
106
+ {
107
+ ref,
108
+ "data-slot": "panel-header",
109
+ className: cn(panelHeaderVariants(), className),
110
+ ...props,
111
+ children: [
112
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: panelHeaderContentVariants(), children: [
113
+ icon != null && /* @__PURE__ */ jsxRuntime.jsx(
114
+ "span",
115
+ {
116
+ "data-slot": "panel-header-icon",
117
+ "aria-hidden": "true",
118
+ className: panelHeaderIconVariants(),
119
+ children: icon
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: panelHeaderTextVariants(), children: [
123
+ /* @__PURE__ */ jsxRuntime.jsx("p", { id: titleId, className: "body-02-medium text-card-foreground", children: title }),
124
+ hasDescription && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "body-03 text-card-foreground-muted", children: description })
125
+ ] })
126
+ ] }),
127
+ showClose && /* @__PURE__ */ jsxRuntime.jsx(
128
+ "button",
129
+ {
130
+ type: "button",
131
+ "data-slot": "panel-header-close",
132
+ "aria-label": "Close",
133
+ className: panelCloseButtonVariants(),
134
+ onClick: () => onClose?.(),
135
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { weight: "regular" })
136
+ }
137
+ )
138
+ ]
139
+ }
140
+ );
141
+ }
142
+ function PanelBody({ className, children, ref, ...props }) {
143
+ return /* @__PURE__ */ jsxRuntime.jsx(
144
+ "div",
145
+ {
146
+ ref,
147
+ "data-slot": "panel-body",
148
+ className: cn(panelBodyVariants(), className),
149
+ ...props,
150
+ children
151
+ }
152
+ );
153
+ }
154
+ function PanelFooter({ className, children, ref, ...props }) {
155
+ return /* @__PURE__ */ jsxRuntime.jsx(
156
+ "div",
157
+ {
158
+ ref,
159
+ "data-slot": "panel-footer",
160
+ className: cn(panelFooterVariants(), className),
161
+ ...props,
162
+ children
163
+ }
164
+ );
165
+ }
166
+ var Panel = {
167
+ Root: PanelRoot,
168
+ Header: PanelHeader,
169
+ Body: PanelBody,
170
+ Footer: PanelFooter
171
+ };
172
+
173
+ exports.Panel = Panel;
174
+ exports.PanelBody = PanelBody;
175
+ exports.PanelFooter = PanelFooter;
176
+ exports.PanelHeader = PanelHeader;
177
+ exports.PanelRoot = PanelRoot;
178
+ exports.panelBodyVariants = panelBodyVariants;
179
+ exports.panelCloseButtonVariants = panelCloseButtonVariants;
180
+ exports.panelFooterVariants = panelFooterVariants;
181
+ exports.panelHeaderContentVariants = panelHeaderContentVariants;
182
+ exports.panelHeaderIconVariants = panelHeaderIconVariants;
183
+ exports.panelHeaderTextVariants = panelHeaderTextVariants;
184
+ exports.panelHeaderVariants = panelHeaderVariants;
185
+ exports.panelVariants = panelVariants;
@@ -0,0 +1,103 @@
1
+ import * as React from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+
4
+ interface PanelRootProps extends React.ComponentProps<"div"> {
5
+ }
6
+ /**
7
+ * The card container + context provider. A plain flow `<div>` (no overlay). It
8
+ * becomes a `region` landmark only when it has an accessible name: a `Panel.Header`
9
+ * title (auto-wired via context) or a consumer-supplied `aria-label`/
10
+ * `aria-labelledby`. Without a name it renders a plain `<div>` (an unnamed
11
+ * landmark is an a11y violation). Forwards `ref` to the card.
12
+ */
13
+ declare function PanelRoot({ className, children, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }: PanelRootProps): React.JSX.Element;
14
+ interface PanelHeaderProps extends Omit<React.ComponentProps<"div">, "title"> {
15
+ /**
16
+ * Decorative 24px icon (rendered `aria-hidden`), inline-left of the title.
17
+ * Hidden when omitted. Rendered as-is — the header does NOT force a weight
18
+ * (unlike Dialog's filled-icon slot), so the app controls the icon's weight
19
+ * (Phosphor's default is `regular`).
20
+ */
21
+ icon?: React.ReactNode;
22
+ /** Title — becomes the Panel's `aria-labelledby` target (`body-02-medium`). */
23
+ title: React.ReactNode;
24
+ /** Optional description (`body-03`, muted). Rendered only when provided. */
25
+ description?: React.ReactNode;
26
+ /** Show the inline close X. Default `true` (matches Figma). */
27
+ showClose?: boolean;
28
+ /** Called when the close X is activated. Optional — X is inert without it. */
29
+ onClose?: () => void;
30
+ }
31
+ /**
32
+ * Header row: an optional inline icon + the title (registers the
33
+ * `aria-labelledby` id via context) + an optional description, with an optional
34
+ * inline close X at the row's end. Unlike Dialog, the icon is inline-left and
35
+ * the close X sits in the row flow (not absolute against the card).
36
+ */
37
+ declare function PanelHeader({ icon, title, description, showClose, onClose, className, ref, ...props }: PanelHeaderProps): React.JSX.Element;
38
+ interface PanelBodyProps extends React.ComponentProps<"div"> {
39
+ }
40
+ /** Flexible content slot. Sizes to content (no fixed height). Forwards `ref`. */
41
+ declare function PanelBody({ className, children, ref, ...props }: PanelBodyProps): React.JSX.Element;
42
+ interface PanelFooterProps extends React.ComponentProps<"div"> {
43
+ }
44
+ /**
45
+ * Action-row slot: a left-aligned flex row (`gap-2`) of content-width children
46
+ * (Figma's footer layout — NOT stretched like `Dialog.Footer`). Forwards `ref`.
47
+ */
48
+ declare function PanelFooter({ className, children, ref, ...props }: PanelFooterProps): React.JSX.Element;
49
+ declare const Panel: {
50
+ Root: typeof PanelRoot;
51
+ Header: typeof PanelHeader;
52
+ Body: typeof PanelBody;
53
+ Footer: typeof PanelFooter;
54
+ };
55
+
56
+ /**
57
+ * Panel styling — the Figma `panel` card (node `5041:4303`). Binds ONLY to the
58
+ * `card-*` semantic token layer (never primitives, never mode plumbing); theme
59
+ * switching is automatic via `.dark`, so no `dark:` variants are needed.
60
+ *
61
+ * Panel is presentation-neutral: no `variation` prop (see ADR-0023). The basic
62
+ * vs branded looks come from the app-supplied header icon + footer `Button`
63
+ * variation, so these tables carry no variant axes.
64
+ */
65
+ /**
66
+ * The card. `w-80` = 320px (Figma-exact default width; overridable via
67
+ * `className`). `p-5` = spacing/5 (20px), `gap-4` = spacing/4 (16px),
68
+ * `rounded-md` = radius/md (6px), `border` = border-width/1 (1px).
69
+ */
70
+ declare const panelVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
71
+ /**
72
+ * Header row — a HORIZONTAL row (the key divergence from Dialog's vertical
73
+ * stack). `items-start` so the close button pins to the top of the row while
74
+ * the content block's icon+text center against each other. `gap-4` = 16px.
75
+ */
76
+ declare const panelHeaderVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
77
+ /**
78
+ * Header content block: inline icon + title/description column, vertically
79
+ * centered against each other (`items-center`), `gap-3` = 12px. `flex-1 min-w-0`
80
+ * takes the row's free space and lets long titles truncate rather than push the
81
+ * close button out.
82
+ */
83
+ declare const panelHeaderContentVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
84
+ /** Inline 24px decorative icon slot (`aria-hidden` on the element). */
85
+ declare const panelHeaderIconVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
86
+ /** Title + description column (stacked). `min-w-0` enables text truncation. */
87
+ declare const panelHeaderTextVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
88
+ /**
89
+ * The 16px muted close X — INLINE at the row's end (not absolute like Dialog).
90
+ * `shrink-0` keeps it from collapsing. Focus ring per ADR-0010 (TW4 needs
91
+ * `outline-solid`).
92
+ */
93
+ declare const panelCloseButtonVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
94
+ /** Body slot: sizes to content (no fixed height — Figma's 160px is demo-only). */
95
+ declare const panelBodyVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
96
+ /**
97
+ * Footer action row: `gap-2` = 8px, buttons CONTENT-WIDTH and LEFT-ALIGNED
98
+ * (Figma `items-start`). Unlike `Dialog.Footer`, buttons are NOT stretched to
99
+ * equal width.
100
+ */
101
+ declare const panelFooterVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
102
+
103
+ export { Panel, PanelBody, type PanelBodyProps, PanelFooter, type PanelFooterProps, PanelHeader, type PanelHeaderProps, PanelRoot, type PanelRootProps, panelBodyVariants, panelCloseButtonVariants, panelFooterVariants, panelHeaderContentVariants, panelHeaderIconVariants, panelHeaderTextVariants, panelHeaderVariants, panelVariants };
@@ -0,0 +1,103 @@
1
+ import * as React from 'react';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+
4
+ interface PanelRootProps extends React.ComponentProps<"div"> {
5
+ }
6
+ /**
7
+ * The card container + context provider. A plain flow `<div>` (no overlay). It
8
+ * becomes a `region` landmark only when it has an accessible name: a `Panel.Header`
9
+ * title (auto-wired via context) or a consumer-supplied `aria-label`/
10
+ * `aria-labelledby`. Without a name it renders a plain `<div>` (an unnamed
11
+ * landmark is an a11y violation). Forwards `ref` to the card.
12
+ */
13
+ declare function PanelRoot({ className, children, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }: PanelRootProps): React.JSX.Element;
14
+ interface PanelHeaderProps extends Omit<React.ComponentProps<"div">, "title"> {
15
+ /**
16
+ * Decorative 24px icon (rendered `aria-hidden`), inline-left of the title.
17
+ * Hidden when omitted. Rendered as-is — the header does NOT force a weight
18
+ * (unlike Dialog's filled-icon slot), so the app controls the icon's weight
19
+ * (Phosphor's default is `regular`).
20
+ */
21
+ icon?: React.ReactNode;
22
+ /** Title — becomes the Panel's `aria-labelledby` target (`body-02-medium`). */
23
+ title: React.ReactNode;
24
+ /** Optional description (`body-03`, muted). Rendered only when provided. */
25
+ description?: React.ReactNode;
26
+ /** Show the inline close X. Default `true` (matches Figma). */
27
+ showClose?: boolean;
28
+ /** Called when the close X is activated. Optional — X is inert without it. */
29
+ onClose?: () => void;
30
+ }
31
+ /**
32
+ * Header row: an optional inline icon + the title (registers the
33
+ * `aria-labelledby` id via context) + an optional description, with an optional
34
+ * inline close X at the row's end. Unlike Dialog, the icon is inline-left and
35
+ * the close X sits in the row flow (not absolute against the card).
36
+ */
37
+ declare function PanelHeader({ icon, title, description, showClose, onClose, className, ref, ...props }: PanelHeaderProps): React.JSX.Element;
38
+ interface PanelBodyProps extends React.ComponentProps<"div"> {
39
+ }
40
+ /** Flexible content slot. Sizes to content (no fixed height). Forwards `ref`. */
41
+ declare function PanelBody({ className, children, ref, ...props }: PanelBodyProps): React.JSX.Element;
42
+ interface PanelFooterProps extends React.ComponentProps<"div"> {
43
+ }
44
+ /**
45
+ * Action-row slot: a left-aligned flex row (`gap-2`) of content-width children
46
+ * (Figma's footer layout — NOT stretched like `Dialog.Footer`). Forwards `ref`.
47
+ */
48
+ declare function PanelFooter({ className, children, ref, ...props }: PanelFooterProps): React.JSX.Element;
49
+ declare const Panel: {
50
+ Root: typeof PanelRoot;
51
+ Header: typeof PanelHeader;
52
+ Body: typeof PanelBody;
53
+ Footer: typeof PanelFooter;
54
+ };
55
+
56
+ /**
57
+ * Panel styling — the Figma `panel` card (node `5041:4303`). Binds ONLY to the
58
+ * `card-*` semantic token layer (never primitives, never mode plumbing); theme
59
+ * switching is automatic via `.dark`, so no `dark:` variants are needed.
60
+ *
61
+ * Panel is presentation-neutral: no `variation` prop (see ADR-0023). The basic
62
+ * vs branded looks come from the app-supplied header icon + footer `Button`
63
+ * variation, so these tables carry no variant axes.
64
+ */
65
+ /**
66
+ * The card. `w-80` = 320px (Figma-exact default width; overridable via
67
+ * `className`). `p-5` = spacing/5 (20px), `gap-4` = spacing/4 (16px),
68
+ * `rounded-md` = radius/md (6px), `border` = border-width/1 (1px).
69
+ */
70
+ declare const panelVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
71
+ /**
72
+ * Header row — a HORIZONTAL row (the key divergence from Dialog's vertical
73
+ * stack). `items-start` so the close button pins to the top of the row while
74
+ * the content block's icon+text center against each other. `gap-4` = 16px.
75
+ */
76
+ declare const panelHeaderVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
77
+ /**
78
+ * Header content block: inline icon + title/description column, vertically
79
+ * centered against each other (`items-center`), `gap-3` = 12px. `flex-1 min-w-0`
80
+ * takes the row's free space and lets long titles truncate rather than push the
81
+ * close button out.
82
+ */
83
+ declare const panelHeaderContentVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
84
+ /** Inline 24px decorative icon slot (`aria-hidden` on the element). */
85
+ declare const panelHeaderIconVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
86
+ /** Title + description column (stacked). `min-w-0` enables text truncation. */
87
+ declare const panelHeaderTextVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
88
+ /**
89
+ * The 16px muted close X — INLINE at the row's end (not absolute like Dialog).
90
+ * `shrink-0` keeps it from collapsing. Focus ring per ADR-0010 (TW4 needs
91
+ * `outline-solid`).
92
+ */
93
+ declare const panelCloseButtonVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
94
+ /** Body slot: sizes to content (no fixed height — Figma's 160px is demo-only). */
95
+ declare const panelBodyVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
96
+ /**
97
+ * Footer action row: `gap-2` = 8px, buttons CONTENT-WIDTH and LEFT-ALIGNED
98
+ * (Figma `items-start`). Unlike `Dialog.Footer`, buttons are NOT stretched to
99
+ * equal width.
100
+ */
101
+ declare const panelFooterVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
102
+
103
+ export { Panel, PanelBody, type PanelBodyProps, PanelFooter, type PanelFooterProps, PanelHeader, type PanelHeaderProps, PanelRoot, type PanelRootProps, panelBodyVariants, panelCloseButtonVariants, panelFooterVariants, panelHeaderContentVariants, panelHeaderIconVariants, panelHeaderTextVariants, panelHeaderVariants, panelVariants };
package/dist/panel.js ADDED
@@ -0,0 +1,2 @@
1
+ export { Panel, PanelBody, PanelFooter, PanelHeader, PanelRoot, panelBodyVariants, panelCloseButtonVariants, panelFooterVariants, panelHeaderContentVariants, panelHeaderIconVariants, panelHeaderTextVariants, panelHeaderVariants, panelVariants } from './chunk-IYYHCQXG.js';
2
+ import './chunk-7EOSDFS3.js';
@@ -0,0 +1,110 @@
1
+ 'use strict';
2
+
3
+ var clsx = require('clsx');
4
+ var tailwindMerge = require('tailwind-merge');
5
+ var classVarianceAuthority = require('class-variance-authority');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ // src/lib/cn.ts
9
+ function cn(...inputs) {
10
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
11
+ }
12
+ var propertyGridCellVariants = classVarianceAuthority.cva(
13
+ [
14
+ // Layout — 40px row, single line, slots on a horizontal axis.
15
+ "flex h-10 min-w-0 items-center gap-1 py-3",
16
+ // Type — Archivo 14/20.
17
+ "body-03"
18
+ ],
19
+ {
20
+ variants: {
21
+ variant: {
22
+ title: "justify-start text-card-foreground-muted",
23
+ content: "justify-end text-card-foreground"
24
+ }
25
+ },
26
+ defaultVariants: {
27
+ variant: "title"
28
+ }
29
+ }
30
+ );
31
+ var propertyGridItemVariants = classVarianceAuthority.cva(["grid grid-cols-2"], {
32
+ variants: {
33
+ last: {
34
+ false: "border-b border-card-border",
35
+ true: ""
36
+ }
37
+ },
38
+ defaultVariants: {
39
+ last: false
40
+ }
41
+ });
42
+ function PropertyGridItem({
43
+ className,
44
+ last = false,
45
+ children,
46
+ ref,
47
+ ...props
48
+ }) {
49
+ return /* @__PURE__ */ jsxRuntime.jsx(
50
+ "div",
51
+ {
52
+ "data-slot": "property-grid-item",
53
+ className: cn(propertyGridItemVariants({ last }), className),
54
+ ref,
55
+ ...props,
56
+ children
57
+ }
58
+ );
59
+ }
60
+ function PropertyGridCell({
61
+ variant,
62
+ className,
63
+ leading,
64
+ trailing,
65
+ children,
66
+ ref,
67
+ ...props
68
+ }) {
69
+ const slotClass = "flex shrink-0 items-center text-card-foreground-muted [&_svg]:size-4";
70
+ return /* @__PURE__ */ jsxRuntime.jsxs(
71
+ "div",
72
+ {
73
+ "data-slot": `property-grid-${variant}`,
74
+ className: cn(propertyGridCellVariants({ variant }), className),
75
+ ref,
76
+ ...props,
77
+ children: [
78
+ leading != null && /* @__PURE__ */ jsxRuntime.jsx(
79
+ "span",
80
+ {
81
+ "data-slot": `property-grid-${variant}-leading`,
82
+ className: slotClass,
83
+ children: leading
84
+ }
85
+ ),
86
+ children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children }),
87
+ trailing != null && /* @__PURE__ */ jsxRuntime.jsx(
88
+ "span",
89
+ {
90
+ "data-slot": `property-grid-${variant}-trailing`,
91
+ className: slotClass,
92
+ children: trailing
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ );
98
+ }
99
+ function PropertyGridTitle(props) {
100
+ return /* @__PURE__ */ jsxRuntime.jsx(PropertyGridCell, { variant: "title", ...props });
101
+ }
102
+ function PropertyGridContent(props) {
103
+ return /* @__PURE__ */ jsxRuntime.jsx(PropertyGridCell, { variant: "content", ...props });
104
+ }
105
+
106
+ exports.PropertyGridContent = PropertyGridContent;
107
+ exports.PropertyGridItem = PropertyGridItem;
108
+ exports.PropertyGridTitle = PropertyGridTitle;
109
+ exports.propertyGridCellVariants = propertyGridCellVariants;
110
+ exports.propertyGridItemVariants = propertyGridItemVariants;