@signal9/era-ui 23.1.1 → 23.3.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 (32) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/ai/index.d.ts +2 -0
  3. package/dist/ai/index.js +2 -0
  4. package/dist/ai/timeline/context.svelte.d.ts +67 -0
  5. package/dist/ai/timeline/context.svelte.js +99 -0
  6. package/dist/ai/timeline/index.d.ts +3 -0
  7. package/dist/ai/timeline/index.js +3 -0
  8. package/dist/ai/timeline/timeline-step.svelte +98 -0
  9. package/dist/ai/timeline/timeline-step.svelte.d.ts +9 -0
  10. package/dist/ai/timeline/timeline.svelte +84 -0
  11. package/dist/ai/timeline/timeline.svelte.d.ts +13 -0
  12. package/dist/ai/todo/context.svelte.d.ts +43 -0
  13. package/dist/ai/todo/context.svelte.js +53 -0
  14. package/dist/ai/todo/index.d.ts +5 -0
  15. package/dist/ai/todo/index.js +5 -0
  16. package/dist/ai/todo/todo-header.svelte +56 -0
  17. package/dist/ai/todo/todo-header.svelte.d.ts +9 -0
  18. package/dist/ai/todo/todo-item.svelte +97 -0
  19. package/dist/ai/todo/todo-item.svelte.d.ts +10 -0
  20. package/dist/ai/todo/todo-list.svelte +40 -0
  21. package/dist/ai/todo/todo-list.svelte.d.ts +10 -0
  22. package/dist/ai/todo/todo.svelte +49 -0
  23. package/dist/ai/todo/todo.svelte.d.ts +12 -0
  24. package/dist/era-ui.css +1 -1
  25. package/dist/ui/toggle-group/context.svelte.d.ts +28 -0
  26. package/dist/ui/toggle-group/context.svelte.js +9 -0
  27. package/dist/ui/toggle-group/index.d.ts +1 -0
  28. package/dist/ui/toggle-group/toggle-group-item.svelte +34 -4
  29. package/dist/ui/toggle-group/toggle-group-item.svelte.d.ts +16 -0
  30. package/dist/ui/toggle-group/toggle-group-root.svelte +42 -2
  31. package/dist/ui/toggle-group/toggle-group-root.svelte.d.ts +21 -1
  32. package/package.json +1 -1
@@ -1,17 +1,47 @@
1
+ <script lang="ts" module>
2
+ import { tv } from '../../utils/index.js';
3
+
4
+ export const toggleGroupItemVariants = tv({
5
+ // not-has-[svg]: the same guard Button carries. A TEXT-only option holds
6
+ // nothing but a label, so it has no reason to be a flex row — and as one,
7
+ // its text is an anonymous flex item that text-box-trim can never reach,
8
+ // which is the audit's fixable case. As a block with era-label-ink the ink
9
+ // is centred by its typographic band instead of by font metrics.
10
+ // text-center because blockifying drops the horizontal centring
11
+ // justify-center was doing. An option holding an ICON keeps the flex row,
12
+ // because that pair still needs laying out.
13
+ base: 'inline-flex items-center justify-center text-body text-fg era-interactive not-has-[svg]:era-label-ink not-has-[svg]:text-center hover:bg-highlight focus:outline-none disabled:opacity-50 data-[state=on]:bg-fill data-[state=on]:text-bright data-[state=on]:shadow-pressed data-[state=on]:hover:shadow-pressed',
14
+ variants: {
15
+ variant: {
16
+ plain:
17
+ 'h-control min-w-control rounded-control px-inset-control shadow-sm hover:shadow-highlight active:shadow-pressed',
18
+ segmented: 'h-chip min-w-chip rounded-chip px-inset-chip'
19
+ }
20
+ },
21
+ defaultVariants: { variant: 'plain' }
22
+ });
23
+ </script>
24
+
1
25
  <script lang="ts">
2
26
  import { ToggleGroup } from 'bits-ui';
3
27
  import { cn } from '../../utils/index.js';
28
+ import { getToggleGroupVariant } from './context.svelte.js';
4
29
 
5
30
  // Pattern A pass-through: bits-ui's typed children snippet flows through
6
31
  // restProps untouched.
7
32
  let { ref = $bindable(null), class: className, ...restProps }: ToggleGroup.ItemProps = $props();
33
+
34
+ const variant = getToggleGroupVariant();
8
35
  </script>
9
36
 
37
+ <!--
38
+ An option takes its tier from the GROUP, because that is what it has to nest
39
+ concentrically inside: control tier standing alone, one rung down to chip
40
+ inside a segmented well. The latched face is the same in both — bg-fill and
41
+ the pressed shadow, held on hover so it does not spring back up on bevel.
42
+ -->
10
43
  <ToggleGroup.Item
11
44
  bind:ref
12
- class={cn(
13
- 'inline-flex h-control min-w-control items-center justify-center rounded-control px-inset-control text-body text-fg shadow-sm hover:bg-highlight hover:shadow-highlight focus:outline-none active:shadow-pressed disabled:opacity-50 data-[state=on]:bg-fill data-[state=on]:text-bright data-[state=on]:shadow-pressed',
14
- className
15
- )}
45
+ class={cn(toggleGroupItemVariants({ variant: variant() }), className)}
16
46
  {...restProps}
17
47
  />
@@ -1,3 +1,19 @@
1
+ export declare const toggleGroupItemVariants: import("tailwind-variants").TVReturnType<{
2
+ variant: {
3
+ plain: "h-control min-w-control rounded-control px-inset-control shadow-sm hover:shadow-highlight active:shadow-pressed";
4
+ segmented: "h-chip min-w-chip rounded-chip px-inset-chip";
5
+ };
6
+ }, undefined, "inline-flex items-center justify-center text-body text-fg era-interactive not-has-[svg]:era-label-ink not-has-[svg]:text-center hover:bg-highlight focus:outline-none disabled:opacity-50 data-[state=on]:bg-fill data-[state=on]:text-bright data-[state=on]:shadow-pressed data-[state=on]:hover:shadow-pressed", {
7
+ variant: {
8
+ plain: "h-control min-w-control rounded-control px-inset-control shadow-sm hover:shadow-highlight active:shadow-pressed";
9
+ segmented: "h-chip min-w-chip rounded-chip px-inset-chip";
10
+ };
11
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
12
+ variant: {
13
+ plain: "h-control min-w-control rounded-control px-inset-control shadow-sm hover:shadow-highlight active:shadow-pressed";
14
+ segmented: "h-chip min-w-chip rounded-chip px-inset-chip";
15
+ };
16
+ }, undefined>>;
1
17
  import { ToggleGroup } from 'bits-ui';
2
18
  declare const ToggleGroupItem: import("svelte").Component<ToggleGroup.ItemProps, {}, "ref">;
3
19
  type ToggleGroupItem = ReturnType<typeof ToggleGroupItem>;
@@ -1,18 +1,58 @@
1
+ <script lang="ts" module>
2
+ import { tv } from '../../utils/index.js';
3
+
4
+ // tv(), not a ternary in the markup. era declares its variants here by
5
+ // convention, and check:specimen-coverage reads exactly this block to prove
6
+ // the board renders every axis — an axis expressed as an inline ternary is
7
+ // invisible to it, so the gate would have passed while measuring one of two.
8
+ export const toggleGroupVariants = tv({
9
+ base: 'inline-flex items-center',
10
+ variants: {
11
+ variant: {
12
+ plain: 'gap-gutter',
13
+ segmented:
14
+ 'h-control gap-chip-inset-control rounded-control bg-field p-chip-inset-control shadow-well'
15
+ }
16
+ },
17
+ defaultVariants: { variant: 'plain' }
18
+ });
19
+ </script>
20
+
1
21
  <script lang="ts">
2
22
  import { ToggleGroup } from 'bits-ui';
3
23
  import { cn, type PartProps } from '../../utils/index.js';
24
+ import { setToggleGroupVariant, type ToggleGroupVariant } from './context.svelte.js';
4
25
 
5
26
  let {
6
27
  ref = $bindable(null),
28
+ variant = 'plain',
7
29
  children,
8
30
  class: className,
9
31
  ...restProps
10
- }: PartProps<ToggleGroup.RootProps> = $props();
32
+ }: PartProps<ToggleGroup.RootProps> & { variant?: ToggleGroupVariant } = $props();
33
+
34
+ setToggleGroupVariant(() => variant);
11
35
  </script>
12
36
 
37
+ <!--
38
+ THE SEGMENTED WELL IS THE LADDER, not a new set of numbers.
39
+
40
+ The group is a control-tier box; its options are one rung down at chip; and
41
+ the wall between them is chip-inset-control — (h-control − h-chip)/2, the same
42
+ 1/2/3 that centres any chip in any control. Because the gap between options
43
+ uses that same token, the wall and the gap are one number, which is the
44
+ even-gap law holding with nothing restated: rd-control − rd-chip is also
45
+ chip-inset-control, so the options' corners are concentric with the well's
46
+ for free.
47
+
48
+ bg-field, not bg-well: this is the tier a control's CONTENT sits in — the
49
+ same fill an Input uses — and it is the one that stays visible on flat, where
50
+ shadow-well resolves to none and a fill is the only edge there is.
51
+ -->
13
52
  <ToggleGroup.Root
14
53
  bind:ref
15
- class={cn('inline-flex items-center gap-gutter', className)}
54
+ data-variant={variant}
55
+ class={cn(toggleGroupVariants({ variant }), className)}
16
56
  {...restProps}
17
57
  >
18
58
  {@render children?.()}
@@ -1,5 +1,25 @@
1
+ export declare const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
2
+ variant: {
3
+ plain: "gap-gutter";
4
+ segmented: "h-control gap-chip-inset-control rounded-control bg-field p-chip-inset-control shadow-well";
5
+ };
6
+ }, undefined, "inline-flex items-center", {
7
+ variant: {
8
+ plain: "gap-gutter";
9
+ segmented: "h-control gap-chip-inset-control rounded-control bg-field p-chip-inset-control shadow-well";
10
+ };
11
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
12
+ variant: {
13
+ plain: "gap-gutter";
14
+ segmented: "h-control gap-chip-inset-control rounded-control bg-field p-chip-inset-control shadow-well";
15
+ };
16
+ }, undefined>>;
1
17
  import { ToggleGroup } from 'bits-ui';
2
18
  import { type PartProps } from '../../utils/index.js';
3
- declare const ToggleGroupRoot: import("svelte").Component<PartProps<ToggleGroup.RootProps>, {}, "ref">;
19
+ import { type ToggleGroupVariant } from './context.svelte.js';
20
+ type $$ComponentProps = PartProps<ToggleGroup.RootProps> & {
21
+ variant?: ToggleGroupVariant;
22
+ };
23
+ declare const ToggleGroupRoot: import("svelte").Component<$$ComponentProps, {}, "ref">;
4
24
  type ToggleGroupRoot = ReturnType<typeof ToggleGroupRoot>;
5
25
  export default ToggleGroupRoot;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signal9/era-ui",
3
- "version": "23.1.1",
3
+ "version": "23.3.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev --host",
6
6
  "build": "vite build && npm run prepack",