@tfn-design/design-system 0.4.1 → 0.4.3

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 (48) hide show
  1. package/dist/accordion/web/ds-accordion.js +2 -2
  2. package/dist/button/web/ds-button.js +1 -1
  3. package/dist/check-option/web/ds-check-option.js +1 -1
  4. package/dist/data-table/web/data-table-theme.css +32 -7
  5. package/dist/date-field/web/ds-date-field.d.ts +5 -2
  6. package/dist/date-field/web/ds-date-field.js +1 -1
  7. package/dist/date-input/web/ds-date-input.d.ts +6 -3
  8. package/dist/date-input/web/ds-date-input.js +1 -1
  9. package/dist/field-rules/field-rules.d.ts +16 -2
  10. package/dist/field-rules/field-rules.js +8 -2
  11. package/dist/form-field-group/form-field-group.d.ts +9 -0
  12. package/dist/form-field-group/form-field-group.js +1 -0
  13. package/dist/form-field-group/web/ds-form-field-group.js +2 -2
  14. package/dist/geo/geo.js +14 -1
  15. package/dist/geofence-editor/geofence-editor.d.ts +25 -0
  16. package/dist/geofence-editor/geofence-editor.js +14 -0
  17. package/dist/geofence-editor/web/ds-geofence-editor.d.ts +4 -1
  18. package/dist/geofence-editor/web/ds-geofence-editor.js +29 -12
  19. package/dist/index.d.ts +11 -11
  20. package/dist/index.js +5 -5
  21. package/dist/input/web/ds-input.js +4 -3
  22. package/dist/map/web/ds-map-names.d.ts +5 -0
  23. package/dist/map/web/ds-map-names.js +10 -0
  24. package/dist/map/web/ds-map.d.ts +4 -1
  25. package/dist/map/web/ds-map.js +5 -3
  26. package/dist/map/web/map-provider.d.ts +6 -0
  27. package/dist/number-field/native/ds-number-field.d.ts +1 -1
  28. package/dist/number-field/native/ds-number-field.js +10 -6
  29. package/dist/number-field/number-field.d.ts +28 -6
  30. package/dist/number-field/number-field.js +5 -2
  31. package/dist/number-field/web/ds-number-field.d.ts +1 -1
  32. package/dist/number-field/web/ds-number-field.js +10 -6
  33. package/dist/phone-field/phone-field.d.ts +9 -1
  34. package/dist/phone-field/phone-field.js +11 -1
  35. package/dist/phone-field/web/ds-phone-field.d.ts +2 -2
  36. package/dist/phone-field/web/ds-phone-field.js +21 -5
  37. package/dist/sheet/sheet.d.ts +9 -0
  38. package/dist/sheet/sheet.js +1 -0
  39. package/dist/sheet/web/ds-sheet.d.ts +9 -2
  40. package/dist/sheet/web/ds-sheet.js +4 -2
  41. package/dist/status-vocabularies.d.ts +11 -1
  42. package/dist/status-vocabularies.js +6 -0
  43. package/dist/tabs/tabs.d.ts +15 -8
  44. package/dist/tabs/tabs.js +13 -3
  45. package/dist/tabs/web/ds-tabs.js +6 -4
  46. package/dist/web.d.ts +2 -1
  47. package/dist/web.js +1 -0
  48. package/package.json +1 -1
@@ -2,6 +2,7 @@ export const STATUS_VOCABULARY_NAMES = [
2
2
  'vehicle',
3
3
  'driver',
4
4
  'invite',
5
+ 'invitationRow',
5
6
  'exception',
6
7
  'severity',
7
8
  'policy',
@@ -30,6 +31,11 @@ export const STATUS_VOCABULARIES = {
30
31
  { label: 'Sent', tone: 'info' },
31
32
  { label: 'Expired', tone: 'warning' },
32
33
  ],
34
+ invitationRow: [
35
+ { label: 'Sent', tone: 'info' },
36
+ { label: 'Expired', tone: 'warning' },
37
+ { label: 'Replaced', tone: 'neutral' },
38
+ ],
33
39
  exception: [
34
40
  { label: 'Open', tone: 'warning' },
35
41
  { label: 'Resolved', tone: 'success' },
@@ -8,11 +8,17 @@ export declare const TAB_REST_INK = "muted-foreground";
8
8
  /** The live tab's words and the bar under a live underline tab. One role,
9
9
  * because the bar IS the label's colour drawn as a line. */
10
10
  export declare const TAB_CURRENT_INK = "selected-foreground";
11
+ /** The live chip's fill and the word on it: the chosen segment's pair, held
12
+ * as one so a tab and a segment cannot drift apart. */
13
+ export declare const TAB_CHOSEN_FILL: "primary";
14
+ export declare const TAB_CHOSEN_INK: "primary-foreground";
11
15
  /** The ink the washes are mixed from, as percentages of it. The navigation
12
16
  * rule in `interaction.ts` holds every value here, so a tab, a toggle chip and
13
17
  * a navigation entry cannot drift apart. */
14
18
  export declare const TAB_TINT_INK = "foreground";
15
- /** The live chip's wash: the navigation rule's 8%. */
19
+ /** The navigation rule's 8% wash for where you are. No tab draws it since the
20
+ * live chip took the brand fill; the pagination, calendar and date presets
21
+ * that read it here still do. */
16
22
  export declare const TAB_CURRENT_TINT_PERCENT = 8;
17
23
  /** A resting tab's wash under a pointer: the navigation rule's 4%, lighter
18
24
  * than the live one so a hover never reads as the selection. */
@@ -26,17 +32,18 @@ export declare const TAB_SELECTED_WEIGHT = "semibold";
26
32
  /** `outlined` gives status views equal-width boxes with a selected edge and no wash. */
27
33
  export declare const TAB_APPEARANCES: readonly ["chip", "underline", "outlined"];
28
34
  export type TabAppearance = (typeof TAB_APPEARANCES)[number];
29
- export type TabInkRole = typeof TAB_REST_INK | typeof TAB_CURRENT_INK;
35
+ export type TabInkRole = typeof TAB_REST_INK | typeof TAB_CURRENT_INK | typeof TAB_CHOSEN_INK;
30
36
  export interface TabResolvedSpec {
31
37
  ink: TabInkRole;
32
- /** The chip's edge, selected ink on a live outlined tab. `undefined` on `underline`,
33
- * which draws no box: absent rather than a "transparent" member, so an
34
- * adapter cannot paint one by forgetting to check. */
35
- border?: typeof TAB_BORDER | typeof TAB_CURRENT_INK;
38
+ /** The chip's edge: selected ink on a live outlined tab, the fill's own
39
+ * colour on a live chip. `undefined` on `underline`, which draws no box:
40
+ * absent rather than a "transparent" member, so an adapter cannot paint one
41
+ * by forgetting to check. */
42
+ border?: typeof TAB_BORDER | typeof TAB_CURRENT_INK | typeof TAB_CHOSEN_FILL;
36
43
  /** The bar under the live tab on `underline`. `undefined` everywhere else. */
37
44
  marker?: typeof TAB_CURRENT_INK;
38
- /** The live chip's wash, as a percent of `TAB_TINT_INK`. */
39
- tint?: typeof TAB_CURRENT_TINT_PERCENT;
45
+ /** The live chip's fill. `undefined` everywhere else. */
46
+ fill?: typeof TAB_CHOSEN_FILL;
40
47
  /** A resting tab's wash under a pointer, as a percent of `TAB_TINT_INK`.
41
48
  * `undefined` on the live tab, which does not answer a hover. */
42
49
  hoverTint?: typeof TAB_HOVER_TINT_PERCENT;
package/dist/tabs/tabs.js CHANGED
@@ -1,7 +1,10 @@
1
1
  import { NAV_CURRENT_INK, NAV_CURRENT_TINT_PERCENT, NAV_HOVER_TINT_PERCENT, NAV_REST_INK, NAV_TINT_INK, } from '../interaction';
2
+ import { SEGMENTED_SELECTED_FILL, SEGMENTED_SELECTED_INK } from '../segmented-control/segmented-control';
2
3
  export const TAB_BORDER = 'input';
3
4
  export const TAB_REST_INK = NAV_REST_INK;
4
5
  export const TAB_CURRENT_INK = NAV_CURRENT_INK;
6
+ export const TAB_CHOSEN_FILL = SEGMENTED_SELECTED_FILL;
7
+ export const TAB_CHOSEN_INK = SEGMENTED_SELECTED_INK;
5
8
  export const TAB_TINT_INK = NAV_TINT_INK;
6
9
  export const TAB_CURRENT_TINT_PERCENT = NAV_CURRENT_TINT_PERCENT;
7
10
  export const TAB_HOVER_TINT_PERCENT = NAV_HOVER_TINT_PERCENT;
@@ -17,13 +20,20 @@ export function tabSpec(selected, appearance = 'chip') {
17
20
  countTakesInk: selected,
18
21
  };
19
22
  }
23
+ if (appearance === 'chip' && selected) {
24
+ return {
25
+ ink: TAB_CHOSEN_INK,
26
+ border: TAB_CHOSEN_FILL,
27
+ fill: TAB_CHOSEN_FILL,
28
+ emphasised: true,
29
+ countTakesInk: true,
30
+ };
31
+ }
20
32
  const shape = appearance === 'underline'
21
33
  ? selected
22
34
  ? { marker: TAB_CURRENT_INK }
23
35
  : {}
24
- : selected
25
- ? { border: TAB_BORDER, tint: TAB_CURRENT_TINT_PERCENT }
26
- : { border: TAB_BORDER };
36
+ : { border: TAB_BORDER };
27
37
  return {
28
38
  ink: selected ? TAB_CURRENT_INK : TAB_REST_INK,
29
39
  ...shape,
@@ -6,16 +6,18 @@ import { cn } from '../../lib/cn';
6
6
  const INK = {
7
7
  'muted-foreground': 'text-muted-foreground',
8
8
  'selected-foreground': 'text-selected-foreground',
9
+ 'primary-foreground': 'text-primary-foreground',
9
10
  };
10
11
  const BORDER = {
11
12
  input: 'border-input',
12
13
  'selected-foreground': 'border-selected-foreground',
14
+ primary: 'border-primary',
13
15
  };
14
16
  const MARKER = {
15
17
  'selected-foreground': 'border-selected-foreground',
16
18
  };
17
- const TINT = {
18
- 8: 'bg-foreground/8',
19
+ const FILL = {
20
+ primary: 'bg-primary',
19
21
  };
20
22
  const HOVER_TINT = {
21
23
  4: 'hover:bg-foreground/4 hover:text-foreground',
@@ -77,14 +79,14 @@ export function DSTabs({ items, selectedIndex, onSelectedIndexChange, panelId, i
77
79
  const disabled = item.disabled === true && !selected;
78
80
  return (_jsx("button", { ref: (node) => {
79
81
  tabRefs.current[index] = node;
80
- }, type: "button", role: "tab", id: tabDomId(prefix, index), "aria-selected": selected, ...(panelId === undefined ? {} : { 'aria-controls': panelId }), tabIndex: selected ? 0 : -1, disabled: disabled, onClick: () => {
82
+ }, type: "button", role: "tab", id: tabDomId(prefix, index), "aria-selected": selected, "data-tab-appearance": appearance, ...(panelId === undefined ? {} : { 'aria-controls': panelId }), tabIndex: selected ? 0 : -1, disabled: disabled, onClick: () => {
81
83
  wantsFocus.current = null;
82
84
  onSelectedIndexChange(index);
83
85
  }, className: cn('inline-flex min-h-touch min-w-touch shrink-0 items-center whitespace-nowrap text-body-sm compact:min-h-dense-pick compact:min-w-8', underlined ? 'tab-underline' : 'tab-chip', 'cursor-pointer transition-control', 'state-layer-press', 'focusable', INK[spec.ink], spec.hoverTint === undefined || disabled
84
86
  ? undefined
85
87
  : underlined
86
88
  ? UNDERLINE_HOVER
87
- : HOVER_TINT[spec.hoverTint], spec.tint === undefined ? undefined : TINT[spec.tint], underlined
89
+ : HOVER_TINT[spec.hoverTint], spec.fill === undefined ? undefined : FILL[spec.fill], underlined
88
90
  ?
89
91
  'rounded-none border-b-2 border-transparent px-2'
90
92
  : 'rounded-control border px-3', appearance === 'outlined' && 'min-w-32 flex-1', spec.border === undefined ? undefined : BORDER[spec.border], spec.marker === undefined ? undefined : MARKER[spec.marker], spec.emphasised && 'font-semibold', disabled && 'cursor-not-allowed text-disabled-foreground', disabled && !underlined && 'border-disabled-border'), children: _jsxs("span", { className: "inline-flex items-center gap-2", children: [item.icon !== undefined && (_jsx("span", { "aria-hidden": true, className: "inline-flex size-4 shrink-0 items-center justify-center", children: item.icon })), item.label, _jsx(DSCountBadge, { count: item.count, "data-tab-count": "", className: spec.countTakesInk ? 'text-current' : undefined })] }) }, index));
package/dist/web.d.ts CHANGED
@@ -196,7 +196,7 @@ export * from './index';
196
196
  export { DSSetupGuide } from './setup-guide/web/ds-setup-guide';
197
197
  export type { DSSetupGuideProps } from './setup-guide/web/ds-setup-guide';
198
198
  export { DSAccountSwitcher } from './account-switcher/web/ds-account-switcher';
199
- export type { DSAccountSwitcherProps } from './account-switcher/web/ds-account-switcher';
199
+ export type { DSAccountSwitcherGroupView, DSAccountSwitcherProps, } from './account-switcher/web/ds-account-switcher';
200
200
  export { DSEnvironmentBanner } from './environment-banner/web/ds-environment-banner';
201
201
  export type { DSEnvironmentBannerProps } from './environment-banner/web/ds-environment-banner';
202
202
  export { DSCopyField } from './copy-field/web/ds-copy-field';
@@ -301,6 +301,7 @@ export type { DSMapProps } from './map/web/ds-map';
301
301
  export { DSMapPopup } from './map/web/ds-map-popup';
302
302
  export type { DSMapPopupProps } from './map/web/ds-map-popup';
303
303
  export { DSMapFence } from './map/web/ds-map-fence';
304
+ export { DSMapNames } from './map/web/ds-map-names';
304
305
  export type { DSMapFenceProps } from './map/web/ds-map-fence';
305
306
  export { MapProvider, useMapView, useMapEngine } from './map/web/map-provider';
306
307
  export type { MapEngine, MapEngineProps, MapEngineConfig, MapView } from './map/web/map-provider';
package/dist/web.js CHANGED
@@ -150,6 +150,7 @@ export { DSTimeField } from './time-field/web/ds-time-field';
150
150
  export { DSMap } from './map/web/ds-map';
151
151
  export { DSMapPopup } from './map/web/ds-map-popup';
152
152
  export { DSMapFence } from './map/web/ds-map-fence';
153
+ export { DSMapNames } from './map/web/ds-map-names';
153
154
  export { MapProvider, useMapView, useMapEngine } from './map/web/map-provider';
154
155
  export { DSMapMarker, DSMapMarkerSwatch } from './map-marker/web/ds-map-marker';
155
156
  export { DSGeofenceEditor } from './geofence-editor/web/ds-geofence-editor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tfn-design/design-system",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",