jenosize-ui 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -10
- package/dist/Cartesian-ZIKPEYWP.d.ts +26 -0
- package/dist/{PaymentInput-CKPIPNWH.d.ts → PaymentInput-Dn5WVQVy.d.ts} +4 -0
- package/dist/{Select-CVbEQ2Ep.d.ts → Select-Dt5ARIH8.d.ts} +4 -0
- package/dist/{TagInput-CTJYOB4J.d.ts → TagInput-BaBeve6L.d.ts} +4 -0
- package/dist/area-chart.d.ts +54 -0
- package/dist/area-chart.js +9 -0
- package/dist/avatar.d.ts +24 -0
- package/dist/avatar.js +13 -7
- package/dist/badge.d.ts +4 -0
- package/dist/badge.js +6 -5
- package/dist/bar-chart.d.ts +32 -0
- package/dist/bar-chart.js +9 -0
- package/dist/breadcrumb.d.ts +4 -0
- package/dist/breadcrumb.js +5 -3
- package/dist/button.d.ts +16 -1
- package/dist/button.js +10 -8
- package/dist/calendar.d.ts +5 -0
- package/dist/calendar.js +18 -14
- package/dist/callout.d.ts +6 -6
- package/dist/callout.js +12 -9
- package/dist/card-D56VxyAe.d.ts +123 -0
- package/dist/card.d.ts +3 -1
- package/dist/card.js +7 -3
- package/dist/checkbox.js +9 -7
- package/dist/chunk-22M75A3N.js +396 -0
- package/dist/{chunk-D5BTFSL7.js → chunk-33TOK7ES.js} +7 -5
- package/dist/{chunk-THC2ISYP.js → chunk-3H444OJA.js} +6 -4
- package/dist/{chunk-GFOAJVW5.js → chunk-3QXLIZIX.js} +4 -13
- package/dist/chunk-3ZEEGXYF.js +8 -0
- package/dist/chunk-45Y2ZGNK.js +34 -0
- package/dist/{chunk-FHHAPGCR.js → chunk-4RBIWI2Q.js} +3 -3
- package/dist/chunk-4VGEJG4M.js +1510 -0
- package/dist/{chunk-PWKWNDBS.js → chunk-54SIZR63.js} +16 -8
- package/dist/chunk-5AZKP4KZ.js +49 -0
- package/dist/chunk-5DP7W5HX.js +254 -0
- package/dist/{chunk-J2BCKBHC.js → chunk-5KSD4WKN.js} +14 -5
- package/dist/{chunk-ZOOX3TUB.js → chunk-5XPMY2LF.js} +6 -6
- package/dist/chunk-5ZEUTSCV.js +147 -0
- package/dist/chunk-5ZPUAGOP.js +19 -0
- package/dist/{chunk-JTNFJLIY.js → chunk-667ZHY3T.js} +114 -42
- package/dist/{chunk-JP26LPCY.js → chunk-6B6BWTXC.js} +30 -13
- package/dist/{chunk-W5GGOUUI.js → chunk-6H4LNWQ7.js} +3 -3
- package/dist/{chunk-WFY7DKQD.js → chunk-6MMBQVRO.js} +61 -51
- package/dist/{chunk-7HOIZ3UO.js → chunk-7GUPNTAH.js} +15 -7
- package/dist/chunk-7VLYQR4D.js +44 -0
- package/dist/{chunk-KNYKWUYX.js → chunk-7ZM7SNCZ.js} +3 -3
- package/dist/{chunk-E7ZSWBAK.js → chunk-A323V6AI.js} +6 -4
- package/dist/chunk-AFYXSZGW.js +23 -0
- package/dist/chunk-AIARANKE.js +33 -0
- package/dist/{chunk-4OLULPQG.js → chunk-AIGYMTCU.js} +10 -6
- package/dist/{chunk-JVJRHBTD.js → chunk-AZ7DKRBY.js} +21 -8
- package/dist/{chunk-JYGR44ZC.js → chunk-BBKE4W3B.js} +19 -11
- package/dist/{chunk-Z3ETJN5G.js → chunk-BFVJHH7S.js} +8 -12
- package/dist/chunk-BLIZ3CL3.js +49 -0
- package/dist/{chunk-F2K7VJUV.js → chunk-CFFWYXDW.js} +19 -7
- package/dist/{chunk-MQGD2OUF.js → chunk-CGHYXWTT.js} +11 -5
- package/dist/{chunk-CYPPEUX5.js → chunk-CKMWBVRR.js} +27 -12
- package/dist/{chunk-GTHJWR3Q.js → chunk-D7EE5GWU.js} +21 -22
- package/dist/{chunk-5NOBSXJN.js → chunk-E2YZ7IMT.js} +24 -8
- package/dist/{chunk-T7FCG7XV.js → chunk-FFMTYQXE.js} +31 -11
- package/dist/{chunk-J36M3KRX.js → chunk-FH7Z7SGQ.js} +67 -32
- package/dist/chunk-FKVPAEJ6.js +57 -0
- package/dist/{chunk-GRLSUQQE.js → chunk-FNQJJO63.js} +4 -4
- package/dist/{chunk-5RAPA22E.js → chunk-FWRHBMWT.js} +4 -4
- package/dist/chunk-GLKFFA7N.js +171 -0
- package/dist/{chunk-KDLPXXD2.js → chunk-GQRSABRN.js} +4 -4
- package/dist/{chunk-DRZCJCBO.js → chunk-GZMDZF2V.js} +8 -7
- package/dist/chunk-HHYEAFCL.js +525 -0
- package/dist/{chunk-LME57Z6J.js → chunk-I6WMNXC7.js} +6 -6
- package/dist/chunk-IQNVSQRK.js +605 -0
- package/dist/chunk-KHGW72BM.js +10 -0
- package/dist/{chunk-ZZA2LUTL.js → chunk-KZP6B6B3.js} +41 -16
- package/dist/chunk-LCG34A5T.js +98 -0
- package/dist/chunk-LLPWQDF7.js +26 -0
- package/dist/{chunk-J7ZQQFPT.js → chunk-LO22VQL5.js} +18 -18
- package/dist/{chunk-BVJWBYIG.js → chunk-LQURV7HQ.js} +9 -7
- package/dist/{chunk-R6RGJF4L.js → chunk-LYXPJERB.js} +15 -5
- package/dist/{chunk-CME4DIML.js → chunk-MCQG4H6T.js} +54 -3
- package/dist/{chunk-VWC72TR3.js → chunk-MVG5MABV.js} +11 -8
- package/dist/{chunk-5FATN5YD.js → chunk-N3RVMBPX.js} +6 -9
- package/dist/chunk-NKG4N6HA.js +188 -0
- package/dist/{chunk-W46K56XU.js → chunk-OACWA4TC.js} +15 -69
- package/dist/chunk-OLLD2BZN.js +33 -0
- package/dist/{chunk-KMSYEE23.js → chunk-P6CON2R2.js} +25 -11
- package/dist/chunk-PO2TYK3C.js +17 -0
- package/dist/{chunk-7EWQKTNQ.js → chunk-POQTE7JI.js} +66 -25
- package/dist/{chunk-HMUZE6EK.js → chunk-QDKETK7D.js} +4 -4
- package/dist/{chunk-GCVA3OIV.js → chunk-QDYE5LVT.js} +13 -3
- package/dist/{chunk-WEUJYDCV.js → chunk-QHH6AUR3.js} +16 -8
- package/dist/chunk-RJTVCA62.js +42 -0
- package/dist/{chunk-MUFHLP4S.js → chunk-S5TEWPWW.js} +50 -41
- package/dist/{chunk-D6TPWNRK.js → chunk-SB3DG572.js} +15 -8
- package/dist/chunk-SKRR3ZMP.js +10 -0
- package/dist/chunk-T4ZFZTY6.js +62 -0
- package/dist/{chunk-I7WU4GTY.js → chunk-T5574MXM.js} +34 -46
- package/dist/{chunk-MKC5HNA7.js → chunk-U4WSJAYK.js} +374 -147
- package/dist/{chunk-BJUZVYQC.js → chunk-UGKELBNC.js} +60 -44
- package/dist/chunk-ULGCGKOE.js +77 -0
- package/dist/{chunk-QA74ITR4.js → chunk-X2VMIBK5.js} +45 -17
- package/dist/chunk-X2X7Q7NW.js +17 -0
- package/dist/chunk-YHBI52P2.js +10 -0
- package/dist/chunk-YIHKQ63K.js +13 -0
- package/dist/{chunk-3Y5X7B5C.js → chunk-YQYVGWIC.js} +6 -11
- package/dist/{chunk-WZQFC7ZN.js → chunk-ZHAT2XZ4.js} +139 -66
- package/dist/{chunk-7IU5TMFL.js → chunk-ZMFY7WAY.js} +124 -40
- package/dist/{chunk-SV56BSUQ.js → chunk-ZZSNTCCL.js} +6 -5
- package/dist/combobox.d.ts +5 -0
- package/dist/combobox.js +15 -12
- package/dist/control-size-CaxQhkKh.d.ts +3 -0
- package/dist/date-input.d.ts +4 -0
- package/dist/date-input.js +12 -9
- package/dist/date-picker.d.ts +6 -0
- package/dist/date-picker.js +25 -20
- package/dist/dialog.d.ts +37 -5
- package/dist/dialog.js +12 -8
- package/dist/drawer.d.ts +20 -3
- package/dist/drawer.js +11 -7
- package/dist/dropdown-menu.d.ts +26 -2
- package/dist/dropdown-menu.js +9 -4
- package/dist/dropzone.d.ts +35 -0
- package/dist/dropzone.js +23 -0
- package/dist/form.d.ts +82 -3
- package/dist/form.js +205 -45
- package/dist/header-navigation.d.ts +19 -4
- package/dist/header-navigation.js +23 -16
- package/dist/helper.d.ts +36 -0
- package/dist/helper.js +3 -0
- package/dist/index.d.ts +32 -8
- package/dist/index.js +87 -62
- package/dist/indicator.js +4 -4
- package/dist/input.d.ts +4 -0
- package/dist/input.js +10 -8
- package/dist/kanban-board.d.ts +489 -0
- package/dist/kanban-board.js +25 -0
- package/dist/labels-DPrh0se9.d.ts +627 -0
- package/dist/line-chart.d.ts +36 -0
- package/dist/line-chart.js +9 -0
- package/dist/{nav-Bla0o_-1.d.ts → nav-CKKqjBs6.d.ts} +18 -11
- package/dist/number-input.d.ts +4 -0
- package/dist/number-input.js +10 -8
- package/dist/pagination.d.ts +7 -1
- package/dist/pagination.js +14 -10
- package/dist/panel-El4oI68p.d.ts +9 -0
- package/dist/payment-input.d.ts +3 -2
- package/dist/payment-input.js +10 -8
- package/dist/pie-chart.d.ts +64 -0
- package/dist/pie-chart.js +9 -0
- package/dist/popover.d.ts +9 -3
- package/dist/popover.js +11 -7
- package/dist/progress-steps.d.ts +275 -0
- package/dist/progress-steps.js +8 -0
- package/dist/progress.d.ts +21 -1
- package/dist/progress.js +3 -2
- package/dist/provider.d.ts +212 -0
- package/dist/provider.js +7 -0
- package/dist/radar-chart.d.ts +77 -0
- package/dist/radar-chart.js +9 -0
- package/dist/radial-chart.d.ts +73 -0
- package/dist/radial-chart.js +9 -0
- package/dist/radio.js +9 -7
- package/dist/rule-BqzaIwJy.d.ts +80 -0
- package/dist/scroll-area.d.ts +62 -0
- package/dist/scroll-area.js +7 -0
- package/dist/select.d.ts +3 -3
- package/dist/select.js +17 -14
- package/dist/separator.d.ts +114 -0
- package/dist/separator.js +5 -0
- package/dist/shared-CxAedkiy.d.ts +68 -0
- package/dist/sidebar-navigation.d.ts +80 -12
- package/dist/sidebar-navigation.js +18 -9
- package/dist/skeleton.d.ts +61 -0
- package/dist/skeleton.js +5 -0
- package/dist/styles.css +1 -1
- package/dist/switch.js +4 -4
- package/dist/table.d.ts +148 -42
- package/dist/table.js +39 -33
- package/dist/tabs.d.ts +22 -0
- package/dist/tabs.js +3 -3
- package/dist/tag-input.d.ts +3 -2
- package/dist/tag-input.js +13 -11
- package/dist/tag.d.ts +4 -0
- package/dist/tag.js +4 -3
- package/dist/textarea.js +7 -5
- package/dist/theme.css +151 -6
- package/dist/theme.js +11 -9
- package/dist/toast.d.ts +11 -2
- package/dist/toast.js +12 -9
- package/dist/tooltip-surface-C2I9o2QM.d.ts +35 -0
- package/dist/tooltip.d.ts +15 -1
- package/dist/tooltip.js +3 -2
- package/dist/tree.d.ts +5 -0
- package/dist/tree.js +8 -6
- package/dist/types-DR9rAEy1.d.ts +188 -0
- package/dist/use-uploads-KaPqDklo.d.ts +482 -0
- package/dist/verification-code-input.d.ts +84 -0
- package/dist/verification-code-input.js +14 -0
- package/package.json +70 -9
- package/dist/card-nWicloNi.d.ts +0 -80
- package/dist/chunk-24TO7E32.js +0 -42
- package/dist/chunk-FXIBGTS5.js +0 -14
- package/dist/chunk-MFJP5FA7.js +0 -20
- package/dist/chunk-ZZT2E5VT.js +0 -24
- package/dist/shared-BNXAdgh2.d.ts +0 -9
package/dist/progress.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { S as SemanticColor } from './color-CtSxc1Rh.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Where the value reads, relative to the bar.
|
|
@@ -35,12 +36,16 @@ interface ProgressProps {
|
|
|
35
36
|
* On, and only once `value` exceeds `max`, the track's scale stretches so its right edge is the
|
|
36
37
|
* value: the fill therefore paints full width and a hairline **notch** marks where `max` fell
|
|
37
38
|
* (`max` at 100 with `value` at 120 puts it 83% along). The fill stays brand on both sides of the
|
|
38
|
-
* notch — its position is the signal,
|
|
39
|
+
* notch — its position is the signal, and `color` is the caller's separate say.
|
|
39
40
|
*
|
|
40
41
|
* It also moves what the readout MEANS: `formatValue` (and the default `${percent}%`) receive
|
|
41
42
|
* percent-of-`max`, which may now exceed 100, because "120%" is the whole point of the call. The
|
|
42
43
|
* floating bubble keeps tracking the fill's edge, not that number.
|
|
43
44
|
*
|
|
45
|
+
* The fill does NOT change colour past the notch — its position is the signal. `color` is a
|
|
46
|
+
* separate, caller-declared axis (an over-quota bar may well be `error`, but that is the caller
|
|
47
|
+
* saying so, not the overage deriving it).
|
|
48
|
+
*
|
|
44
49
|
* A boolean rather than a union: it is an independent switch (setting it alongside any other prop
|
|
45
50
|
* is meaningful) and it carries no settings of its own — the extended scale is derived from
|
|
46
51
|
* `value`, so there is no ceiling to declare.
|
|
@@ -72,6 +77,21 @@ interface ProgressProps {
|
|
|
72
77
|
formatValue?: (value: number, percent: number) => string;
|
|
73
78
|
/** @default "md" */
|
|
74
79
|
size?: ProgressSize;
|
|
80
|
+
/**
|
|
81
|
+
* The fill's tone, on the library's shared 6-tone axis — the same `color` prop `Button`, `Badge`
|
|
82
|
+
* and `Indicator` take, so a bar reads the way everything else with a colour does.
|
|
83
|
+
*
|
|
84
|
+
* It is the CALLER's statement, never derived. A bar cannot know whether 90% is nearly done or
|
|
85
|
+
* nearly out: 90% of a file uploaded is `brand`, 90% of a storage quota is `warning`, and only the
|
|
86
|
+
* caller knows which one this is. `overage` does not change it either (see that prop).
|
|
87
|
+
*
|
|
88
|
+
* The value is drawn from `lib/color.ts`'s `FILL`, the table for a solid fill with nothing printed
|
|
89
|
+
* on it — so a bar and a Toast countdown of the same tone are the same colour, and neither owes a
|
|
90
|
+
* text-contrast pair.
|
|
91
|
+
*
|
|
92
|
+
* @default "brand"
|
|
93
|
+
*/
|
|
94
|
+
color?: SemanticColor;
|
|
75
95
|
/**
|
|
76
96
|
* The bar's accessible name. A `role="progressbar"` with no name announces as a bare number, so
|
|
77
97
|
* one of this or `aria-labelledby` is required (dev-warned, per `warnNeedsName`).
|
package/dist/progress.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
"use client";export { Progress } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
"use client";export { Progress } from './chunk-33TOK7ES.js';
|
|
2
|
+
import './chunk-MCQG4H6T.js';
|
|
3
3
|
import './chunk-ZSNJ6UA3.js';
|
|
4
|
+
import './chunk-QDYE5LVT.js';
|
|
4
5
|
//# sourceMappingURL=progress.js.map
|
|
5
6
|
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { i as LibraryLabels } from './labels-DPrh0se9.js';
|
|
3
|
+
import { W as WeekStart } from './date-vMJBKAFK.js';
|
|
4
|
+
import { Locale } from 'date-fns';
|
|
5
|
+
import { E as Era } from './date-utils-7hTFTXNK.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The ONE place the library decides what element an `href` becomes.
|
|
9
|
+
*
|
|
10
|
+
* **Why this is a shared layer and not a prop on one component.** Seven components own an
|
|
11
|
+
* `<a href>` across twelve sites — SidebarNavigation (row, collapsed RAIL ROW, brand lockup),
|
|
12
|
+
* HeaderNavigation (row, brand lockup), DropdownMenu, Toast (primary AND secondary), Callout,
|
|
13
|
+
* Table's row actions and Breadcrumb. The canonical register — including the definition of a "site"
|
|
14
|
+
* and the one known UNROUTED site — is `docs/link-policy.md`; do not restate the count here, because
|
|
15
|
+
* three copies of it drifted into three different numbers. (The sidebar's second site is the
|
|
16
|
+
* collapsed rail ROW; the collapsed FLYOUT is DropdownMenu's.) In a
|
|
17
|
+
* client-routed app (Next App Router, React Router) a plain anchor is a FULL DOCUMENT navigation:
|
|
18
|
+
* the bundle re-downloads, React re-mounts, and every piece of shell state resets — measured on a
|
|
19
|
+
* 34-row rail, the nav's own scroll position snaps back to 0 on every click.
|
|
20
|
+
*
|
|
21
|
+
* `BreadcrumbItem.render` already shipped the escape hatch, documented as "the router escape hatch
|
|
22
|
+
* … per the house `useRender` doctrine (AGENTS §4)". It was right, and it was applied in one place
|
|
23
|
+
* out of seven. This finishes the rollout without pasting the idiom eight more times.
|
|
24
|
+
*
|
|
25
|
+
* **Two layers, and they compose.** A per-item `render` is the precise, local answer; the
|
|
26
|
+
* provider's `link` is the app-wide default so a 34-row menu is not 34 `<Link>` elements typed
|
|
27
|
+
* into an `items` array. Per item wins — it is the more specific statement.
|
|
28
|
+
*
|
|
29
|
+
* **What it deliberately does NOT do.** It never wraps, never adds a DOM level, and never guesses
|
|
30
|
+
* a router: the caller hands us an element and we clone the caller's own component. Modifier-key
|
|
31
|
+
* behaviour (⌘-click, middle-click) belongs to that element too — `next/link` already handles it,
|
|
32
|
+
* and a library-side `metaKey || ctrlKey || shiftKey || button !== 0` guard would be a second,
|
|
33
|
+
* conflicting implementation. The guard stays only on the `onNavigate` fallback path, where the
|
|
34
|
+
* library really is the one intercepting the click.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** What a {@link LinkComponent} is handed: the destination, plus everything the host component
|
|
38
|
+
* merges on (className, `aria-current`, `onClick`, children, `target`/`rel`). */
|
|
39
|
+
interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
40
|
+
href: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The COMPONENT every `href` in the library renders as — your router's link.
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <JenosizeUIProvider link={Link} /> // next/link, as-is
|
|
47
|
+
* const AppLink = ({ href, ...rest }: LinkProps) => <Link to={href} {...rest} />; // HOIST it — an
|
|
48
|
+
* <JenosizeUIProvider link={AppLink} /> // inline arrow is a new type per render and remounts every link
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* **A component, not a render function, and that distinction is load-bearing.** It used to be
|
|
52
|
+
* `(props) => ReactElement`, invoked as a plain call — which meant `link={Link}` threw
|
|
53
|
+
* `TypeError: renderLink is not a function`, because `next/link` and React Router's `Link` are
|
|
54
|
+
* BOTH `forwardRef` results: objects with a `$$typeof`, not callables. The one shape the whole
|
|
55
|
+
* feature exists to accept was the one shape it rejected, and the documented arrow wrapper only
|
|
56
|
+
* hid it. Rendering through `createElement` accepts every component form — `forwardRef`, `memo`,
|
|
57
|
+
* a plain function — and gives a hand-written wrapper real hooks and a real place in the tree
|
|
58
|
+
* instead of borrowing its caller's.
|
|
59
|
+
*
|
|
60
|
+
* **The contract is: forward the props you are given.** The host merges `className`,
|
|
61
|
+
* `aria-current`, handlers and children onto this element, so a wrapper must spread its rest
|
|
62
|
+
* (`{...rest}`) or they are dropped — losing `aria-current` costs nothing visible and everything
|
|
63
|
+
* to a screen reader. `next/link` and React Router's `Link` both forward by construction, which is
|
|
64
|
+
* why the bare `link={Link}` form cannot get this wrong.
|
|
65
|
+
*/
|
|
66
|
+
type LinkComponent = React.ComponentType<LinkProps>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The app-wide date defaults — locale, timezone, era, week start.
|
|
70
|
+
*
|
|
71
|
+
* **Why this is a shared layer and not six props repeated.** Six components default these
|
|
72
|
+
* per instance today (`useCalendar`, `DatePicker`, `DateRangePicker`, `DateCalendar`,
|
|
73
|
+
* `DateRangeCalendar`, `DateInput`), each spelling `locale = enUS` and `era = "ce"` in its own
|
|
74
|
+
* destructure. An app that is Thai is Thai in all six, so every one of those call sites repeats the
|
|
75
|
+
* same answer — the shape `JenosizeUIProvider` exists to end, and `era` is the one most likely to be
|
|
76
|
+
* forgotten on the seventh call site, where it silently renders a Gregorian year to a Thai user.
|
|
77
|
+
*
|
|
78
|
+
* **Resolution is `prop ?? provider ?? the shipped default`,** which is why the components' default
|
|
79
|
+
* PARAMETERS had to go: `locale = enUS` fires on `undefined` and would shadow the provider entirely.
|
|
80
|
+
*
|
|
81
|
+
* **One thing this deliberately does not do: infer the week start from the locale.** `weekStartsOn`
|
|
82
|
+
* stays `"monday"` in every locale — `src/lib/date.ts` records why at length (most locales are
|
|
83
|
+
* Sunday-start and that is not what a work calendar wants). The provider makes it SETTABLE app-wide;
|
|
84
|
+
* `"locale"` remains the opt-in member that defers to the date-fns locale's own answer.
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
/** What an app can declare once for every date-bearing component beneath it. */
|
|
88
|
+
interface LocaleConfig {
|
|
89
|
+
/** date-fns locale — weekday names, month captions, every printed format. */
|
|
90
|
+
locale?: Locale;
|
|
91
|
+
/** IANA zone every instant is rendered in. Invalid or absent falls back to the runtime's. */
|
|
92
|
+
timeZone?: string;
|
|
93
|
+
/** Which era the YEAR prints in — `"be"` is the Thai Buddhist era (CE + 543). */
|
|
94
|
+
era?: Era;
|
|
95
|
+
/** Which day a week grid starts on. Still Monday by default, in every locale. */
|
|
96
|
+
weekStartsOn?: WeekStart;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* App-level configuration for the whole library.
|
|
101
|
+
*
|
|
102
|
+
* **Why a fourth provider.** `ThemeProvider` owns a preference, `SidebarProvider` owns one
|
|
103
|
+
* component's state, `Tooltip.Provider` owns a delay group — each is scoped to a thing. This one
|
|
104
|
+
* is scoped to the APP: settings that are true of the host application rather than of any
|
|
105
|
+
* component, and that a component therefore cannot ask for through its own props without every
|
|
106
|
+
* call site repeating the same answer. A 34-row rail should not carry 34 `<Link>` elements, and a
|
|
107
|
+
* table added next month should inherit whatever the app already declared rather than silently
|
|
108
|
+
* reverting to the library's default.
|
|
109
|
+
*
|
|
110
|
+
* **It is optional, always.** Every setting here has a default that is exactly what the library
|
|
111
|
+
* rendered before it existed, so mounting nothing changes nothing. That is the test a new field
|
|
112
|
+
* has to pass to belong here.
|
|
113
|
+
*
|
|
114
|
+
* Not a compound: there are no parts, and `useJenosizeUI` is internal. The public surface is the
|
|
115
|
+
* one component and its props.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
interface JenosizeUIProviderProps {
|
|
119
|
+
/**
|
|
120
|
+
* What an `href` renders as, app-wide — the router escape hatch.
|
|
121
|
+
*
|
|
122
|
+
* Seven components own an `<a href>` (SidebarNavigation, HeaderNavigation, DropdownMenu, Toast,
|
|
123
|
+
* Callout, Table's row actions, Breadcrumb). In a client-routed app a plain anchor is a full
|
|
124
|
+
* document navigation, so hand the library your router's link instead — **the component itself,
|
|
125
|
+
* not a wrapper**:
|
|
126
|
+
*
|
|
127
|
+
* ```tsx
|
|
128
|
+
* import Link from "next/link";
|
|
129
|
+
* <JenosizeUIProvider link={Link}>
|
|
130
|
+
*
|
|
131
|
+
* // React Router names the destination `to`, so that one needs a wrapper — which must
|
|
132
|
+
* // FORWARD its rest props, or the className and `aria-current` the library merges are lost, and
|
|
133
|
+
* // must be HOISTED (or `useCallback`'d): an inline arrow is a new component type per render, which
|
|
134
|
+
* // remounts every link in the app and drops keyboard focus. A dev warning fires if it changes.
|
|
135
|
+
* const AppLink = ({ href, ...rest }: LinkProps) => <Link to={href} {...rest} />;
|
|
136
|
+
* <JenosizeUIProvider link={AppLink}>
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* A per-item `render` (`BreadcrumbItem.render`, `NavLink.render`, …) still wins over this — it
|
|
140
|
+
* is the more specific statement. And a destination the router cannot own (`target="_blank"`, a
|
|
141
|
+
* scheme, a bare `#fragment`) stays a plain `<a>` whatever is configured here.
|
|
142
|
+
*
|
|
143
|
+
* @default a plain `<a href>`
|
|
144
|
+
*/
|
|
145
|
+
link?: LinkComponent;
|
|
146
|
+
/**
|
|
147
|
+
* What the library's own copy says, app-wide — the i18n seam.
|
|
148
|
+
*
|
|
149
|
+
* Twenty-two components author text the caller never passes in: `aria-label="Select row"`, a
|
|
150
|
+
* `sr-only` "Actions", the live region's "Move cancelled. Card returned to Backlog." Without
|
|
151
|
+
* this, an app can restyle every pixel of the library and still ship an English screen reader.
|
|
152
|
+
*
|
|
153
|
+
* Keyed by component, every key optional — a scope you never mention, and a key you leave out of
|
|
154
|
+
* a scope you do, both stay English:
|
|
155
|
+
*
|
|
156
|
+
* ```tsx
|
|
157
|
+
* <JenosizeUIProvider
|
|
158
|
+
* labels={{
|
|
159
|
+
* table: { selectRow: "เลือกแถว", selectionCount: (c) => t("table.selected", { count: c.count }) },
|
|
160
|
+
* pagination: { rowsPerPage: "แถวต่อหน้า" },
|
|
161
|
+
* }}
|
|
162
|
+
* />
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* A key that interpolates takes a function; one that does not takes a string — and a function key
|
|
166
|
+
* also accepts a plain string when a language does not need the hole. A per-instance `labels`
|
|
167
|
+
* prop still wins over this, and a content prop (`placeholder`, `emptyMessage`, `aria-label`)
|
|
168
|
+
* wins over both. Nested providers merge per scope. Full doc: `docs/i18n-policy.md`.
|
|
169
|
+
*
|
|
170
|
+
* @default the built-in English table
|
|
171
|
+
*/
|
|
172
|
+
labels?: LibraryLabels;
|
|
173
|
+
/**
|
|
174
|
+
* The app-wide date defaults — `locale`, `timeZone`, `era`, `weekStartsOn`.
|
|
175
|
+
*
|
|
176
|
+
* Six components default these per instance (`useCalendar`, `DatePicker`, `DateRangePicker`, the
|
|
177
|
+
* two standalone calendars, `DateInput`), so an app that is Thai repeats the same answer at every
|
|
178
|
+
* call site — and `era="be"` forgotten on the seventh renders a Gregorian year to a Thai user.
|
|
179
|
+
*
|
|
180
|
+
* **`timeZone` is the exception: only `useCalendar` reads it**, and that is correct rather than a
|
|
181
|
+
* gap. The other five hold CALENDAR DATES — a plain y-m-d, which has no instant and therefore no
|
|
182
|
+
* zone to convert into. Only a calendar holds an `Event.start`, which IS an instant. Saying "six"
|
|
183
|
+
* of this field was simply wrong; the split is asserted in `src/lib/locale.integration.test.tsx`.
|
|
184
|
+
*
|
|
185
|
+
* ```tsx
|
|
186
|
+
* <JenosizeUIProvider locale={th} timeZone="Asia/Bangkok" era="be">
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* A per-instance prop still wins. `weekStartsOn` stays Monday by default in EVERY locale — this
|
|
190
|
+
* makes it settable app-wide, not locale-derived (see `src/lib/date.ts`).
|
|
191
|
+
*
|
|
192
|
+
* @default the runtime timezone, `enUS`, `"ce"`, Monday
|
|
193
|
+
*/
|
|
194
|
+
locale?: LocaleConfig["locale"];
|
|
195
|
+
/** @see locale */
|
|
196
|
+
timeZone?: LocaleConfig["timeZone"];
|
|
197
|
+
/** @see locale */
|
|
198
|
+
era?: LocaleConfig["era"];
|
|
199
|
+
/** @see locale */
|
|
200
|
+
weekStartsOn?: LocaleConfig["weekStartsOn"];
|
|
201
|
+
children?: React.ReactNode;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Publishes app-level settings to every jenosize-ui component beneath it. Mount it once, at the
|
|
205
|
+
* app root, outside `ThemeProvider` or inside — the two are independent.
|
|
206
|
+
*/
|
|
207
|
+
declare function JenosizeUIProvider(props: JenosizeUIProviderProps): React.JSX.Element;
|
|
208
|
+
declare namespace JenosizeUIProvider {
|
|
209
|
+
var displayName: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export { JenosizeUIProvider, type JenosizeUIProviderProps, type LinkComponent, type LinkProps };
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";export { JenosizeUIProvider } from './chunk-AIARANKE.js';
|
|
2
|
+
import './chunk-5AZKP4KZ.js';
|
|
3
|
+
import './chunk-YIHKQ63K.js';
|
|
4
|
+
import './chunk-RJTVCA62.js';
|
|
5
|
+
import './chunk-QDYE5LVT.js';
|
|
6
|
+
//# sourceMappingURL=provider.js.map
|
|
7
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { C as ChartLabels } from './labels-DPrh0se9.js';
|
|
3
|
+
import { f as ChartSeries, e as ChartPalette, d as ChartLegendPlacement } from './types-DR9rAEy1.js';
|
|
4
|
+
import { T as TooltipTone } from './tooltip-surface-C2I9o2QM.js';
|
|
5
|
+
|
|
6
|
+
interface RadarChartProps<T extends object> {
|
|
7
|
+
/** One row per spoke, with a column per series. */
|
|
8
|
+
data: readonly T[];
|
|
9
|
+
/**
|
|
10
|
+
* The category-axis column — one spoke per row.
|
|
11
|
+
*
|
|
12
|
+
* Named `angle` rather than `x` because there is no x here and calling it one would be a lie.
|
|
13
|
+
*/
|
|
14
|
+
angle: keyof T & string;
|
|
15
|
+
/** ORDER drives colour order. */
|
|
16
|
+
series: readonly ChartSeries<NoInfer<T>>[];
|
|
17
|
+
/** @default "brand" */
|
|
18
|
+
palette?: ChartPalette;
|
|
19
|
+
/** Radius domain. A fixed value is what makes two radars comparable side by side. @default "auto" */
|
|
20
|
+
max?: number | "auto";
|
|
21
|
+
/**
|
|
22
|
+
* How many concentric grid rings to draw — **and therefore which values the pills read**, since a
|
|
23
|
+
* ring IS a labelled tick. Raising it tightens the grid; lowering it opens it up.
|
|
24
|
+
*
|
|
25
|
+
* **It is a TARGET, not a guarantee**, which is why it is a `number` and not a union of the counts
|
|
26
|
+
* we like. The engine rounds the domain into whole steps and returns however many that took, so a
|
|
27
|
+
* small domain quietly yields fewer: `gridRings={5}` on `[0, 5]` renders 4, and anything below 2
|
|
28
|
+
* floors to 2 (an outer ring and the centre). A union would name outcomes it cannot deliver.
|
|
29
|
+
*
|
|
30
|
+
* **Round labels are arithmetic, not a setting.** `n` rings is `n − 1` gaps, so on a `[0, 100]`
|
|
31
|
+
* domain 3 gives `0/50/100` and 5 gives `0/25/50/75/100`, while the default 4 gives
|
|
32
|
+
* `0/35/70/100`. Pick by whether the labels or the spacing matters more for your data.
|
|
33
|
+
*
|
|
34
|
+
* @default 4
|
|
35
|
+
*/
|
|
36
|
+
gridRings?: number;
|
|
37
|
+
/** @default 320 */
|
|
38
|
+
height?: number;
|
|
39
|
+
/** @default "bottom" */
|
|
40
|
+
legend?: ChartLegendPlacement;
|
|
41
|
+
/** @default (v) => v.toLocaleString() */
|
|
42
|
+
formatValue?: (value: number) => string;
|
|
43
|
+
/** @default true */
|
|
44
|
+
tooltip?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The hover tooltip's surface — the same union `<Tooltip>` takes, so a chart tooltip and a real
|
|
47
|
+
* tooltip on the same page are one object. **Both members are correct in both themes**; this is
|
|
48
|
+
* not a theme switch, the light/dark split already lives in the tokens.
|
|
49
|
+
*
|
|
50
|
+
* - `surface` — a raised panel (default), like every other floating readout in the library.
|
|
51
|
+
* - `inverse` — the always-dark chip. For a chart on a dark stage or over imagery.
|
|
52
|
+
*
|
|
53
|
+
* @default "surface"
|
|
54
|
+
*/
|
|
55
|
+
tooltipTone?: TooltipTone;
|
|
56
|
+
/** @default "No data to display" */
|
|
57
|
+
emptyMessage?: string;
|
|
58
|
+
/** Override the chart family's own copy — what `emptyMessage` defaults to. One scope for all six
|
|
59
|
+
* charts. Merges under `<JenosizeUIProvider labels={{ chart }}>`; see `docs/i18n-policy.md`. */
|
|
60
|
+
labels?: ChartLabels;
|
|
61
|
+
/** Names the figure and captions the screen-reader data table. */
|
|
62
|
+
"aria-label"?: string;
|
|
63
|
+
/** **Layout/spacing only**, merged via `cn()`. Never restyles a spoke or the grid. */
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A multi-series comparison over a shared set of spokes.
|
|
68
|
+
*
|
|
69
|
+
* Wide rows plus a `series[]`, exactly like the cartesian trio — a radar IS a multi-series chart
|
|
70
|
+
* over a category axis; only the projection differs.
|
|
71
|
+
*
|
|
72
|
+
* Built on a hidden recharts engine — none of its vocabulary is public, there are no compound parts
|
|
73
|
+
* and there is no prop passthrough.
|
|
74
|
+
*/
|
|
75
|
+
declare function RadarChart<T extends object>({ data, angle, series, palette, max, gridRings, height, legend, formatValue, tooltip, tooltipTone, emptyMessage, labels, className, "aria-label": ariaLabel, }: RadarChartProps<T>): React.JSX.Element;
|
|
76
|
+
|
|
77
|
+
export { RadarChart, type RadarChartProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";export { RadarChart } from './chunk-GLKFFA7N.js';
|
|
2
|
+
import './chunk-OLLD2BZN.js';
|
|
3
|
+
import './chunk-22M75A3N.js';
|
|
4
|
+
import './chunk-AFYXSZGW.js';
|
|
5
|
+
import './chunk-ZSNJ6UA3.js';
|
|
6
|
+
import './chunk-RJTVCA62.js';
|
|
7
|
+
import './chunk-QDYE5LVT.js';
|
|
8
|
+
//# sourceMappingURL=radar-chart.js.map
|
|
9
|
+
//# sourceMappingURL=radar-chart.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { C as ChartLabels } from './labels-DPrh0se9.js';
|
|
3
|
+
import { c as ChartDatum, g as ChartSize, e as ChartPalette, d as ChartLegendPlacement } from './types-DR9rAEy1.js';
|
|
4
|
+
import { T as TooltipTone } from './tooltip-surface-C2I9o2QM.js';
|
|
5
|
+
|
|
6
|
+
interface RadialChartProps {
|
|
7
|
+
/**
|
|
8
|
+
* One entry reads as a progress ring; N entries as a multi-ring activity gauge — the same tree
|
|
9
|
+
* with a different data length, which is why they are one component rather than two.
|
|
10
|
+
*
|
|
11
|
+
* **`data[0]` is the INNERMOST ring**, and each entry after it steps outward. The legend follows
|
|
12
|
+
* the same order, so a row read top-down matches a ring read inside-out.
|
|
13
|
+
*/
|
|
14
|
+
data: readonly ChartDatum[];
|
|
15
|
+
/**
|
|
16
|
+
* The radius ladder. Also sets the height and the centre readout's type step — a gauge's box is
|
|
17
|
+
* its diameter, so there is no `height` prop.
|
|
18
|
+
*
|
|
19
|
+
* @default "md"
|
|
20
|
+
*/
|
|
21
|
+
size?: ChartSize;
|
|
22
|
+
/** @default "brand" */
|
|
23
|
+
palette?: ChartPalette;
|
|
24
|
+
/**
|
|
25
|
+
* The big centre figure, e.g. `"40%"`.
|
|
26
|
+
*
|
|
27
|
+
* This and `description` are the ONE exception to the family's plot-only chrome, and the reason is
|
|
28
|
+
* structural rather than stylistic: they are SVG `<text>` painted inside the ring, not a card
|
|
29
|
+
* header. A gauge without its centre readout is not a gauge.
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
/** The small centre caption above it, e.g. `"Active users"`. */
|
|
33
|
+
description?: string;
|
|
34
|
+
/** Arc domain. A fixed value is what makes two gauges comparable side by side. @default "auto" */
|
|
35
|
+
max?: number | "auto";
|
|
36
|
+
/** The neutral background ring behind each bar. @default true */
|
|
37
|
+
track?: boolean;
|
|
38
|
+
/** @default "bottom" */
|
|
39
|
+
legend?: ChartLegendPlacement;
|
|
40
|
+
/** @default (v) => v.toLocaleString() */
|
|
41
|
+
formatValue?: (value: number) => string;
|
|
42
|
+
/** @default true */
|
|
43
|
+
tooltip?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The hover tooltip's surface — the same union `<Tooltip>` takes, so a chart tooltip and a real
|
|
46
|
+
* tooltip on the same page are one object. **Both members are correct in both themes**; this is
|
|
47
|
+
* not a theme switch, the light/dark split already lives in the tokens.
|
|
48
|
+
*
|
|
49
|
+
* - `surface` — a raised panel (default), like every other floating readout in the library.
|
|
50
|
+
* - `inverse` — the always-dark chip. For a chart on a dark stage or over imagery.
|
|
51
|
+
*
|
|
52
|
+
* @default "surface"
|
|
53
|
+
*/
|
|
54
|
+
tooltipTone?: TooltipTone;
|
|
55
|
+
/** @default "No data to display" */
|
|
56
|
+
emptyMessage?: string;
|
|
57
|
+
/** Override the chart family's own copy — what `emptyMessage` defaults to. One scope for all six
|
|
58
|
+
* charts. Merges under `<JenosizeUIProvider labels={{ chart }}>`; see `docs/i18n-policy.md`. */
|
|
59
|
+
labels?: ChartLabels;
|
|
60
|
+
/** Names the figure and captions the screen-reader data table. */
|
|
61
|
+
"aria-label"?: string;
|
|
62
|
+
/** **Layout/spacing only**, merged via `cn()`. Never restyles a ring or the centre readout. */
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A progress ring, or a concentric activity gauge.
|
|
67
|
+
*
|
|
68
|
+
* Built on a hidden recharts engine — none of its vocabulary is public, there are no compound parts
|
|
69
|
+
* and there is no prop passthrough.
|
|
70
|
+
*/
|
|
71
|
+
declare function RadialChart({ data, size, palette, label, description, max, track, legend, formatValue, tooltip, tooltipTone, emptyMessage, labels, className, "aria-label": ariaLabel, }: RadialChartProps): React.JSX.Element;
|
|
72
|
+
|
|
73
|
+
export { RadialChart, type RadialChartProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";export { RadialChart } from './chunk-ULGCGKOE.js';
|
|
2
|
+
import './chunk-OLLD2BZN.js';
|
|
3
|
+
import './chunk-22M75A3N.js';
|
|
4
|
+
import './chunk-AFYXSZGW.js';
|
|
5
|
+
import './chunk-ZSNJ6UA3.js';
|
|
6
|
+
import './chunk-RJTVCA62.js';
|
|
7
|
+
import './chunk-QDYE5LVT.js';
|
|
8
|
+
//# sourceMappingURL=radial-chart.js.map
|
|
9
|
+
//# sourceMappingURL=radial-chart.js.map
|
package/dist/radio.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
"use client";export { RadioGroup } from './chunk-
|
|
2
|
-
import './chunk-GTHJWR3Q.js';
|
|
3
|
-
import './chunk-MFJP5FA7.js';
|
|
1
|
+
"use client";export { RadioGroup } from './chunk-ZZSNTCCL.js';
|
|
4
2
|
import './chunk-7JBNLEJ7.js';
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
3
|
+
import './chunk-D7EE5GWU.js';
|
|
4
|
+
import './chunk-45Y2ZGNK.js';
|
|
5
|
+
import './chunk-5KSD4WKN.js';
|
|
6
|
+
import './chunk-KZP6B6B3.js';
|
|
7
|
+
import './chunk-AFYXSZGW.js';
|
|
8
8
|
import './chunk-O4GRKO3I.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-BLIZ3CL3.js';
|
|
10
10
|
import './chunk-ZSNJ6UA3.js';
|
|
11
|
+
import './chunk-RJTVCA62.js';
|
|
12
|
+
import './chunk-QDYE5LVT.js';
|
|
11
13
|
//# sourceMappingURL=radio.js.map
|
|
12
14
|
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The **rule** — the paint every divider, separator and connector in the library is drawn with.
|
|
3
|
+
*
|
|
4
|
+
* Full policy, including the register of what is deliberately NOT in this system and why:
|
|
5
|
+
* **`docs/rule-policy.md`**.
|
|
6
|
+
*
|
|
7
|
+
* ## Why the paint is custom properties and not classes
|
|
8
|
+
*
|
|
9
|
+
* Three consumer shapes need the same paint and cannot share one class string:
|
|
10
|
+
*
|
|
11
|
+
* (a) a real element — `<Separator>`, a nav's `<hr>`
|
|
12
|
+
* (b) a pseudo-element — a panel header's `::after`, a table row's `[&>td]:after:*`
|
|
13
|
+
* (c) an absolutely-positioned connector that brings its own geometry — ProgressSteps, a nav guide
|
|
14
|
+
*
|
|
15
|
+
* A variant prefix cannot be interpolated, and Tailwind's JIT scans source TEXT, so no class may be
|
|
16
|
+
* built from fragments (`panel.tsx:72` records what an interpolated fragment costs — `md:${GAP[x]}`
|
|
17
|
+
* compiles to nothing). But **custom properties inherit into pseudo-elements**, so making texture and
|
|
18
|
+
* tone property SETTERS makes them prefix-free by construction, and only the tiny reader class ever
|
|
19
|
+
* needs a prefix. That is the whole trick, and it is already the house idiom — `date-picker/shared.ts`
|
|
20
|
+
* publishes `[--dot:…]` and reads it back through `[&>button]:after:bg-(color:--dot)` for exactly
|
|
21
|
+
* this reason.
|
|
22
|
+
*
|
|
23
|
+
* It is also why the colour is NOT `currentColor`. On a pseudo, `bg-current` resolves against the
|
|
24
|
+
* host's `color` — near-black — so it would need a paired `after:text-border-secondary`, filing a
|
|
25
|
+
* BORDER role into the `text-*` family (the mis-file AGENTS §7 exists to prevent). The repo has
|
|
26
|
+
* already ruled against `bg-current` twice on the same grounds: `date-picker/shared.ts` ("it followed
|
|
27
|
+
* the numeral") and `Tree.tsx`'s guide dot, whose mark belongs to the LEVEL, not the row.
|
|
28
|
+
*
|
|
29
|
+
* ## The invariant: all three properties, or none
|
|
30
|
+
*
|
|
31
|
+
* A rule site sets `--rule-image` AND `--rule-size` AND `--rule` together. All three INHERIT, so a
|
|
32
|
+
* `dot` header inside a `line` panel would otherwise leak `5px 2px` down into every descendant rule.
|
|
33
|
+
* That is why {@link RULE_TEXTURE}'s `line` spells `[--rule-size:auto]` explicitly rather than
|
|
34
|
+
* leaning on the reader's fallback, and why {@link rulePaint} always emits a tone.
|
|
35
|
+
*
|
|
36
|
+
* ## What this does NOT own: placement
|
|
37
|
+
*
|
|
38
|
+
* Same boundary `src/lib/drop-line.ts` draws and justifies. A connector's offsets, a pseudo's
|
|
39
|
+
* `absolute inset-x-0`, a separator's margins — all stay the host's. This module is paint.
|
|
40
|
+
*
|
|
41
|
+
* ## Not to be confused with `drop-line.ts`
|
|
42
|
+
*
|
|
43
|
+
* A drop line is a **cursor**, not a divider: transient, brand-coloured, solid by construction, and
|
|
44
|
+
* its entire job is to advertise where a dragged thing will land. It shares "thin bar" with this
|
|
45
|
+
* module and nothing else, so it stays its own file rather than importing a texture machine it can
|
|
46
|
+
* never use.
|
|
47
|
+
*/
|
|
48
|
+
/** The three textures. One vocabulary library-wide — a nav separator, a panel divider and a step
|
|
49
|
+
* connector all spell them the same way, so callers never guess. */
|
|
50
|
+
type RuleTexture = "line" | "dot" | "dashed";
|
|
51
|
+
/** `y` — a HORIZONTAL rule, separating stacked rows. `x` — a VERTICAL one, separating side-by-side
|
|
52
|
+
* columns. Named after the axis a rule SEPARATES, never the dimension it sets: `h-px` reads as a
|
|
53
|
+
* height and tells the reader nothing about which way the list runs. Same convention as
|
|
54
|
+
* `drop-line.ts`'s `DROP_LINE_Y` / `DROP_LINE_X`. */
|
|
55
|
+
type RuleAxis = "y" | "x";
|
|
56
|
+
/**
|
|
57
|
+
* The two STRUCTURAL tones: `default` is the library hairline (`border-secondary`) and `strong` is
|
|
58
|
+
* the emphatic edge (`border-strong` — neutral-400 / dark neutral-600).
|
|
59
|
+
*
|
|
60
|
+
* `strong` is not decoration — it is what a rule inside a dense inline run needs to stay visible
|
|
61
|
+
* against the text beside it (`FileList`'s meta tick).
|
|
62
|
+
*
|
|
63
|
+
* **It is deliberately NOT `border-primary`.** It was, and that made the tone axis a no-op: one ramp
|
|
64
|
+
* stop off the default measures ΔL 5.2 in light, and at 1px the eye cannot resolve it — the prop
|
|
65
|
+
* moved and the page did not change. A tone axis whose members are indistinguishable is a type that
|
|
66
|
+
* promises two weights and ships one, so `theme.css` mints a real fourth edge rather than this table
|
|
67
|
+
* borrowing the nearest one. (`border-primary` keeps its own job: the STRONG box edge. A rule and a
|
|
68
|
+
* box perimeter are different affordances — `docs/rule-policy.md` says why a gradient can never be a
|
|
69
|
+
* perimeter at all.)
|
|
70
|
+
*
|
|
71
|
+
* A rule that carries STATUS rather than structure — a ProgressSteps done-connector, a drop line —
|
|
72
|
+
* publishes `--rule` from its own table instead. That is a status, not a tone, and mixing the two
|
|
73
|
+
* would put a brand colour in a list of neutrals.
|
|
74
|
+
*/
|
|
75
|
+
type RuleTone = "default" | "strong";
|
|
76
|
+
/** The two weight steps. `thick` doubles the ink (1px → 2px) for a deliberate heavy break; the colour
|
|
77
|
+
* axis for emphasis is {@link RuleTone}, and the two are independent. */
|
|
78
|
+
type RuleWeight = "hairline" | "thick";
|
|
79
|
+
|
|
80
|
+
export type { RuleTexture as R, RuleAxis as a, RuleTone as b, RuleWeight as c };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/** Which scrollbars to render. */
|
|
4
|
+
type ScrollAreaAxis = "vertical" | "horizontal" | "both";
|
|
5
|
+
|
|
6
|
+
interface ScrollAreaProps {
|
|
7
|
+
/**
|
|
8
|
+
* Which scrollbars to render — ONE union rather than a `vertical`/`horizontal` boolean pair, per
|
|
9
|
+
* AGENTS §4: the members are mutually exclusive answers to one question, and `"both"` names the
|
|
10
|
+
* state a pair could only spell as "set them both". @default "vertical"
|
|
11
|
+
*/
|
|
12
|
+
axis?: ScrollAreaAxis;
|
|
13
|
+
/**
|
|
14
|
+
* Fade the content out at the cut edge — the library's persistent overflow cue, which the bar
|
|
15
|
+
* (revealed only on hover/scroll) deliberately does not duplicate.
|
|
16
|
+
*
|
|
17
|
+
* Defaults to `true` for a single axis and to `false` for `"both"`, where two gradients would
|
|
18
|
+
* need `mask-composite: intersect` and two bars are already unambiguous. Set explicitly on
|
|
19
|
+
* `"both"` and the mask follows the VERTICAL axis, the primary reading direction.
|
|
20
|
+
*
|
|
21
|
+
* Turn it off when the content must not dim — a chart, a map, edge-to-edge imagery — where a
|
|
22
|
+
* gradient over the last row reads as a rendering fault rather than as an affordance.
|
|
23
|
+
* @default true (`false` when `axis` is `"both"`)
|
|
24
|
+
*/
|
|
25
|
+
fade?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The scroll region wraps a COMPOSITE widget — a `role="menu"`, `listbox`, `tree` or `grid` you
|
|
28
|
+
* built yourself. Those roles constrain what their children may be, and a scroll viewport is a
|
|
29
|
+
* tab stop by default; both are wrong there, because the composite owns its own keyboard model
|
|
30
|
+
* and an interposed `div[tabindex]` fails `aria-required-children`. Set it and the wrapper
|
|
31
|
+
* becomes transparent to that traversal.
|
|
32
|
+
*
|
|
33
|
+
* Leave it `false` for a plain scrolling container — there the tab stop is what makes the region
|
|
34
|
+
* reachable by keyboard at all. @default false
|
|
35
|
+
*/
|
|
36
|
+
composite?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* **Layout/spacing only** (the `max-h-*`/`max-w-*` cap, width, margin, grid/flex), merged via
|
|
39
|
+
* `cn()`. Never restyles the bar or the thumb. The cap belongs HERE and not on a parent: the
|
|
40
|
+
* scrollbars position against this box, so it is what the bar is flush with.
|
|
41
|
+
*/
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Inline style, for a cap that can only be expressed as a computed length. */
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
/**
|
|
46
|
+
* A ref to the node that actually SCROLLS — the viewport, not this element. It is the only handle
|
|
47
|
+
* on `scrollTop`/`scrollHeight`, and the right `root` for an `IntersectionObserver` (infinite
|
|
48
|
+
* scroll, a scroll-to-top button, a sticky-header sentinel). Without it the scrolling node is
|
|
49
|
+
* unreachable, because the box this component's own `className` lands on does not scroll.
|
|
50
|
+
*/
|
|
51
|
+
viewportRef?: React.Ref<HTMLDivElement>;
|
|
52
|
+
/**
|
|
53
|
+
* The scrolling content. **Padding goes on a wrapper INSIDE here, never on this component** — a
|
|
54
|
+
* gutter on the scrolling box scrolls with the content (so the last row clears the edge), while a
|
|
55
|
+
* gutter on an ancestor would inset the bar off the panel edge, which is the defect this
|
|
56
|
+
* component exists to prevent.
|
|
57
|
+
*/
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
declare function ScrollArea({ axis, fade, composite, className, style, viewportRef, children }: ScrollAreaProps): React.JSX.Element;
|
|
61
|
+
|
|
62
|
+
export { ScrollArea, type ScrollAreaAxis, type ScrollAreaProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";export { ScrollArea } from './chunk-X2X7Q7NW.js';
|
|
2
|
+
import './chunk-FKVPAEJ6.js';
|
|
3
|
+
import './chunk-O2LG3PNI.js';
|
|
4
|
+
import './chunk-EDSK6FEH.js';
|
|
5
|
+
import './chunk-ZSNJ6UA3.js';
|
|
6
|
+
//# sourceMappingURL=scroll-area.js.map
|
|
7
|
+
//# sourceMappingURL=scroll-area.js.map
|
package/dist/select.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { S as Select, a as SelectAction, b as SelectDisplay, c as SelectIndicator, d as SelectIndicatorAlign, e as SelectOption, f as SelectProps, g as SelectRootProps, h as SelectSize } from './Select-
|
|
1
|
+
export { S as Select, a as SelectAction, b as SelectDisplay, c as SelectIndicator, d as SelectIndicatorAlign, e as SelectOption, f as SelectProps, g as SelectRootProps, h as SelectSize } from './Select-Dt5ARIH8.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { C as ControlSize } from './control-size-CaxQhkKh.js';
|
|
3
4
|
import '@base-ui/react/select';
|
|
4
5
|
import './multi-value-CJb_tnvi.js';
|
|
5
6
|
import './options-CPEIgjtd.js';
|
|
6
|
-
|
|
7
|
-
type ControlSize = "sm" | "md" | "lg";
|
|
7
|
+
import './labels-DPrh0se9.js';
|
|
8
8
|
|
|
9
9
|
type NativeSelectSize = ControlSize;
|
|
10
10
|
/** A native `<option>` row. The native element can only render plain text, so
|