@rinzai/zen 0.3.2 → 0.4.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.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -0
  3. package/dist/actions-menu/index.d.ts.map +1 -1
  4. package/dist/animated-number/index.d.ts +25 -0
  5. package/dist/animated-number/index.d.ts.map +1 -0
  6. package/dist/avatar/index.d.ts +24 -0
  7. package/dist/avatar/index.d.ts.map +1 -0
  8. package/dist/backdrop/index.d.ts.map +1 -1
  9. package/dist/badge/index.d.ts +1 -1
  10. package/dist/base.css +100 -0
  11. package/dist/button/index.d.ts +2 -2
  12. package/dist/button/index.d.ts.map +1 -1
  13. package/dist/collapse/index.d.ts.map +1 -1
  14. package/dist/dialog/index.d.ts.map +1 -1
  15. package/dist/dropdown/index.d.ts.map +1 -1
  16. package/dist/editable-cell/index.d.ts +24 -0
  17. package/dist/editable-cell/index.d.ts.map +1 -0
  18. package/dist/field/index.d.ts +25 -0
  19. package/dist/field/index.d.ts.map +1 -0
  20. package/dist/header/index.d.ts.map +1 -1
  21. package/dist/icons/chevron-left.d.ts +3 -0
  22. package/dist/icons/chevron-left.d.ts.map +1 -0
  23. package/dist/icons/chevron-right.d.ts +3 -0
  24. package/dist/icons/chevron-right.d.ts.map +1 -0
  25. package/dist/icons/index.d.ts +4 -0
  26. package/dist/icons/index.d.ts.map +1 -1
  27. package/dist/icons/status.d.ts +2 -0
  28. package/dist/icons/status.d.ts.map +1 -0
  29. package/dist/index.d.ts +21 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/input-group/index.d.ts +17 -0
  32. package/dist/input-group/index.d.ts.map +1 -0
  33. package/dist/lib.d.ts +2 -0
  34. package/dist/lib.d.ts.map +1 -0
  35. package/dist/meter/index.d.ts +25 -0
  36. package/dist/meter/index.d.ts.map +1 -0
  37. package/dist/money-input/index.d.ts +70 -0
  38. package/dist/money-input/index.d.ts.map +1 -0
  39. package/dist/month-picker/index.d.ts +28 -0
  40. package/dist/month-picker/index.d.ts.map +1 -0
  41. package/dist/popover/index.d.ts.map +1 -1
  42. package/dist/segmented/index.d.ts +2 -1
  43. package/dist/segmented/index.d.ts.map +1 -1
  44. package/dist/select/index.d.ts +32 -0
  45. package/dist/select/index.d.ts.map +1 -0
  46. package/dist/slider/index.d.ts +25 -0
  47. package/dist/slider/index.d.ts.map +1 -0
  48. package/dist/tab-bar/index.d.ts +23 -0
  49. package/dist/tab-bar/index.d.ts.map +1 -0
  50. package/dist/table/index.d.ts +76 -7
  51. package/dist/table/index.d.ts.map +1 -1
  52. package/dist/tailwind.css +7 -0
  53. package/dist/theme.css +888 -0
  54. package/dist/toast/index.d.ts +11 -3
  55. package/dist/toast/index.d.ts.map +1 -1
  56. package/dist/tree/index.d.ts +79 -0
  57. package/dist/tree/index.d.ts.map +1 -0
  58. package/dist/utils/cx.d.ts +5 -0
  59. package/dist/utils/cx.d.ts.map +1 -1
  60. package/dist/utils/field-chevron.d.ts +6 -0
  61. package/dist/utils/field-chevron.d.ts.map +1 -0
  62. package/dist/utils/graphics.d.ts +20 -0
  63. package/dist/utils/graphics.d.ts.map +1 -0
  64. package/dist/utils/merge.d.ts +12 -0
  65. package/dist/utils/merge.d.ts.map +1 -0
  66. package/dist/utils/money.d.ts +30 -0
  67. package/dist/utils/money.d.ts.map +1 -0
  68. package/dist/utils/month.d.ts +16 -0
  69. package/dist/utils/month.d.ts.map +1 -0
  70. package/dist/utils/status-icons.d.ts +11 -0
  71. package/dist/utils/status-icons.d.ts.map +1 -0
  72. package/dist/utils/styles.d.ts +6 -0
  73. package/dist/utils/styles.d.ts.map +1 -1
  74. package/dist/utils/theme.d.ts +92 -0
  75. package/dist/utils/theme.d.ts.map +1 -0
  76. package/dist/utils/useAnchoredPopup.d.ts +36 -0
  77. package/dist/utils/useAnchoredPopup.d.ts.map +1 -0
  78. package/dist/utils/useHydrated.d.ts +3 -0
  79. package/dist/utils/useHydrated.d.ts.map +1 -0
  80. package/dist/utils/useVirtualList.d.ts +4 -0
  81. package/dist/utils/useVirtualList.d.ts.map +1 -1
  82. package/dist/variables.css +90 -0
  83. package/dist/zen.css +1 -1
  84. package/dist/zen.js +2107 -532
  85. package/package.json +38 -1
@@ -0,0 +1,70 @@
1
+ import { Money } from '../utils/money';
2
+ import { ChangeEvent, KeyboardEvent, ReactNode } from 'react';
3
+ /**
4
+ * Amount input in one currency. Shows grouped digits for the locale (1,52,000
5
+ * for en-IN) and accepts shorthand: 1.5L, 2cr, 10k, 1.2m. Commits on blur or
6
+ * Enter; Escape reverts. Values are integer minor units (paise, cents), or null
7
+ * when empty. Replace the symbol with `start` (e.g. a currency switcher), or
8
+ * build your own field from useMoneyInput.
9
+ */
10
+ export default function MoneyInput({ start, end, compact, disabled, id, autoFocus, className, 'aria-label': ariaLabel, ...options }: MoneyInputProps): import('react').JSX.Element;
11
+ /**
12
+ * MoneyInput's behaviour without its markup: spread `inputProps` onto any
13
+ * input (e.g. an InputGroupInput next to your own addons) and show `error`.
14
+ */
15
+ export declare function useMoneyInput({ value, onChange, currency, locale, allowNegative, allowEmpty, live, onCancel, }: MoneyInputOptions): {
16
+ inputProps: {
17
+ readonly type: "text";
18
+ readonly inputMode: "decimal";
19
+ readonly autoComplete: "off";
20
+ readonly spellCheck: false;
21
+ readonly value: string;
22
+ readonly 'aria-invalid': true | undefined;
23
+ readonly 'aria-describedby': string | undefined;
24
+ readonly onChange: (e: ChangeEvent<HTMLInputElement>) => void;
25
+ readonly onFocus: () => void;
26
+ readonly onBlur: () => void;
27
+ readonly onKeyDown: (e: KeyboardEvent<HTMLInputElement>) => void;
28
+ };
29
+ /** The currency's symbol in this locale, e.g. "₹" or "$". */
30
+ symbol: string;
31
+ error: string | null;
32
+ errorId: string;
33
+ text: string;
34
+ setText: import('react').Dispatch<import('react').SetStateAction<string>>;
35
+ commit: () => boolean;
36
+ /** The value formatted with its symbol, e.g. "₹1,52,000.00". */
37
+ formatted: string;
38
+ };
39
+ export interface MoneyInputOptions {
40
+ /** Amount in minor units (paise, cents), or null when empty. */
41
+ value: Money | null;
42
+ onChange: (value: Money | null) => void;
43
+ /** ISO 4217 code, e.g. "INR", "USD". */
44
+ currency: string;
45
+ /** Decides digit grouping and the symbol, e.g. "en-IN" (1,52,000) or "en-US" (152,000). */
46
+ locale: string;
47
+ allowNegative?: boolean;
48
+ allowEmpty?: boolean;
49
+ /**
50
+ * For forms: report the amount on every keystroke instead of on blur, so a
51
+ * Save button can never miss it. Invalid text reports null.
52
+ */
53
+ live?: boolean;
54
+ /** Called on Escape, after reverting. */
55
+ onCancel?: () => void;
56
+ }
57
+ export interface MoneyInputProps extends MoneyInputOptions {
58
+ /** Replaces the currency symbol, e.g. with a currency switcher. */
59
+ start?: ReactNode;
60
+ /** Content after the input, e.g. a unit or a clear button. */
61
+ end?: ReactNode;
62
+ /** Smaller, for editing inside table rows. */
63
+ compact?: boolean;
64
+ disabled?: boolean;
65
+ id?: string;
66
+ autoFocus?: boolean;
67
+ className?: string;
68
+ 'aria-label'?: string;
69
+ }
70
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/money-input/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6C,KAAK,KAAK,EAAmB,MAAM,kBAAkB,CAAC;AAE1G,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAA8B,MAAM,OAAO,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAC/B,KAAK,EACL,GAAG,EACH,OAAe,EACf,QAAgB,EAChB,EAAE,EACF,SAAS,EACT,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,OAAO,EACb,EAAE,eAAe,+BAgCjB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,aAAqB,EACrB,UAAkB,EAClB,IAAY,EACZ,QAAQ,GACX,EAAE,iBAAiB;;;;;;;;;+BA8DE,WAAW,CAAC,gBAAgB,CAAC;;;gCAkB5B,aAAa,CAAC,gBAAgB,CAAC;;IAgB9C,6DAA6D;;;;;;kBAxD9C,OAAO;IA+DtB,gEAAgE;;EAGvE;AAED,MAAM,WAAW,iBAAiB;IAC9B,gEAAgE;IAChE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACtD,mEAAmE;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8DAA8D;IAC9D,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,28 @@
1
+ import { Month } from '../utils/month';
2
+ /**
3
+ * Month selector: a field showing "Sep 2026" that opens a year and a 12-month
4
+ * grid. Months are "YYYY-MM" strings. With `onClear`, the popup also offers
5
+ * `clearLabel` (e.g. "No end") to empty it.
6
+ */
7
+ export default function MonthPicker({ value, onChange, locale, min, max, id, className, disabled, placeholder, onClear, clearLabel, 'aria-label': ariaLabel, }: MonthPickerProps): import('react').JSX.Element;
8
+ export interface MonthPickerProps {
9
+ /** "YYYY-MM", or null for none. */
10
+ value: Month | null;
11
+ onChange: (month: Month) => void;
12
+ /** Decides month names and format, e.g. "en-IN". */
13
+ locale: string;
14
+ /** Earliest month that can be picked ("YYYY-MM"). */
15
+ min?: Month;
16
+ /** Latest month that can be picked. */
17
+ max?: Month;
18
+ id?: string;
19
+ /** Classes for the trigger (e.g. a width, instead of the default full width). */
20
+ className?: string;
21
+ disabled?: boolean;
22
+ placeholder?: string;
23
+ /** Offers a clear option in the popup (shown when a month is set). */
24
+ onClear?: () => void;
25
+ clearLabel?: string;
26
+ 'aria-label'?: string;
27
+ }
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/month-picker/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,KAAK,EAAc,MAAM,kBAAkB,CAAC;AAKvE;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,GAAG,EACH,GAAG,EACH,EAAE,EACF,SAAS,EACT,QAAgB,EAChB,WAA4B,EAC5B,OAAO,EACP,UAAoB,EACpB,YAAY,EAAE,SAAS,GAC1B,EAAE,gBAAgB,+BA2FlB;AAED,MAAM,WAAW,gBAAgB;IAC7B,mCAAmC;IACnC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iFAAiF;IACjF,SAAS,CAAC,E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AAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAC5F,KAAK,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AACrD,KAAK,SAAS,GACR,KAAK,GACL,WAAW,GACX,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,OAAO,GACP,aAAa,GACb,WAAW,GACX,MAAM,GACN,YAAY,GACZ,UAAU,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * A small set of mutually exclusive options, shown as a pill row. Native radio
3
- * inputs underneath, so arrow keys and forms work as for any radio group.
3
+ * inputs underneath, so arrow keys and forms work as for any radio group. The
4
+ * selection slides between options, like NavPills.
4
5
  */
5
6
  export default function Segmented<V extends string>({ label, value, options, onChange, name, className, }: SegmentedProps<V>): import('react').JSX.Element;
6
7
  export interface SegmentedProps<V extends string> {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/segmented/index.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,EAChD,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,SAAS,GACZ,EAAE,cAAc,CAAC,CAAC,CAAC,+BAmCnB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/segmented/index.tsx"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,EAChD,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,SAAS,GACZ,EAAE,cAAc,CAAC,CAAC,CAAC,+BAmEnB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectOption<V extends string> {
3
+ value: V;
4
+ /** Text shown, and matched when the user types to jump to an option. */
5
+ label: string;
6
+ disabled?: boolean;
7
+ }
8
+ /**
9
+ * Pick one value from a short list: a field-styled button that opens a list
10
+ * below it. Keyboard: arrows, Home/End, type to jump, Enter to choose, Escape
11
+ * to close. For long or searchable lists, use Dropdown.
12
+ */
13
+ export default function Select<V extends string>({ value, options, onChange, placeholder, disabled, renderOption, name, id, className, listClassName, 'aria-label': ariaLabel, }: SelectProps<V>): import('react').JSX.Element;
14
+ export interface SelectProps<V extends string> {
15
+ value: V | null;
16
+ options: readonly SelectOption<V>[];
17
+ onChange: (value: V) => void;
18
+ /** Shown while nothing is chosen. */
19
+ placeholder?: string;
20
+ disabled?: boolean;
21
+ /** Custom content for each option (the label is still used for typing to jump). */
22
+ renderOption?: (option: SelectOption<V>) => ReactNode;
23
+ /** Form field name: adds a hidden input with the value. */
24
+ name?: string;
25
+ id?: string;
26
+ /** Classes for the trigger (e.g. a width, instead of the default full width). */
27
+ className?: string;
28
+ /** Classes for the popup list. */
29
+ listClassName?: string;
30
+ 'aria-label'?: string;
31
+ }
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/select/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAiB,SAAS,EAA+B,MAAM,OAAO,CAAC;AAE9E,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM;IAC1C,KAAK,EAAE,CAAC,CAAC;IACT,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,EAC7C,KAAK,EACL,OAAO,EACP,QAAQ,EACR,WAAuB,EACvB,QAAgB,EAChB,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,SAAS,EACT,aAAa,EACb,YAAY,EAAE,SAAS,GAC1B,EAAE,WAAW,CAAC,CAAC,CAAC,+BA6HhB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM;IACzC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,OAAO,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IACtD,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,25 @@
1
+ import { ComponentProps } from 'react';
2
+ /**
3
+ * A range slider on the native <input type="range"> (keyboard, forms and
4
+ * screen readers work as usual): a rounded track, filled up to the value in
5
+ * the accent unless you give it your own `trackBackground` (e.g. a hue
6
+ * gradient), and a glowing thumb.
7
+ */
8
+ export default function Slider({ value, min, max, step, onValueChange, onValueCommit, trackBackground, thumbColor, valueText, className, style, ...rest }: SliderProps): import('react').JSX.Element;
9
+ export interface SliderProps extends Omit<ComponentProps<'input'>, 'type' | 'value' | 'min' | 'max' | 'step' | 'onChange' | 'defaultValue'> {
10
+ value: number;
11
+ min?: number;
12
+ max?: number;
13
+ step?: number;
14
+ /** While dragging (every step). */
15
+ onValueChange?: (value: number) => void;
16
+ /** Once the user lets go: the moment to save. */
17
+ onValueCommit?: (value: number) => void;
18
+ /** CSS background for the track, e.g. a gradient of hues. */
19
+ trackBackground?: string;
20
+ /** CSS colour for the thumb (default: the accent). */
21
+ thumbColor?: string;
22
+ /** Spoken value, e.g. (v) => `Hue ${v} degrees`. */
23
+ valueText?: (value: number) => string;
24
+ }
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/slider/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAoC,MAAM,OAAO,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,KAAK,EACL,GAAO,EACP,GAAS,EACT,IAAQ,EACR,aAAa,EACb,aAAa,EACb,eAAe,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACV,EAAE,WAAW,+BAiDb;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI,CACrC,cAAc,CAAC,OAAO,CAAC,EACvB,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,CAC1E;IACG,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iDAAiD;IACjD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC"}
@@ -0,0 +1,23 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ /**
3
+ * Phone navigation: a glass bar fixed to the bottom, clear of the home
4
+ * indicator, hidden from `hideFrom` up (default md). Fill it with TabBarItems.
5
+ */
6
+ export default function TabBar({ hideFrom, className, children, ...rest }: TabBarProps): import('react').JSX.Element;
7
+ /**
8
+ * One destination: an icon over a label. `active` marks the current page; with
9
+ * `asChild`, the styles go onto your own link (e.g. a router's NavLink, which
10
+ * sets aria-current itself).
11
+ */
12
+ export declare function TabBarItem({ icon, active, asChild, className, children, ...rest }: TabBarItemProps): import('react').JSX.Element;
13
+ export interface TabBarProps extends ComponentProps<'nav'> {
14
+ /** Hide the bar from this breakpoint up (false: always show). */
15
+ hideFrom?: 'sm' | 'md' | 'lg' | false;
16
+ }
17
+ export interface TabBarItemProps extends ComponentProps<'a'> {
18
+ icon?: ReactNode;
19
+ active?: boolean;
20
+ /** Style the single child element (a router link holding the icon and label) instead of rendering an <a>. */
21
+ asChild?: boolean;
22
+ }
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/tab-bar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAiB5F;AAOD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,+BAYlG;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,KAAK,CAAC;IACtD,iEAAiE;IACjE,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;CACzC;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,GAAG,CAAC;IACxD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6GAA6G;IAC7G,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -1,11 +1,80 @@
1
- import { ComponentProps } from 'react';
2
- /** A plain HTML table on a glass panel whose edge catches the pointer light, scrolling sideways when it doesn't fit. Compose with the Table* parts. */
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ /**
3
+ * The panel a table scrolls in: glass with an edge that catches the pointer
4
+ * light, like a Card. Give it a max height (className) to scroll vertically;
5
+ * it scrolls sideways when the table is wider. `ref` and scroll events are the
6
+ * scrolling element's. With `label`, it's a focusable region, so keyboard users
7
+ * can scroll it too.
8
+ */
9
+ export declare function TableContainer({ label, className, ref, onScroll, ...rest }: TableContainerProps): import('react').JSX.Element;
10
+ /** The <table>. Put it in a TableContainer for the panel and scrolling. */
3
11
  export default function Table({ className, ...rest }: ComponentProps<'table'>): import('react').JSX.Element;
4
- /** Column headings: small, muted, spaced caps. */
12
+ /** The heading rows: they stay at the top while the body scrolls, frosted as one surface. */
5
13
  export declare function TableHeader({ className, ...rest }: ComponentProps<'thead'>): import('react').JSX.Element;
6
- /** Rows, split by hairlines. */
7
- export declare function TableBody({ className, ...rest }: ComponentProps<'tbody'>): import('react').JSX.Element;
14
+ export declare function TableBody(props: ComponentProps<'tbody'>): import('react').JSX.Element;
15
+ /** Rows that stay at the bottom while the body scrolls (totals, balances). */
16
+ export declare function TableFooter({ className, ...rest }: ComponentProps<'tfoot'>): import('react').JSX.Element;
17
+ /** A row; its cells light up together on hover. */
8
18
  export declare function TableRow({ className, ...rest }: ComponentProps<'tr'>): import('react').JSX.Element;
9
- export declare function TableHead({ className, ...rest }: ComponentProps<'th'>): import('react').JSX.Element;
10
- export declare function TableCell({ className, ...rest }: ComponentProps<'td'>): import('react').JSX.Element;
19
+ /**
20
+ * Column heading: small spaced caps (TableHeader keeps the row at the top). With `onSort`, it's a
21
+ * button that shows the direction and announces it (aria-sort).
22
+ */
23
+ export declare function TableHead({ numeric, sticky, sortDirection, onSort, scope, className, children, ...rest }: TableHeadProps): import('react').JSX.Element;
24
+ /** A cell: hairline below, lit with its row on hover. `sticky="left"` keeps it in view when scrolling sideways. */
25
+ export declare function TableCell({ numeric, sticky, className, ...rest }: TableCellProps): import('react').JSX.Element;
26
+ /** A footer cell: sits on the card, above a hairline. Use inside TableFooter. */
27
+ export declare function TableFooterCell({ numeric, sticky, className, ...rest }: TableCellProps): import('react').JSX.Element;
28
+ /** An empty row of a given height, standing in for rows scrolled out of view (see useVirtualList). */
29
+ export declare function TableSpacerRow({ height, colSpan }: {
30
+ height: number;
31
+ colSpan: number;
32
+ }): import('react').JSX.Element | null;
33
+ /** One row spanning the table, for "nothing here" messages. */
34
+ export declare function TableEmpty({ colSpan, children }: {
35
+ colSpan: number;
36
+ children?: ReactNode;
37
+ }): import('react').JSX.Element;
38
+ export type SortDirection = 'asc' | 'desc';
39
+ /**
40
+ * Sorting for a table: click a heading to sort by it, again to reverse, a
41
+ * third time to clear. Spread `headProps(key)` onto that column's TableHead.
42
+ */
43
+ export declare function useSort<T, K extends string>(rows: readonly T[], compare: Record<K, (a: T, b: T) => number>, initial?: {
44
+ key: K;
45
+ direction: SortDirection;
46
+ }): {
47
+ rows: readonly T[];
48
+ sort: {
49
+ key: K;
50
+ direction: SortDirection;
51
+ } | null;
52
+ setSort: import('react').Dispatch<import('react').SetStateAction<{
53
+ key: K;
54
+ direction: SortDirection;
55
+ } | null>>;
56
+ headProps: (key: K) => {
57
+ sortDirection: SortDirection | undefined;
58
+ onSort: () => void;
59
+ };
60
+ };
61
+ export interface TableContainerProps extends ComponentProps<'div'> {
62
+ /** Accessible name; makes the scroll area a focusable region. */
63
+ label?: string;
64
+ }
65
+ export interface TableHeadProps extends ComponentProps<'th'> {
66
+ /** Right-aligned, for numbers. */
67
+ numeric?: boolean;
68
+ /** Stay in view when the table scrolls sideways. */
69
+ sticky?: 'left';
70
+ sortDirection?: SortDirection;
71
+ /** Makes the heading a sort button. */
72
+ onSort?: () => void;
73
+ }
74
+ export interface TableCellProps extends ComponentProps<'td'> {
75
+ /** Right-aligned, tabular digits. */
76
+ numeric?: boolean;
77
+ /** Stay in view when the table scrolls sideways. */
78
+ sticky?: 'left';
79
+ }
11
80
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/table/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,uJAAuJ;AACvJ,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,OAAO,CAAC,+BAM5E;AAED,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,OAA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