@frontile/theme 0.18.0-beta.3 → 0.18.0-beta.5

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.
@@ -0,0 +1,161 @@
1
+ import type { VariantProps } from 'tailwind-variants';
2
+ /**
3
+ * The separator is rendered *inside* each `<li>` and hidden on the last one
4
+ * with `group-last/item:hidden` (the `<li>` carries `group/item`), so neither
5
+ * authoring form has to know which crumb is last.
6
+ */
7
+ declare const breadcrumbs: import("tailwind-variants").TVReturnType<{
8
+ size: {
9
+ sm: {
10
+ list: string;
11
+ item: string;
12
+ separator: string;
13
+ ellipsis: string;
14
+ };
15
+ md: {
16
+ list: string;
17
+ item: string;
18
+ separator: string;
19
+ ellipsis: string;
20
+ };
21
+ lg: {
22
+ list: string;
23
+ item: string;
24
+ separator: string;
25
+ ellipsis: string;
26
+ };
27
+ };
28
+ color: {
29
+ neutral: {
30
+ link: string;
31
+ };
32
+ primary: {
33
+ link: string;
34
+ };
35
+ danger: {
36
+ link: string;
37
+ };
38
+ };
39
+ underline: {
40
+ always: {
41
+ link: string;
42
+ };
43
+ hover: {
44
+ link: string;
45
+ };
46
+ none: {
47
+ link: string;
48
+ };
49
+ };
50
+ }, {
51
+ base: string;
52
+ list: string;
53
+ item: string;
54
+ link: string[];
55
+ separator: string;
56
+ ellipsis: string;
57
+ }, undefined, {
58
+ size: {
59
+ sm: {
60
+ list: string;
61
+ item: string;
62
+ separator: string;
63
+ ellipsis: string;
64
+ };
65
+ md: {
66
+ list: string;
67
+ item: string;
68
+ separator: string;
69
+ ellipsis: string;
70
+ };
71
+ lg: {
72
+ list: string;
73
+ item: string;
74
+ separator: string;
75
+ ellipsis: string;
76
+ };
77
+ };
78
+ color: {
79
+ neutral: {
80
+ link: string;
81
+ };
82
+ primary: {
83
+ link: string;
84
+ };
85
+ danger: {
86
+ link: string;
87
+ };
88
+ };
89
+ underline: {
90
+ always: {
91
+ link: string;
92
+ };
93
+ hover: {
94
+ link: string;
95
+ };
96
+ none: {
97
+ link: string;
98
+ };
99
+ };
100
+ }, {
101
+ base: string;
102
+ list: string;
103
+ item: string;
104
+ link: string[];
105
+ separator: string;
106
+ ellipsis: string;
107
+ }, import("tailwind-variants").TVReturnTypeLike<{
108
+ size: {
109
+ sm: {
110
+ list: string;
111
+ item: string;
112
+ separator: string;
113
+ ellipsis: string;
114
+ };
115
+ md: {
116
+ list: string;
117
+ item: string;
118
+ separator: string;
119
+ ellipsis: string;
120
+ };
121
+ lg: {
122
+ list: string;
123
+ item: string;
124
+ separator: string;
125
+ ellipsis: string;
126
+ };
127
+ };
128
+ color: {
129
+ neutral: {
130
+ link: string;
131
+ };
132
+ primary: {
133
+ link: string;
134
+ };
135
+ danger: {
136
+ link: string;
137
+ };
138
+ };
139
+ underline: {
140
+ always: {
141
+ link: string;
142
+ };
143
+ hover: {
144
+ link: string;
145
+ };
146
+ none: {
147
+ link: string;
148
+ };
149
+ };
150
+ }, {
151
+ base: string;
152
+ list: string;
153
+ item: string;
154
+ link: string[];
155
+ separator: string;
156
+ ellipsis: string;
157
+ }>>;
158
+ export type BreadcrumbsVariants = VariantProps<typeof breadcrumbs>;
159
+ export type BreadcrumbsSlots = keyof ReturnType<typeof breadcrumbs>;
160
+ export { breadcrumbs };
161
+ //# sourceMappingURL=breadcrumbs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/components/breadcrumbs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;GAIG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGf,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AACnE,MAAM,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from './alert';
2
2
  export * from './avatar';
3
+ export * from './breadcrumbs';
3
4
  export * from './button';
4
5
  export * from './chip';
5
6
  export * from './progress-bar';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAE1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AAEpC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,c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C"}
1
+ {"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../src/components/segmented-control.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+LpB,CAAC;AAEH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,MAAM,MAAM,qBAAqB,GAAG,MAAM,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
package/dist/colors.js CHANGED
@@ -1,3 +1,3 @@
1
- export { b as blue, g as getContrastingColor, a as gray, c as green, o as orange, p as pink, r as red, s as semanticColors, d as swapColorValues, t as teal, v as violet, y as yellow } from './util-Dp_dlOPq.js';
1
+ export { b as blue, g as getContrastingColor, a as gray, c as green, o as orange, p as pink, r as red, s as semanticColors, d as swapColorValues, t as teal, v as violet, y as yellow } from './util-PU966Q_x.js';
2
2
  export { parse, wcagContrast } from 'culori';
3
3
  //# sourceMappingURL=colors.js.map
package/dist/index.js CHANGED
@@ -351,6 +351,103 @@ const avatar = tv({
351
351
  }
352
352
  });
353
353
 
354
+ /**
355
+ * The separator is rendered *inside* each `<li>` and hidden on the last one
356
+ * with `group-last/item:hidden` (the `<li>` carries `group/item`), so neither
357
+ * authoring form has to know which crumb is last.
358
+ */
359
+ const breadcrumbs = tv({
360
+ slots: {
361
+ // Layout only. The nav landmark carries no ink of its own; every colour
362
+ // decision belongs to `link` so the two stay in one place.
363
+ base: '',
364
+ // `flex-wrap`, so a long trail wraps onto a second line rather than
365
+ // overflowing its container. Breadcrumbs have no horizontal-scroll
366
+ // affordance, so overflow would simply hide the current page.
367
+ list: 'flex flex-wrap items-center',
368
+ item: 'group/item inline-flex items-center',
369
+ link: [...focusVisibleRing, 'inline-flex items-center gap-1 rounded-sm',
370
+ // `firm`, not `DEFAULT`: as ink on the light surface `neutral` is 3.13:1,
371
+ // under WCAG AA. `pagination.ts` uses `firm` for the same job.
372
+ 'text-neutral-firm', 'transition-colors duration-200', 'motion-reduce:transition-none',
373
+ // The current crumb is the only weight change in the trail: colour alone
374
+ // is not a sufficient distinction, and it is the one crumb a reader
375
+ // scans for.
376
+ 'data-[current=true]:font-medium', 'aria-disabled:cursor-not-allowed aria-disabled:opacity-disabled aria-disabled:pointer-events-none'],
377
+ // The crumb's own ink, deliberately: receding a separator with colour costs
378
+ // more contrast than it buys -- `neutral` lands at 2.95:1 on a gray-50
379
+ // canvas. A thin chevron already reads lighter than a word beside it.
380
+ separator: 'shrink-0 text-neutral-firm group-last/item:hidden',
381
+ // The crumbs' weight, since it stands in for crumbs, but no focus ring and
382
+ // no hover: it is a gap marker, and an affordance would promise a
383
+ // destination it does not have.
384
+ ellipsis: 'inline-flex shrink-0 items-center justify-center select-none text-neutral-firm'
385
+ },
386
+ variants: {
387
+ // Written as whole literal class strings rather than composed from parts --
388
+ // Tailwind generates nothing from an interpolated class, so the scanner has
389
+ // to see each one intact.
390
+ size: {
391
+ sm: {
392
+ list: 'gap-1 text-body-xs',
393
+ item: 'gap-1',
394
+ separator: '[&_svg]:size-3.5',
395
+ ellipsis: 'text-body-xs'
396
+ },
397
+ md: {
398
+ list: 'gap-1.5 text-body-sm',
399
+ item: 'gap-1.5',
400
+ separator: '[&_svg]:size-4',
401
+ ellipsis: 'text-body-sm'
402
+ },
403
+ lg: {
404
+ list: 'gap-2 text-body-md',
405
+ item: 'gap-2',
406
+ separator: '[&_svg]:size-5',
407
+ ellipsis: 'text-body-md'
408
+ }
409
+ },
410
+ // Hover and current share one ink, so the row reads as a single control.
411
+ //
412
+ // Three categories, not the usual seven: the other four are fill colours,
413
+ // meant to carry `text-on-*` on top of them the way `pagination.ts` uses
414
+ // them. As ink they fail at every level -- `success` tops out at 2.30:1.
415
+ color: {
416
+ neutral: {
417
+ link: 'hover:text-neutral-strong data-[current=true]:text-neutral-strong'
418
+ },
419
+ primary: {
420
+ link: 'hover:text-primary-firm data-[current=true]:text-primary-firm'
421
+ },
422
+ danger: {
423
+ link: 'hover:text-danger-firm data-[current=true]:text-danger-firm'
424
+ }
425
+ },
426
+ // The current crumb is never underlined in any mode: it is the page you
427
+ // are on, and underlining it would advertise a navigation that does
428
+ // nothing.
429
+ underline: {
430
+ always: {
431
+ link: 'underline underline-offset-2 data-[current=true]:no-underline'
432
+ },
433
+ hover: {
434
+ link: 'no-underline underline-offset-2 hover:underline data-[current=true]:hover:no-underline'
435
+ },
436
+ none: {
437
+ link: 'no-underline hover:no-underline'
438
+ }
439
+ }
440
+ },
441
+ defaultVariants: {
442
+ size: 'md',
443
+ color: 'neutral',
444
+ // Not `ExternalLink`'s `always`: breadcrumbs sit in their own nav row where
445
+ // the layout already marks them as links, whereas an external link lives in
446
+ // running text and has to announce itself.
447
+ underline: 'hover'
448
+ }
449
+ });
450
+
354
451
  const baseButton = tv({
355
452
  base: ['inline-flex items-center justify-center', '[&_svg]:size-[1em]', 'font-header', 'border', 'border-transparent', 'disabled:cursor-not-allowed', 'disabled:opacity-disabled', ...focusVisibleRing],
356
453
  variants: {
@@ -2220,10 +2317,13 @@ const segmentedControl = tv({
2220
2317
  hasSeparators: {
2221
2318
  true: {
2222
2319
  item: [
2223
- // A hairline before every item except the first. The level differs
2224
- // per mode: neither the neutral scale nor the track is symmetric
2225
- // across them, so one level cannot read on both.
2226
- 'before:absolute before:content-[""]', 'before:bg-neutral-mild dark:before:bg-neutral-soft', 'before:transition-opacity before:duration-200', 'motion-reduce:before:transition-none',
2320
+ // A hairline before every item except the first. `divider` is the
2321
+ // token for rules, and it is translucent -- ink over whatever track
2322
+ // is behind it -- so one value reads on both modes. The opaque
2323
+ // neutral levels this used to carry could not: neither the neutral
2324
+ // scale nor the track is symmetric across modes, which is why it
2325
+ // needed a `dark:` override at all.
2326
+ 'before:absolute before:content-[""]', 'before:bg-divider', 'before:transition-opacity before:duration-200', 'motion-reduce:before:transition-none',
2227
2327
  // The indicator's `<span>` is the container's true first child, so
2228
2328
  // `first:` would never match an item; `first-of-type:` does.
2229
2329
  'first-of-type:before:content-none',
@@ -2437,7 +2537,7 @@ const tabs = tv({
2437
2537
  // bar stays welded to the rule at `bottom-0` while the padding pushes
2438
2538
  // the tabs -- and with them their hover chips -- clear of it. A chip
2439
2539
  // that runs into the rule is the thing this buys off.
2440
- list: 'gap-1 pb-2 border-b border-neutral-mild dark:border-neutral-soft',
2540
+ list: 'gap-1 pb-2 border-b border-divider',
2441
2541
  indicator: ['top-auto bottom-0 h-0.5 rounded-full', 'w-[var(--fr-si-width)]', 'translate-x-[var(--fr-si-x)]']
2442
2542
  }
2443
2543
  }, {
@@ -2445,7 +2545,7 @@ const tabs = tv({
2445
2545
  orientation: 'vertical',
2446
2546
  class: {
2447
2547
  // The same gap, on the axis this orientation puts the rule on.
2448
- list: 'gap-1 ps-2 border-l border-neutral-mild dark:border-neutral-soft',
2548
+ list: 'gap-1 ps-2 border-l border-divider',
2449
2549
  indicator: ['left-0 w-0.5 rounded-full', 'h-[var(--fr-si-height)]', 'translate-y-[var(--fr-si-y)]']
2450
2550
  }
2451
2551
  }],
@@ -3960,6 +4060,7 @@ var components = /*#__PURE__*/Object.freeze({
3960
4060
  autocomplete: autocomplete,
3961
4061
  avatar: avatar,
3962
4062
  backdrop: backdrop,
4063
+ breadcrumbs: breadcrumbs,
3963
4064
  button: button,
3964
4065
  buttonGroup: buttonGroup,
3965
4066
  buttonSpinner: buttonSpinner,