@dreamtree-org/twreact-ui 1.3.7 → 1.3.9

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 (54) hide show
  1. package/DESIGN.md +11 -3
  2. package/README.md +7 -1
  3. package/ai-skills/dreamtree-ui.md +2 -2
  4. package/dist/charts/index.js +69 -24
  5. package/dist/components/charts/chartTheme.d.ts +2 -5
  6. package/dist/components/charts/chartTheme.d.ts.map +1 -1
  7. package/dist/components/core/Table/Table.d.ts.map +1 -1
  8. package/dist/components/core/Table/useClickOutside.d.ts +5 -2
  9. package/dist/components/core/Table/useClickOutside.d.ts.map +1 -1
  10. package/dist/components/utility/Portal.d.ts +6 -0
  11. package/dist/components/utility/Portal.d.ts.map +1 -0
  12. package/dist/esm/components/charts/CartesianChart.js +2 -1
  13. package/dist/esm/components/charts/DonutChart.js +2 -1
  14. package/dist/esm/components/charts/Sparkline.js +2 -1
  15. package/dist/esm/components/charts/chartTheme.js +1 -22
  16. package/dist/esm/components/core/Button.js +8 -8
  17. package/dist/esm/components/core/Table/Table.js +11 -5
  18. package/dist/esm/hooks/useClickOutside.js +51 -0
  19. package/dist/esm/hooks/useMediaQuery.js +61 -0
  20. package/dist/esm/hooks/useReducedMotion.js +17 -0
  21. package/dist/esm/hooks/useScrollLock.js +76 -9
  22. package/dist/esm/hooks/useTheme.js +6 -1
  23. package/dist/esm/utils/position.js +6 -0
  24. package/dist/hooks/useClickOutside.d.ts +14 -0
  25. package/dist/hooks/useClickOutside.d.ts.map +1 -0
  26. package/dist/hooks/useFloatingPosition.d.ts +37 -0
  27. package/dist/hooks/useFloatingPosition.d.ts.map +1 -0
  28. package/dist/hooks/useMediaQuery.d.ts +22 -0
  29. package/dist/hooks/useMediaQuery.d.ts.map +1 -0
  30. package/dist/hooks/usePresence.d.ts +16 -0
  31. package/dist/hooks/usePresence.d.ts.map +1 -0
  32. package/dist/hooks/usePresentation.d.ts +9 -0
  33. package/dist/hooks/usePresentation.d.ts.map +1 -0
  34. package/dist/hooks/useReducedMotion.d.ts +10 -0
  35. package/dist/hooks/useReducedMotion.d.ts.map +1 -0
  36. package/dist/hooks/useScrollLock.d.ts +11 -1
  37. package/dist/hooks/useScrollLock.d.ts.map +1 -1
  38. package/dist/hooks/useTheme.d.ts.map +1 -1
  39. package/dist/index.css +1 -1
  40. package/dist/index.esm.css +1 -1
  41. package/dist/index.esm.js +142 -34
  42. package/dist/index.js +142 -34
  43. package/dist/tokens/tailwind3-preset.cjs +101 -8
  44. package/dist/tokens/theme.css +27 -0
  45. package/dist/tokens/tokens.json +175 -0
  46. package/dist/tokens/vars.css +2 -0
  47. package/dist/utils/position.d.ts.map +1 -1
  48. package/dist/utils/touchTarget.d.ts +1 -0
  49. package/dist/utils/touchTarget.d.ts.map +1 -1
  50. package/mcp/catalog.snapshot.json +1 -1
  51. package/package.json +4 -15
  52. package/tokens/lib.cjs +35 -0
  53. package/tokens/tokens.json +58 -2
  54. package/dist/esm/components/core/Table/useClickOutside.js +0 -26
package/dist/index.js CHANGED
@@ -3472,15 +3472,15 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3472
3472
  var Component = as || (props.href !== undefined ? 'a' : 'button');
3473
3473
  var isNativeButton = Component === 'button';
3474
3474
  var isDisabled = disabled || loading;
3475
- var baseClasses = cn$1('inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:pointer-events-none', {
3475
+ var baseClasses = cn$1('inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:pointer-events-none', {
3476
3476
  // Variants
3477
- 'bg-primary-600 text-white hover:bg-primary-700 focus:ring-primary-500': variant === 'primary',
3478
- 'bg-secondary-100 text-secondary-900 hover:bg-secondary-200 focus:ring-secondary-500': variant === 'secondary',
3479
- 'bg-transparent border border-gray-300 hover:bg-gray-50 focus:ring-primary-500 dark:border-gray-600 dark:text-gray-100 dark:hover:bg-gray-800 dark:focus:ring-offset-gray-900': variant === 'outline',
3480
- 'bg-transparent text-primary-600 hover:bg-primary-50 focus:ring-primary-500': variant === 'ghost',
3481
- 'bg-error-600 text-white hover:bg-error-700 focus:ring-error-500': variant === 'destructive',
3482
- 'bg-success-600 text-white hover:bg-success-700 focus:ring-success-500': variant === 'success',
3483
- 'bg-warning-600 text-white hover:bg-warning-700 focus:ring-warning-500': variant === 'warning',
3477
+ 'bg-primary-600 text-white hover:bg-primary-700 focus-visible:ring-primary-500': variant === 'primary',
3478
+ 'bg-secondary-100 text-secondary-900 hover:bg-secondary-200 focus-visible:ring-secondary-500': variant === 'secondary',
3479
+ 'bg-transparent border border-gray-300 hover:bg-gray-50 focus-visible:ring-primary-500 dark:border-gray-600 dark:text-gray-100 dark:hover:bg-gray-800 dark:focus-visible:ring-offset-gray-900': variant === 'outline',
3480
+ 'bg-transparent text-primary-600 hover:bg-primary-50 focus-visible:ring-primary-500': variant === 'ghost',
3481
+ 'bg-error-600 text-white hover:bg-error-700 focus-visible:ring-error-500': variant === 'destructive',
3482
+ 'bg-success-600 text-white hover:bg-success-700 focus-visible:ring-success-500': variant === 'success',
3483
+ 'bg-warning-600 text-white hover:bg-warning-700 focus-visible:ring-warning-500': variant === 'warning',
3484
3484
  // Sizes — every value of the shared `Size` type gets a real height.
3485
3485
  'h-7 px-2 text-xs': size === 'xs',
3486
3486
  'h-8 px-3 text-xs': size === 'sm',
@@ -4975,26 +4975,50 @@ var resolveActions = function resolveActions(actions, row, index) {
4975
4975
  };
4976
4976
  };
4977
4977
 
4978
+ // Internal (not exported). Calls `onClickOutside` when a press lands outside
4979
+ // every element in `refs`.
4980
+ /** Events to listen to: `pointerdown` where supported, else mouse + touch. */
4981
+ function outsidePressEvents() {
4982
+ if (typeof window !== "undefined" && typeof window.PointerEvent === "function") {
4983
+ return ["pointerdown"];
4984
+ }
4985
+ return ["mousedown", "touchstart"];
4986
+ }
4978
4987
  /**
4979
- * Custom hook to detect clicks outside of specified refs
4980
- * @param {Array} refs - Array of React refs to check
4981
- * @param {boolean} isActive - Whether the hook should be active
4982
- * @param {Function} onClickOutside - Callback when click is detected outside
4988
+ * @param {React.RefObject|React.RefObject[]} refs - one ref or an array of
4989
+ * refs; a press inside any of them is "inside". Refs with no node are ignored.
4990
+ * @param {(event: Event) => void} onClickOutside - called with the event.
4991
+ * @param {{ enabled?: boolean }} [options] - `enabled` (default true) attaches
4992
+ * or detaches the listeners.
4983
4993
  */
4984
- function useClickOutside(refs, isActive, onClickOutside) {
4994
+ function useClickOutside(refs, onClickOutside) {
4995
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
4996
+ _ref$enabled = _ref.enabled,
4997
+ enabled = _ref$enabled === void 0 ? true : _ref$enabled;
4998
+ var refsRef = useLatestRef(refs);
4999
+ var handlerRef = useLatestRef(onClickOutside);
4985
5000
  React.useEffect(function () {
4986
- if (!isActive) return;
4987
- var handler = function handler(e) {
4988
- var isOutside = refs.every(function (ref) {
4989
- return !ref.current || !ref.current.contains(e.target);
5001
+ if (!enabled || typeof document === "undefined") return undefined;
5002
+ var handler = function handler(event) {
5003
+ var _handlerRef$current;
5004
+ var current = refsRef.current;
5005
+ var list = Array.isArray(current) ? current : [current];
5006
+ var inside = list.some(function (ref) {
5007
+ var node = ref === null || ref === void 0 ? void 0 : ref.current;
5008
+ return Boolean(node && typeof node.contains === "function" && node.contains(event.target));
4990
5009
  });
4991
- if (isOutside) onClickOutside();
5010
+ if (!inside) (_handlerRef$current = handlerRef.current) === null || _handlerRef$current === void 0 || _handlerRef$current.call(handlerRef, event);
4992
5011
  };
4993
- document.addEventListener("mousedown", handler, true);
5012
+ var events = outsidePressEvents();
5013
+ events.forEach(function (type) {
5014
+ return document.addEventListener(type, handler, true);
5015
+ });
4994
5016
  return function () {
4995
- return document.removeEventListener("mousedown", handler, true);
5017
+ return events.forEach(function (type) {
5018
+ return document.removeEventListener(type, handler, true);
5019
+ });
4996
5020
  };
4997
- }, [refs, isActive, onClickOutside]);
5021
+ }, [enabled, refsRef, handlerRef]);
4998
5022
  }
4999
5023
 
5000
5024
  /**
@@ -6595,8 +6619,10 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
6595
6619
  });
6596
6620
  }
6597
6621
  }, []);
6598
- useClickOutside([tableContainerRef], interactive && Boolean(editingCell), function () {
6599
- setEditingCell(null);
6622
+ useClickOutside([tableContainerRef], function () {
6623
+ return setEditingCell(null);
6624
+ }, {
6625
+ enabled: interactive && Boolean(editingCell)
6600
6626
  });
6601
6627
  var actionButtonRefs = React.useRef({});
6602
6628
  // Row components register their kebab buttons through this callback rather
@@ -6674,8 +6700,12 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
6674
6700
  var closeActionMenu = React.useCallback(function () {
6675
6701
  return setActiveActionRowKey(null);
6676
6702
  }, []);
6677
- useClickOutside([columnMenuRef, columnToggleBtnRef], showColumnMenu, closeColumnMenu);
6678
- useClickOutside([actionMenuRef], activeActionRowKey !== null, closeActionMenu);
6703
+ useClickOutside([columnMenuRef, columnToggleBtnRef], closeColumnMenu, {
6704
+ enabled: showColumnMenu
6705
+ });
6706
+ useClickOutside([actionMenuRef], closeActionMenu, {
6707
+ enabled: activeActionRowKey !== null
6708
+ });
6679
6709
  // Computed values
6680
6710
  var activeAnchorEl = React.useMemo(function () {
6681
6711
  if (activeActionRowKey === null) return null;
@@ -18997,6 +19027,12 @@ var TextToSpeech = function TextToSpeech(_ref) {
18997
19027
  });
18998
19028
  };
18999
19029
 
19030
+ /**
19031
+ * @deprecated Use `useFloatingPosition` (src/hooks/useFloatingPosition.js,
19032
+ * built on @floating-ui/react-dom) for new overlays. This module stays until
19033
+ * Popover and Tour migrate; `prefersReducedMotion` / `revealElement` remain
19034
+ * in use elsewhere.
19035
+ */
19000
19036
  // Internal (not exported). Viewport-space positioning shared by Popover and Tour.
19001
19037
  // All rects are getBoundingClientRect() values, so the result is for
19002
19038
  // `position: fixed`.
@@ -21676,24 +21712,91 @@ Alert.displayName = 'Alert';
21676
21712
 
21677
21713
  // Internal (not exported). Locks body scroll while any overlay is open. A
21678
21714
  // counter lets two overlays (e.g. a Drawer and a Tour) overlap without the
21679
- // first one to close unlocking the page under the second.
21715
+ // first one to close unlocking the page under the second: only the outermost
21716
+ // lock touches the body, and only the last release restores it.
21717
+ //
21718
+ // While locked it also
21719
+ // - pads the body by the scrollbar width, so the page does not shift when the
21720
+ // scrollbar disappears;
21721
+ // - on iOS (or with `{ fixedBody: true }`) pins the body with
21722
+ // `position: fixed; top: -scrollY; width: 100%`, because iOS Safari ignores
21723
+ // `overflow: hidden` on the body, and restores the scroll position after.
21680
21724
  var lock = {
21681
21725
  count: 0,
21682
- previous: ""
21726
+ saved: null
21683
21727
  };
21728
+ /** iPhone / iPod / iPad, including iPadOS 13+ which reports itself as a Mac. */
21729
+ function isIOS() {
21730
+ if (typeof navigator === "undefined") return false;
21731
+ var platform = navigator.platform || "";
21732
+ if (/iP(hone|od|ad)/.test(platform)) return true;
21733
+ return platform === "MacIntel" && Number(navigator.maxTouchPoints) > 1;
21734
+ }
21735
+ function scrollbarWidth() {
21736
+ var docWidth = document.documentElement.clientWidth;
21737
+ // jsdom (and detached documents) report 0; treat as "no scrollbar".
21738
+ if (!docWidth) return 0;
21739
+ return Math.max(0, window.innerWidth - docWidth);
21740
+ }
21741
+ function acquire(fixedBody) {
21742
+ var _document = document,
21743
+ body = _document.body;
21744
+ var style = body.style;
21745
+ var saved = {
21746
+ overflow: style.overflow,
21747
+ paddingRight: style.paddingRight,
21748
+ fixed: fixedBody
21749
+ };
21750
+ var gap = scrollbarWidth();
21751
+ if (gap > 0) {
21752
+ var current = parseFloat(window.getComputedStyle(body).paddingRight) || 0;
21753
+ style.paddingRight = "".concat(current + gap, "px");
21754
+ }
21755
+ if (fixedBody) {
21756
+ saved.position = style.position;
21757
+ saved.top = style.top;
21758
+ saved.width = style.width;
21759
+ saved.scrollX = window.scrollX || window.pageXOffset || 0;
21760
+ saved.scrollY = window.scrollY || window.pageYOffset || 0;
21761
+ style.position = "fixed";
21762
+ style.top = "-".concat(saved.scrollY, "px");
21763
+ style.width = "100%";
21764
+ }
21765
+ style.overflow = "hidden";
21766
+ lock.saved = saved;
21767
+ }
21768
+ function release() {
21769
+ var saved = lock.saved;
21770
+ lock.saved = null;
21771
+ if (!saved) return;
21772
+ var style = document.body.style;
21773
+ style.overflow = saved.overflow;
21774
+ style.paddingRight = saved.paddingRight;
21775
+ if (saved.fixed) {
21776
+ style.position = saved.position;
21777
+ style.top = saved.top;
21778
+ style.width = saved.width;
21779
+ if (typeof window.scrollTo === "function") window.scrollTo(saved.scrollX, saved.scrollY);
21780
+ }
21781
+ }
21782
+ /**
21783
+ * @param {boolean} active - hold the lock while true.
21784
+ * @param {{ fixedBody?: boolean }} [options] - force the iOS-safe
21785
+ * `position: fixed` mode; defaults to auto-detecting iOS. Only the outermost
21786
+ * lock's mode applies.
21787
+ */
21684
21788
  function useScrollLock(active) {
21789
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
21790
+ fixedBody = _ref.fixedBody;
21685
21791
  React.useEffect(function () {
21686
21792
  if (!active || typeof document === "undefined") return undefined;
21687
- if (lock.count === 0) {
21688
- lock.previous = document.body.style.overflow;
21689
- document.body.style.overflow = "hidden";
21690
- }
21793
+ if (lock.count === 0) acquire(fixedBody === undefined ? isIOS() : Boolean(fixedBody));
21691
21794
  lock.count += 1;
21692
21795
  return function () {
21693
21796
  lock.count -= 1;
21694
- if (lock.count === 0) document.body.style.overflow = lock.previous;
21797
+ if (lock.count === 0) release();
21695
21798
  };
21696
- }, [active]);
21799
+ }, [active, fixedBody]);
21697
21800
  }
21698
21801
 
21699
21802
  // Internal (not exported). Drag-down-to-dismiss for a bottom sheet. Spread
@@ -23917,7 +24020,12 @@ var ThemeProvider = function ThemeProvider(_ref) {
23917
24020
  }, []);
23918
24021
  React.useEffect(function () {
23919
24022
  localStorage.setItem('dreamtree-theme', theme);
23920
- document.documentElement.setAttribute('data-theme', theme);
24023
+ var root = document.documentElement;
24024
+ root.setAttribute('data-theme', theme);
24025
+ // `.dark` drives Tailwind `dark:` utilities in consumer apps configured with
24026
+ // `darkMode: 'class'`; color-scheme flips native scrollbars and form controls.
24027
+ root.classList.toggle('dark', theme === 'dark');
24028
+ root.style.colorScheme = theme;
23921
24029
  }, [theme]);
23922
24030
  var toggleTheme = function toggleTheme() {
23923
24031
  setTheme(function (prev) {
@@ -188,7 +188,8 @@ const vars = {
188
188
  "--dt-line": "226 232 240",
189
189
  "--dt-shell": "15 23 42",
190
190
  "--dt-shell-foreground": "203 213 225",
191
- "--dt-shell-active": "30 41 59"
191
+ "--dt-shell-active": "30 41 59",
192
+ "--dt-shadow-strength": "1"
192
193
  },
193
194
  "dark": {
194
195
  "--dt-background": "11 17 32",
@@ -198,17 +199,109 @@ const vars = {
198
199
  "--dt-line": "31 41 55",
199
200
  "--dt-shell": "2 6 23",
200
201
  "--dt-shell-foreground": "203 213 225",
201
- "--dt-shell-active": "30 41 59"
202
+ "--dt-shell-active": "30 41 59",
203
+ "--dt-shadow-strength": "2.5"
204
+ }
205
+ };
206
+ const theme = {
207
+ "fontSize": {
208
+ "micro": [
209
+ "0.6875rem",
210
+ {
211
+ "lineHeight": "1rem"
212
+ }
213
+ ],
214
+ "page-title": [
215
+ "1.5rem",
216
+ {
217
+ "lineHeight": "2rem",
218
+ "fontWeight": "600"
219
+ }
220
+ ],
221
+ "section-title": [
222
+ "1rem",
223
+ {
224
+ "lineHeight": "1.5rem",
225
+ "fontWeight": "600"
226
+ }
227
+ ],
228
+ "body": [
229
+ "0.875rem",
230
+ {
231
+ "lineHeight": "1.25rem"
232
+ }
233
+ ],
234
+ "caption": [
235
+ "0.75rem",
236
+ {
237
+ "lineHeight": "1rem"
238
+ }
239
+ ],
240
+ "kpi": [
241
+ "1.875rem",
242
+ {
243
+ "lineHeight": "2.25rem",
244
+ "fontWeight": "600"
245
+ }
246
+ ]
247
+ },
248
+ "fontFamily": {
249
+ "sans": [
250
+ "Inter",
251
+ "system-ui",
252
+ "-apple-system",
253
+ "Segoe UI",
254
+ "Roboto",
255
+ "Arial",
256
+ "sans-serif"
257
+ ],
258
+ "mono": [
259
+ "JetBrains Mono",
260
+ "ui-monospace",
261
+ "SFMono-Regular",
262
+ "Menlo",
263
+ "monospace"
264
+ ]
265
+ },
266
+ "borderRadius": {
267
+ "control": "0.5rem",
268
+ "card": "0.75rem",
269
+ "sheet": "1rem",
270
+ "pill": "9999px"
271
+ },
272
+ "boxShadow": {
273
+ "xs": "0 1px 2px 0 rgb(0 0 0 / calc(0.04 * var(--dt-shadow-strength, 1)))",
274
+ "sm": "0 1px 2px 0 rgb(0 0 0 / calc(0.05 * var(--dt-shadow-strength, 1)))",
275
+ "DEFAULT": "0 1px 3px 0 rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 1px 2px -1px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))",
276
+ "md": "0 4px 6px -1px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 2px 4px -2px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))",
277
+ "lg": "0 10px 15px -3px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 4px 6px -4px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))",
278
+ "xl": "0 20px 25px -5px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 8px 10px -6px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))",
279
+ "overlay": "0 24px 48px -12px rgb(0 0 0 / calc(0.25 * var(--dt-shadow-strength, 1)))"
280
+ },
281
+ "zIndex": {
282
+ "base": "0",
283
+ "sticky": "20",
284
+ "dropdown": "30",
285
+ "overlay": "40",
286
+ "modal": "50",
287
+ "popover": "60",
288
+ "toast": "70",
289
+ "tooltip": "80"
290
+ },
291
+ "transitionDuration": {
292
+ "fast": "120ms",
293
+ "base": "200ms",
294
+ "slow": "320ms"
295
+ },
296
+ "transitionTimingFunction": {
297
+ "standard": "cubic-bezier(0.2, 0, 0, 1)",
298
+ "emphasized": "cubic-bezier(0.05, 0.7, 0.1, 1)",
299
+ "spring-out": "cubic-bezier(0.34, 1.56, 0.64, 1)"
202
300
  }
203
301
  };
204
302
  module.exports = {
205
303
  theme: {
206
- extend: {
207
- colors,
208
- fontSize: { micro: ['0.6875rem', { lineHeight: '1rem' }] },
209
- borderRadius: { control: '0.5rem', card: '0.75rem' },
210
- fontFamily: { sans: ["Inter","system-ui","-apple-system","Segoe UI","Roboto","Arial","sans-serif"], mono: ["JetBrains Mono","ui-monospace","SFMono-Regular","Menlo","monospace"] },
211
- },
304
+ extend: { colors, ...theme },
212
305
  },
213
306
  plugins: [plugin(({ addBase }) => addBase({ ':root': vars.light, ".dark, [data-theme=\"dark\"]": vars.dark }))],
214
307
  };
@@ -85,6 +85,7 @@
85
85
  --dt-shell: 15 23 42;
86
86
  --dt-shell-foreground: 203 213 225;
87
87
  --dt-shell-active: 30 41 59;
88
+ --dt-shadow-strength: 1;
88
89
  }
89
90
 
90
91
  .dark, [data-theme="dark"] {
@@ -96,6 +97,7 @@
96
97
  --dt-shell: 2 6 23;
97
98
  --dt-shell-foreground: 203 213 225;
98
99
  --dt-shell-active: 30 41 59;
100
+ --dt-shadow-strength: 2.5;
99
101
  }
100
102
 
101
103
  @theme inline {
@@ -188,6 +190,31 @@
188
190
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
189
191
  --text-micro: 0.6875rem;
190
192
  --text-micro--line-height: 1rem;
193
+ --text-page-title: 1.5rem;
194
+ --text-page-title--line-height: 2rem;
195
+ --text-page-title--font-weight: 600;
196
+ --text-section-title: 1rem;
197
+ --text-section-title--line-height: 1.5rem;
198
+ --text-section-title--font-weight: 600;
199
+ --text-body: 0.875rem;
200
+ --text-body--line-height: 1.25rem;
201
+ --text-caption: 0.75rem;
202
+ --text-caption--line-height: 1rem;
203
+ --text-kpi: 1.875rem;
204
+ --text-kpi--line-height: 2.25rem;
205
+ --text-kpi--font-weight: 600;
191
206
  --radius-control: 0.5rem;
192
207
  --radius-card: 0.75rem;
208
+ --radius-sheet: 1rem;
209
+ --radius-pill: 9999px;
210
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / calc(0.04 * var(--dt-shadow-strength, 1)));
211
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / calc(0.05 * var(--dt-shadow-strength, 1)));
212
+ --shadow: 0 1px 3px 0 rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 1px 2px -1px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)));
213
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 2px 4px -2px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)));
214
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 4px 6px -4px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)));
215
+ --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 8px 10px -6px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)));
216
+ --shadow-overlay: 0 24px 48px -12px rgb(0 0 0 / calc(0.25 * var(--dt-shadow-strength, 1)));
217
+ --ease-standard: cubic-bezier(0.2, 0, 0, 1);
218
+ --ease-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1);
219
+ --ease-spring-out: cubic-bezier(0.34, 1.56, 0.64, 1);
193
220
  }
@@ -350,6 +350,59 @@
350
350
  "$extensions": {
351
351
  "org.dreamtree.lineHeight": "1rem"
352
352
  }
353
+ },
354
+ "page-title": {
355
+ "$value": {
356
+ "value": 1.5,
357
+ "unit": "rem"
358
+ },
359
+ "$extensions": {
360
+ "org.dreamtree.lineHeight": "2rem",
361
+ "org.dreamtree.fontWeight": "600"
362
+ },
363
+ "$description": "The page h1, inside PageHeader."
364
+ },
365
+ "section-title": {
366
+ "$value": {
367
+ "value": 1,
368
+ "unit": "rem"
369
+ },
370
+ "$extensions": {
371
+ "org.dreamtree.lineHeight": "1.5rem",
372
+ "org.dreamtree.fontWeight": "600"
373
+ },
374
+ "$description": "Card and section headings."
375
+ },
376
+ "body": {
377
+ "$value": {
378
+ "value": 0.875,
379
+ "unit": "rem"
380
+ },
381
+ "$extensions": {
382
+ "org.dreamtree.lineHeight": "1.25rem"
383
+ },
384
+ "$description": "Default UI text."
385
+ },
386
+ "caption": {
387
+ "$value": {
388
+ "value": 0.75,
389
+ "unit": "rem"
390
+ },
391
+ "$extensions": {
392
+ "org.dreamtree.lineHeight": "1rem"
393
+ },
394
+ "$description": "Secondary text, with text-muted."
395
+ },
396
+ "kpi": {
397
+ "$value": {
398
+ "value": 1.875,
399
+ "unit": "rem"
400
+ },
401
+ "$extensions": {
402
+ "org.dreamtree.lineHeight": "2.25rem",
403
+ "org.dreamtree.fontWeight": "600"
404
+ },
405
+ "$description": "StatCard values; pair with tabular-nums."
353
406
  }
354
407
  }
355
408
  },
@@ -368,6 +421,128 @@
368
421
  "unit": "rem"
369
422
  },
370
423
  "$description": "Cards and dialogs."
424
+ },
425
+ "sheet": {
426
+ "$value": {
427
+ "value": 1,
428
+ "unit": "rem"
429
+ },
430
+ "$description": "Top corners of bottom sheets."
431
+ },
432
+ "pill": {
433
+ "$value": {
434
+ "value": 9999,
435
+ "unit": "px"
436
+ },
437
+ "$description": "Pills, badges, segmented controls."
438
+ }
439
+ },
440
+ "shadow": {
441
+ "$type": "shadow",
442
+ "$description": "Elevation, as CSS box-shadow. Light values equal Tailwind's defaults; --dt-shadow-strength deepens them in dark mode, where a 10% black shadow disappears.",
443
+ "xs": {
444
+ "$value": "0 1px 2px 0 rgb(0 0 0 / calc(0.04 * var(--dt-shadow-strength, 1)))"
445
+ },
446
+ "sm": {
447
+ "$value": "0 1px 2px 0 rgb(0 0 0 / calc(0.05 * var(--dt-shadow-strength, 1)))"
448
+ },
449
+ "DEFAULT": {
450
+ "$value": "0 1px 3px 0 rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 1px 2px -1px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))"
451
+ },
452
+ "md": {
453
+ "$value": "0 4px 6px -1px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 2px 4px -2px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))"
454
+ },
455
+ "lg": {
456
+ "$value": "0 10px 15px -3px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 4px 6px -4px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))"
457
+ },
458
+ "xl": {
459
+ "$value": "0 20px 25px -5px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1))), 0 8px 10px -6px rgb(0 0 0 / calc(0.1 * var(--dt-shadow-strength, 1)))"
460
+ },
461
+ "overlay": {
462
+ "$value": "0 24px 48px -12px rgb(0 0 0 / calc(0.25 * var(--dt-shadow-strength, 1)))",
463
+ "$description": "Dialogs, sheets, popovers and menus."
464
+ }
465
+ },
466
+ "zIndex": {
467
+ "$type": "number",
468
+ "$description": "Stacking layers, lowest to highest. Use z-<layer>, never z-50 or an inline zIndex.",
469
+ "base": {
470
+ "$value": 0
471
+ },
472
+ "sticky": {
473
+ "$value": 20
474
+ },
475
+ "dropdown": {
476
+ "$value": 30
477
+ },
478
+ "overlay": {
479
+ "$value": 40
480
+ },
481
+ "modal": {
482
+ "$value": 50
483
+ },
484
+ "popover": {
485
+ "$value": 60
486
+ },
487
+ "toast": {
488
+ "$value": 70
489
+ },
490
+ "tooltip": {
491
+ "$value": 80
492
+ }
493
+ },
494
+ "duration": {
495
+ "$type": "duration",
496
+ "fast": {
497
+ "$value": {
498
+ "value": 120,
499
+ "unit": "ms"
500
+ },
501
+ "$description": "Hover, press, small fades."
502
+ },
503
+ "base": {
504
+ "$value": {
505
+ "value": 200,
506
+ "unit": "ms"
507
+ },
508
+ "$description": "Most enter transitions."
509
+ },
510
+ "slow": {
511
+ "$value": {
512
+ "value": 320,
513
+ "unit": "ms"
514
+ },
515
+ "$description": "Sheets, drawers, large surfaces."
516
+ }
517
+ },
518
+ "easing": {
519
+ "$type": "cubicBezier",
520
+ "standard": {
521
+ "$value": [
522
+ 0.2,
523
+ 0,
524
+ 0,
525
+ 1
526
+ ],
527
+ "$description": "Default for moving and resizing."
528
+ },
529
+ "emphasized": {
530
+ "$value": [
531
+ 0.05,
532
+ 0.7,
533
+ 0.1,
534
+ 1
535
+ ],
536
+ "$description": "Entering surfaces (decelerate)."
537
+ },
538
+ "spring-out": {
539
+ "$value": [
540
+ 0.34,
541
+ 1.56,
542
+ 0.64,
543
+ 1
544
+ ],
545
+ "$description": "Small overshoot for sheets settling and toggles."
371
546
  }
372
547
  }
373
548
  }
@@ -84,6 +84,7 @@
84
84
  --dt-shell: 15 23 42;
85
85
  --dt-shell-foreground: 203 213 225;
86
86
  --dt-shell-active: 30 41 59;
87
+ --dt-shadow-strength: 1;
87
88
  }
88
89
 
89
90
  .dark, [data-theme="dark"] {
@@ -95,4 +96,5 @@
95
96
  --dt-shell: 2 6 23;
96
97
  --dt-shell-foreground: 203 213 225;
97
98
  --dt-shell-active: 30 41 59;
99
+ --dt-shadow-strength: 2.5;
98
100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/utils/position.js"],"names":[],"mappings":"AAMA;;;EAGC;AAwBD;;;;GAIG;AACH;;;;;;;;;EAkBC;AAED,4DAA4D;AAC5D,gDAGC;AAYD;;;;GAIG;AACH,6CAgBC;AAED,iEAAiE;AACjE,yDAMC"}
1
+ {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/utils/position.js"],"names":[],"mappings":"AAaA;;;EAGC;AAwBD;;;;GAIG;AACH;;;;;;;;;EAkBC;AAED,4DAA4D;AAC5D,gDAGC;AAYD;;;;GAIG;AACH,6CAgBC;AAED,iEAAiE;AACjE,yDAMC"}
@@ -1,2 +1,3 @@
1
1
  export const TOUCH_TARGET: "[@media(pointer:coarse)]:min-h-11 [@media(pointer:coarse)]:min-w-11";
2
+ export const PRESS_FEEDBACK: "active:scale-[0.97] motion-reduce:active:scale-100 transition-transform duration-fast";
2
3
  //# sourceMappingURL=touchTarget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"touchTarget.d.ts","sourceRoot":"","sources":["../../src/utils/touchTarget.js"],"names":[],"mappings":"AAGA,2BACE,qEAAqE,CAAC"}
1
+ {"version":3,"file":"touchTarget.d.ts","sourceRoot":"","sources":["../../src/utils/touchTarget.js"],"names":[],"mappings":"AAGA,2BACE,qEAAqE,CAAC;AAIxE,6BACE,uFAAuF,CAAC"}