@dryui/ui 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/button-group/context.svelte.js +4 -7
  2. package/dist/calendar/calendar-root.svelte +15 -32
  3. package/dist/chip-group/context.svelte.d.ts +2 -4
  4. package/dist/chip-group/context.svelte.js +2 -9
  5. package/dist/context-menu/context-menu-content.svelte +24 -12
  6. package/dist/context-menu/context-menu-group.svelte +3 -2
  7. package/dist/context-menu/context-menu-item.svelte +8 -61
  8. package/dist/context-menu/context-menu-label.svelte +3 -11
  9. package/dist/context-menu/context-menu-root.svelte +10 -29
  10. package/dist/context-menu/context-menu-separator.svelte +2 -9
  11. package/dist/context-menu/context.svelte.d.ts +2 -12
  12. package/dist/date-picker/datepicker-content.svelte +11 -81
  13. package/dist/date-picker/datepicker-content.svelte.d.ts +1 -1
  14. package/dist/date-picker/datepicker-input-root.svelte +39 -47
  15. package/dist/date-range-picker/date-range-picker-content.svelte +11 -75
  16. package/dist/date-range-picker/date-range-picker-content.svelte.d.ts +1 -1
  17. package/dist/date-range-picker/date-range-picker-root.svelte +44 -49
  18. package/dist/drag-and-drop/group-context.svelte.d.ts +1 -1
  19. package/dist/drag-and-drop/group-context.svelte.js +4 -4
  20. package/dist/dropdown-menu/context.svelte.d.ts +2 -8
  21. package/dist/dropdown-menu/dropdown-menu-content.svelte +15 -3
  22. package/dist/dropdown-menu/dropdown-menu-group.svelte +3 -2
  23. package/dist/dropdown-menu/dropdown-menu-item.svelte +8 -61
  24. package/dist/dropdown-menu/dropdown-menu-label.svelte +3 -11
  25. package/dist/dropdown-menu/dropdown-menu-root.svelte +10 -21
  26. package/dist/dropdown-menu/dropdown-menu-separator.svelte +2 -9
  27. package/dist/flip-card/context.svelte.d.ts +5 -0
  28. package/dist/flip-card/context.svelte.js +2 -0
  29. package/dist/flip-card/flip-card-back.svelte +2 -2
  30. package/dist/flip-card/flip-card-root.svelte +42 -15
  31. package/dist/heading/heading.svelte +10 -1
  32. package/dist/heading/heading.svelte.d.ts +1 -0
  33. package/dist/heading/index.d.ts +1 -0
  34. package/dist/hover-card/hover-card-content.svelte +9 -21
  35. package/dist/hover-card/hover-card-root.svelte +2 -2
  36. package/dist/hover-card/hover-card-root.svelte.d.ts +4 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.js +1 -0
  39. package/dist/internal/anchored-overlay-content.svelte.d.ts +20 -0
  40. package/dist/internal/anchored-overlay-content.svelte.js +28 -0
  41. package/dist/internal/date-family-controller.svelte.d.ts +45 -0
  42. package/dist/internal/date-family-controller.svelte.js +99 -0
  43. package/dist/internal/menu-group.svelte +15 -0
  44. package/dist/internal/menu-group.svelte.d.ts +9 -0
  45. package/dist/internal/menu-item.svelte +82 -0
  46. package/dist/internal/menu-item.svelte.d.ts +11 -0
  47. package/dist/internal/menu-label.svelte +24 -0
  48. package/dist/internal/menu-label.svelte.d.ts +9 -0
  49. package/dist/internal/menu-root-state.svelte.d.ts +24 -0
  50. package/dist/internal/menu-root-state.svelte.js +42 -0
  51. package/dist/internal/menu-separator.svelte +19 -0
  52. package/dist/internal/menu-separator.svelte.d.ts +7 -0
  53. package/dist/internal/motion.js +12 -1
  54. package/dist/internal/picker-popover-content.svelte +112 -0
  55. package/dist/internal/picker-popover-content.svelte.d.ts +16 -0
  56. package/dist/link-preview/link-preview-content.svelte +7 -10
  57. package/dist/list/list-item-icon.svelte +3 -3
  58. package/dist/list/list-item-icon.svelte.d.ts +1 -1
  59. package/dist/list/list-item-text.svelte +3 -3
  60. package/dist/list/list-item-text.svelte.d.ts +1 -1
  61. package/dist/list/list-item.svelte +58 -35
  62. package/dist/list/list-item.svelte.d.ts +8 -2
  63. package/dist/popover/popover-content.svelte +9 -11
  64. package/dist/range-calendar/range-calendar-root.svelte +13 -19
  65. package/dist/text/index.d.ts +1 -0
  66. package/dist/text/text.svelte +3 -1
  67. package/dist/text/text.svelte.d.ts +1 -0
  68. package/dist/theme-toggle/index.d.ts +18 -0
  69. package/dist/theme-toggle/index.js +3 -0
  70. package/dist/theme-toggle/theme-controller.svelte.d.ts +54 -0
  71. package/dist/theme-toggle/theme-controller.svelte.js +121 -0
  72. package/dist/theme-toggle/theme-flash.d.ts +16 -0
  73. package/dist/theme-toggle/theme-flash.js +38 -0
  74. package/dist/theme-toggle/theme-toggle.svelte +189 -0
  75. package/dist/theme-toggle/theme-toggle.svelte.d.ts +40 -0
  76. package/dist/tooltip/tooltip-content.svelte +8 -10
  77. package/dist/typography/heading.svelte +13 -89
  78. package/dist/typography/heading.svelte.d.ts +3 -8
  79. package/dist/typography/index.d.ts +8 -7
  80. package/dist/typography/text.svelte +12 -84
  81. package/dist/typography/text.svelte.d.ts +3 -10
  82. package/package.json +7 -2
  83. package/skills/dryui/SKILL.md +18 -5
  84. package/skills/dryui/rules/composition.md +1 -1
  85. package/skills/dryui/rules/theming.md +1 -2
@@ -1,97 +1,25 @@
1
1
  <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
- import type { HTMLAttributes } from 'svelte/elements';
4
- import { variantAttrs } from '@dryui/primitives';
5
-
6
- interface Props extends HTMLAttributes<HTMLElement> {
7
- as?: 'p' | 'span' | 'div';
8
- color?: 'default' | 'muted' | 'secondary';
9
- variant?: 'default' | 'muted' | 'secondary';
10
- size?: 'sm' | 'md' | 'lg';
11
- children: Snippet;
12
- }
2
+ import type { TextProps } from './index.js';
3
+ import Text from '../text/text.svelte';
13
4
 
14
5
  let {
15
6
  as = 'p',
16
7
  color,
17
8
  variant,
18
9
  size = 'md',
10
+ font = 'sans',
11
+ weight,
19
12
  class: className,
20
13
  children,
21
14
  ...rest
22
- }: Props = $props();
15
+ }: TextProps = $props();
23
16
 
24
- let tone = $derived(color ?? variant ?? 'default');
17
+ let tone: TextProps['color'] = $derived(
18
+ color ?? (variant === 'muted' || variant === 'secondary' ? variant : 'default')
19
+ );
20
+ let textVariant: 'default' | 'label' = $derived(variant === 'label' ? 'label' : 'default');
25
21
  </script>
26
22
 
27
- {#if as === 'span'}
28
- <span class={className} {...variantAttrs({ as, color: tone, size })} {...rest}
29
- >{@render children()}</span
30
- >
31
- {:else if as === 'div'}
32
- <div class={className} {...variantAttrs({ as, color: tone, size })} {...rest}>
33
- {@render children()}
34
- </div>
35
- {:else}
36
- <p class={className} {...variantAttrs({ as, color: tone, size })} {...rest}>
37
- {@render children()}
38
- </p>
39
- {/if}
40
-
41
- <style>
42
- p,
43
- span,
44
- div {
45
- margin: 0;
46
- color: var(--dry-typography-text-color, var(--dry-color-text-strong));
47
- font-family: var(--dry-font-sans);
48
- line-height: 1.7;
49
- }
50
-
51
- [data-color='muted'] {
52
- --dry-typography-text-color: var(--dry-color-text-weak);
53
- }
54
-
55
- [data-color='secondary'] {
56
- --dry-typography-text-color: var(--dry-color-text-weak);
57
- }
58
-
59
- [data-size='xs'] {
60
- font-size: var(--dry-type-xs-size);
61
- }
62
-
63
- [data-size='sm'] {
64
- font-size: var(--dry-type-ui-control-size, var(--dry-type-tiny-size, var(--dry-text-sm-size)));
65
- line-height: var(
66
- --dry-type-ui-control-leading,
67
- var(--dry-type-tiny-leading, var(--dry-text-sm-leading))
68
- );
69
- }
70
-
71
- [data-size='md'] {
72
- font-size: var(--dry-type-ui-body-size, var(--dry-type-small-size, var(--dry-text-base-size)));
73
- line-height: var(
74
- --dry-type-ui-body-leading,
75
- var(--dry-type-small-leading, var(--dry-text-base-leading))
76
- );
77
- }
78
-
79
- [data-size='lg'] {
80
- font-size: var(
81
- --dry-type-ui-title-size,
82
- var(--dry-type-heading-4-size, var(--dry-text-lg-size))
83
- );
84
- line-height: var(
85
- --dry-type-ui-title-leading,
86
- var(--dry-type-heading-4-leading, var(--dry-text-lg-leading))
87
- );
88
- }
89
-
90
- [data-as='span'] {
91
- display: inline;
92
- }
93
-
94
- [data-as='div'] {
95
- display: block;
96
- }
97
- </style>
23
+ <Text {as} color={tone} {size} {font} {weight} variant={textVariant} {className} {...rest}>
24
+ {@render children()}
25
+ </Text>
@@ -1,12 +1,5 @@
1
- import type { Snippet } from 'svelte';
2
- import type { HTMLAttributes } from 'svelte/elements';
3
- interface Props extends HTMLAttributes<HTMLElement> {
4
- as?: 'p' | 'span' | 'div';
5
- color?: 'default' | 'muted' | 'secondary';
6
- variant?: 'default' | 'muted' | 'secondary';
7
- size?: 'sm' | 'md' | 'lg';
8
- children: Snippet;
9
- }
10
- declare const Text: import("svelte").Component<Props, {}, "">;
1
+ import type { TextProps } from './index.js';
2
+ import Text from '../text/text.svelte';
3
+ declare const Text: import("svelte").Component<TextProps, {}, "">;
11
4
  type Text = ReturnType<typeof Text>;
12
5
  export default Text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dryui/ui",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "Zero-dependency styled Svelte 5 components with scoped styles and --dry-* CSS variable theming.",
5
5
  "author": "Rob Balfre",
6
6
  "license": "MIT",
@@ -680,6 +680,11 @@
680
680
  "svelte": "./dist/textarea/index.js",
681
681
  "default": "./dist/textarea/index.js"
682
682
  },
683
+ "./theme-toggle": {
684
+ "types": "./dist/theme-toggle/index.d.ts",
685
+ "svelte": "./dist/theme-toggle/index.js",
686
+ "default": "./dist/theme-toggle/index.js"
687
+ },
683
688
  "./time-input": {
684
689
  "types": "./dist/time-input/index.d.ts",
685
690
  "svelte": "./dist/time-input/index.js",
@@ -779,7 +784,7 @@
779
784
  "postpack": "bun ../../scripts/postpack-exports.ts"
780
785
  },
781
786
  "dependencies": {
782
- "@dryui/primitives": "^1.5.1"
787
+ "@dryui/primitives": "^1.6.0"
783
788
  },
784
789
  "peerDependencies": {
785
790
  "svelte": "^5.55.1"
@@ -85,6 +85,19 @@ The test: does your CSS contain zero hex colors, zero `rgb()` values, and zero i
85
85
 
86
86
  The test: grep your output for `display: flex`, `style=`, `@media` — all should return nothing.
87
87
 
88
+ ## 4A. Escape Hatches Mean Stop.
89
+
90
+ **If lint or the compiler pushes you toward an escape hatch, the structure is usually wrong.**
91
+
92
+ - Never add `:global()`, `!important`, `all: unset`, `<svelte:element>`, or `<!-- svelte-ignore ... -->` just to make a selector or warning go away
93
+ - Never add `width`, `min-width`, `max-width`, `inline-size`, `min-inline-size`, or `max-inline-size` to solve layout pressure
94
+ - Never use raw native elements outside their canonical DryUI component directories just because composition feels inconvenient
95
+ - Never pass `class=` to DryUI components expecting it to style their internals; use wrapper elements, component props, `data-*` attributes, or `--dry-*` tokens instead
96
+ - When blocked, restructure the markup instead: add a local wrapper, split explicit `{#if}` branches, move sizing to parent grid tracks, or promote the pattern into the canonical component where the raw element belongs
97
+ - Treat `dryui/no-global`, `dryui/no-important`, `dryui/no-width`, `dryui/no-raw-native-element`, `dryui/no-css-ignore`, and `dryui/no-svelte-element` as design feedback, not obstacles to suppress
98
+
99
+ The test: grep your output for `:global(`, `!important`, `all: unset`, `svelte-ignore`, `svelte:element`, raw `<button`, raw `<input`, raw `<select`, raw `<dialog`, raw `<hr`, raw `<table`, and `width:` — all should return nothing unless you are editing the canonical component that owns that native element.
100
+
88
101
  ## 5. Every Input Gets a Field.Root
89
102
 
90
103
  **Accessibility isn't optional.**
@@ -215,7 +228,7 @@ Use these to look up APIs, discover components, plan setup, and validate code.
215
228
 
216
229
  1. `dryui info <Component>` or `dryui compose "<query>"` before writing so you confirm kind, required parts, bindables, and canonical usage. If MCP is available, `ask --scope component` and `ask --scope recipe` are the equivalent surface.
217
230
  2. Build the route or component with raw CSS grid, `Container` for constrained width, and `@container` for responsive layout.
218
- 3. `dryui review`, `dryui diagnose`, or `dryui doctor` after implementation to catch composition drift, layout violations, and accessibility regressions. If MCP is available, `check` is the equivalent surface.
231
+ 3. Run `check` if DryUI MCP is available after implementation to catch composition drift, layout violations, and accessibility regressions. Without MCP, rely on the `@dryui/lint` preprocessor plus the project's normal build and test commands.
219
232
  4. Never guess component shape from memory. DryUI is intentionally strict, and the lookup cost is lower than rework.
220
233
 
221
234
  ### CLI (default entry point)
@@ -230,11 +243,11 @@ dryui info <component> # Look up component API
230
243
  dryui compose "date input" # Composition guidance
231
244
  dryui detect [path] # Check project setup
232
245
  dryui install [path] # Print install plan
233
- dryui review <file.svelte> # Validate component
234
- dryui diagnose <file.css> # Validate theme CSS
235
- dryui doctor [path] # Audit workspace
236
- dryui lint [path] # Deterministic findings
237
246
  dryui list # List components
247
+ dryui tokens --category color # Browse design tokens
248
+ dryui ambient # SessionStart context
249
+ dryui install-hook --dry-run # Preview Claude hook wiring
250
+ dryui feedback init # Feedback tooling setup
238
251
  ```
239
252
 
240
253
  Without a global install, prefix any command with `bunx @dryui/cli …` or `npx -y @dryui/cli …` — same behaviour, just slower (re-fetches on each call).
@@ -457,7 +457,7 @@ DryUI is a presentation and accessibility system, not a workflow engine. For dep
457
457
  - Normalize route/session state in script before rendering DryUI inputs.
458
458
  - Reset dependent `Select.Root` values when their parent choice changes; do not rely on stale child state surviving domain changes.
459
459
  - Use raw CSS grid to lay out planner sections, and keep orchestration logic in route-level stores or derived state.
460
- - Run `dryui info <Component>` or `dryui compose "<pattern>"` before introducing a new field shape, then run `dryui review` or `dryui doctor` after the flow is wired. If MCP is available, `ask` / `check` are equivalent.
460
+ - Run `dryui info <Component>` or `dryui compose "<pattern>"` before introducing a new field shape, then use MCP `check` if it is available after the flow is wired. Without MCP, rely on the `@dryui/lint` preprocessor plus the project's normal build and test commands.
461
461
 
462
462
  ```svelte
463
463
  <script lang="ts">
@@ -268,10 +268,9 @@ Ensure sufficient contrast between text and background.
268
268
 
269
269
  ## Validating Theme CSS
270
270
 
271
- Run `dryui diagnose <theme.css>` to catch theme issues. If MCP is available, `check <theme.css>` is equivalent:
271
+ Use `check <theme.css>` when DryUI MCP is available to catch theme issues. Without MCP, validate by rebuilding the app with `@dryui/lint` wired and checking the resulting diagnostics:
272
272
 
273
273
  ```bash
274
- dryui diagnose src/styles/global.css
275
274
  check src/styles/global.css
276
275
  ```
277
276