tandd-ui 0.2.4 → 0.2.7

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.7 (2026-11-29)
4
+
5
+ ### Added
6
+
7
+ - **DTListGroup:** a collapsible group in a `DTList`, for submenus in a navigation drawer. The header is a button that opens and closes a nested list of `DTListItem` rows; groups nest. A group holding the current page opens on load and colours its header. Props: `title`, `subtitle`, `prepend-icon`, `v-model:open`, `disabled`; slots `default`, `prepend`, `title`. Closed rows are hidden and skipped by Tab and screen readers. Its chevron turns like DTAccordion's.
8
+ - **DTNavigationDrawer submenus:** a `DTListGroup` header spans the row; in the collapsed rail only its icon shows, filled while it holds the current page. The hover and current-row fills follow the rows while a group opens or closes, and move to a closed group's header when the current page is inside it.
9
+
10
+ ### Changed
11
+
12
+ - **tandd-icon 1.1.0** (was 0.2.0). No icon was removed or redrawn; the new version adds hold and loop play modes.
13
+
14
+
15
+ Also the first npm release of the 0.2.5 changes below (0.2.5 was tagged but not published).
16
+
17
+ ### Added
18
+
19
+ - **DTToast `variant: "raised"`:** a 3D tone card with a lit gradient, the tone mark in a raised tile, soft circles, and a round dismiss button, in fixed design colours in light and dark themes. White text on the lighter side of the success and warning cards is below the 4.5:1 AA contrast ratio (down to about 2.6:1); use another variant where that matters.
20
+ - **DTToast `size`:** `sm`, `md` (default), or `lg`, on every variant. It scales padding, text, the icon, and the dismiss button; a `promise()` loading toast passes it to its result. `DTToastSize` is exported.
21
+ - **DTNavigationDrawer `glide`** (default `true`): one shared hover fill slides from row to row under the pointer, and the current row's fill slides to the new current row after a click or route change. Both are off under reduced motion and hidden in forced colors; `false` tints rows in place.
22
+ - **DTNavigationDrawer `railZoom`** (default `true`): in a rail without `expand-on-hover`, the hovered row's icon grows smoothly to 1.4×. Neighbours and the list's padding never zoom; mouse and pen only, off under reduced motion.
23
+ - **DTDateInput `format` and DTDateTimeInput `dateFormat`:** also take a token pattern (`YYYY YY MM M DD D`, `[literal]`) that sets the display, the order typed dates are read in, and the placeholder, whatever the locale. The model value stays ISO.
24
+
25
+ ### Fixed
26
+
27
+ - **DTNavigationDrawer:** the hover and current-row fills keep their place and size when an ancestor is zoomed or scaled.
28
+
29
+ ### Docs
30
+
31
+ - **Sign in example:** five login designs (clean and minimal, dark modern, with illustration, split screen, glass).
32
+
33
+ ## 0.2.5 (2026-11-17)
34
+
35
+ ### Fixed
36
+
37
+ - **DTSelect and DTTreeSelect error focus:** a field in the error state showed no change on focus, since its border is already red. Focus now thickens the red border inside the field (no outer ring), as DTInput does.
38
+
39
+ ### Changed
40
+
41
+ - **DTTreeSelect tree items:** a focused item in the panel shows a fill instead of the outline ring, like a DTSelect option. A selected item deepens its tint. Forced colors keep a `Highlight` outline.
42
+
3
43
  ## 0.2.4 (2026-11-17)
4
44
 
5
45
  ### Changed
@@ -14,8 +14,12 @@ interface DTDateInputProps extends Omit<DTTextFieldBaseProps, "modelValue" | "pr
14
14
  locale?: string;
15
15
  showAdjacentMonths?: boolean;
16
16
  showWeekNumbers?: boolean;
17
- /** How the date is shown in the field (Intl.DateTimeFormat options). Default: numeric day, month, year. */
18
- format?: Intl.DateTimeFormatOptions;
17
+ /**
18
+ * How the date is shown in the field: Intl.DateTimeFormat options (display only; typing and the
19
+ * placeholder follow the locale), or a token pattern such as "DD/MM/YYYY" (D38) that drives the
20
+ * display, typing, and placeholder. Default: numeric day, month, year in the locale's order.
21
+ */
22
+ format?: Intl.DateTimeFormatOptions | string;
19
23
  clearable?: boolean;
20
24
  /** Accessible name of the clear button (D32). */
21
25
  clearLabel?: string;
@@ -80,7 +84,7 @@ declare const __VLS_base: import('vue').DefineComponent<DTDateInputProps, {}, {}
80
84
  prependInnerIcon: string;
81
85
  range: boolean;
82
86
  min: IsoDate;
83
- format: Intl.DateTimeFormatOptions;
87
+ format: Intl.DateTimeFormatOptions | string;
84
88
  multiple: boolean;
85
89
  allowedDates: (date: IsoDate) => boolean;
86
90
  firstDayOfWeek: number | string;
@@ -36,3 +36,37 @@ export declare const formatIso: (iso: IsoDate, locale: string | undefined, optio
36
36
  export declare const parseTyped: (text: string, locale: string | undefined) => IsoDate | null;
37
37
  /** The order of day, month, and year in the locale's numeric date format. */
38
38
  export declare const localeDateOrder: (locale: string | undefined) => ("day" | "month" | "year")[];
39
+ type PatternField = "year" | "month" | "day";
40
+ type PatternToken = {
41
+ field: PatternField;
42
+ width: 1 | 2 | 4;
43
+ text: string;
44
+ };
45
+ export type DatePatternPart = PatternToken | {
46
+ field: "literal";
47
+ text: string;
48
+ };
49
+ export interface DatePattern {
50
+ parts: DatePatternPart[];
51
+ /** The pattern as a hint: tokens as written, literals without their brackets. */
52
+ placeholder: string;
53
+ /** Every token has a fixed width (DD, MM, YY, YYYY), so digits without separators can be read. */
54
+ fixedWidth: boolean;
55
+ }
56
+ /** Compiles a pattern. Null when it is not one: a token of another length, or not exactly one day, month, and year. */
57
+ export declare const compileDatePattern: (pattern: string) => DatePattern | null;
58
+ /**
59
+ * The compiled pattern of a `format`-style prop. Null for Intl options, no value, or an invalid
60
+ * pattern; an invalid pattern warns once in development and the input keeps its default format.
61
+ */
62
+ export declare const resolveDatePattern: (value: unknown, component: string, prop: string) => DatePattern | null;
63
+ /** Formats an ISO date by a pattern, in Latin digits whatever the locale. */
64
+ export declare const formatDatePattern: (iso: IsoDate, pattern: DatePattern) => string;
65
+ /**
66
+ * Reads typed text by a pattern: ISO "YYYY-MM-DD"; or the digit groups in the pattern's order,
67
+ * separated by the pattern's literals, "/", ".", "-", or spaces ("6/3/2026" and "06-03-2026" for
68
+ * DD/MM/YYYY); or, when every token is fixed width, the digits alone ("06032026"). A year of one
69
+ * or two digits means 2000–2099. Returns null for anything else or an impossible date.
70
+ */
71
+ export declare const parseDatePattern: (text: string, pattern: DatePattern) => IsoDate | null;
72
+ export {};
@@ -18,8 +18,12 @@ interface DTDateTimeInputProps extends Omit<DTTextFieldBaseProps, "modelValue" |
18
18
  showWeekNumbers?: boolean;
19
19
  defaultTime?: string;
20
20
  shortcuts?: readonly DTDateShortcut[];
21
- /** How the date part is shown in the field (Intl.DateTimeFormat date options). Default: numeric day, month, year. */
22
- dateFormat?: Intl.DateTimeFormatOptions;
21
+ /**
22
+ * How the date part is shown in the field: Intl.DateTimeFormat date options (display only), or a
23
+ * token pattern such as "DD-MM-YYYY" (D38) that drives the date part's display, typing, and
24
+ * placeholder. Default: numeric day, month, year in the locale's order.
25
+ */
26
+ dateFormat?: Intl.DateTimeFormatOptions | string;
23
27
  clearable?: boolean;
24
28
  /** Icon inside the field before the text; "" for none. */
25
29
  prependInnerIcon?: string;
@@ -95,7 +99,7 @@ declare const __VLS_base: import('vue').DefineComponent<DTDateTimeInputProps, {}
95
99
  shortcuts: readonly DTDateShortcut[];
96
100
  seconds: boolean;
97
101
  defaultTime: string;
98
- dateFormat: Intl.DateTimeFormatOptions;
102
+ dateFormat: Intl.DateTimeFormatOptions | string;
99
103
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
100
104
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
101
105
  declare const _default: typeof __VLS_export;
@@ -1,4 +1,4 @@
1
- import { IsoDate } from '../date-picker/isoDate';
1
+ import { DatePattern, IsoDate } from '../date-picker/isoDate';
2
2
  import { IsoTime } from '../time-picker/isoTime';
3
3
  export type IsoDateTime = string;
4
4
  export interface DateTimeParts {
@@ -16,15 +16,23 @@ export declare const toDateTime: (date: IsoDate, time: IsoTime, withSeconds?: bo
16
16
  */
17
17
  export declare const parseBound: (value: unknown, end: boolean) => DateTimeParts | null;
18
18
  export declare const compareDateTime: (a: DateTimeParts, b: DateTimeParts) => number;
19
- /** Formats a date-time in a locale, in UTC so the wall-clock time never shifts. */
20
- export declare const formatDateTime: (parts: DateTimeParts, locale: string | undefined, hour12: boolean, withSeconds: boolean, date?: Intl.DateTimeFormatOptions) => string;
19
+ /**
20
+ * Formats a date-time in a locale, in UTC so the wall-clock time never shifts. With a date pattern
21
+ * (D38) the date part follows the pattern and the time part the locale, joined by a space in the
22
+ * locale's date/time order ("06-11-2026 14:30").
23
+ */
24
+ export declare const formatDateTime: (parts: DateTimeParts, locale: string | undefined, hour12: boolean, withSeconds: boolean, date?: Intl.DateTimeFormatOptions | DatePattern) => string;
21
25
  /** True when the locale writes the time before the date in a numeric date-time ("14:30 06/11/2026"). */
22
26
  export declare const localeTimeFirst: (locale: string | undefined) => boolean;
23
27
  /**
24
28
  * Reads a typed date-time: ISO ("2026-11-06T14:30", or with a space), or a date in the locale's
25
29
  * order and a time in any form DTTimeInput reads, in either order, separated by spaces or a comma
26
- * ("06/11/2026 14:30", "11/6/2026, 2:30 pm"). Returns null for anything else.
30
+ * ("06/11/2026 14:30", "11/6/2026, 2:30 pm"). With a date pattern (D38) the date part is read by
31
+ * the pattern instead of the locale's order. Returns null for anything else.
32
+ */
33
+ export declare const parseTypedDateTime: (text: string, locale: string | undefined, pattern?: DatePattern | null) => DateTimeParts | null;
34
+ /**
35
+ * A placeholder in the locale's order, e.g. "MM/DD/YYYY hh:mm AM" or "DD.MM.YYYY hh:mm". With a
36
+ * date pattern (D38) the date part is the pattern ("DD-MM-YYYY hh:mm").
27
37
  */
28
- export declare const parseTypedDateTime: (text: string, locale: string | undefined) => DateTimeParts | null;
29
- /** A placeholder in the locale's order, e.g. "MM/DD/YYYY hh:mm AM" or "DD.MM.YYYY hh:mm". */
30
- export declare const dateTimePattern: (locale: string | undefined, hour12: boolean, withSeconds: boolean) => string;
38
+ export declare const dateTimePattern: (locale: string | undefined, hour12: boolean, withSeconds: boolean, pattern?: DatePattern | null) => string;
@@ -0,0 +1,35 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ subtitle?: string;
4
+ prependIcon?: string;
5
+ /** Open state, for `v-model:open`. Unset: the group opens on mount when it holds an active row. */
6
+ open?: boolean;
7
+ disabled?: boolean;
8
+ };
9
+ type __VLS_Slots = {
10
+ /** The group's rows: DTListItem, or nested DTListGroup. */
11
+ default?: () => unknown;
12
+ /** Replaces the header's icon. */
13
+ prepend?: () => unknown;
14
+ /** Replaces the header's title and subtitle. */
15
+ title?: () => unknown;
16
+ };
17
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ "update:open": (value: boolean) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
21
+ }>, {
22
+ title: string;
23
+ disabled: boolean;
24
+ prependIcon: string;
25
+ open: boolean;
26
+ subtitle: string;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -23,6 +23,10 @@ type __VLS_Props = {
23
23
  * nudges, a gear turns). Any DTIcon `play` value; `false` turns it off.
24
24
  */
25
25
  iconPlay?: DTIconPlay;
26
+ /** A rail without `expandOnHover` magnifies its icons around the pointer, dock style. */
27
+ railZoom?: boolean;
28
+ /** The hover fill and the current row's fill slide from row to row; `false` tints rows in place. */
29
+ glide?: boolean;
26
30
  };
27
31
  declare var __VLS_10: {
28
32
  rail: boolean;
@@ -82,6 +86,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
82
86
  expandOnHover: boolean;
83
87
  breakpoint: number | "sm" | "md" | "lg";
84
88
  iconPlay: DTIconPlay;
89
+ railZoom: boolean;
90
+ glide: boolean;
85
91
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
86
92
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
87
93
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,11 @@
1
1
  export type DTToastTone = "info" | "success" | "warning" | "danger";
2
- /** `tonal` is the reference look (raised surface, tone edge); `solid` fills with the tone; `outlined` draws a tone border. */
3
- export type DTToastVariant = "tonal" | "solid" | "outlined";
2
+ /**
3
+ * `tonal` is the reference look (raised surface, tone edge); `solid` fills with the tone; `outlined`
4
+ * draws a tone border; `raised` is a 3D tone card: a lit gradient, an icon tile, and soft circles.
5
+ */
6
+ export type DTToastVariant = "tonal" | "solid" | "outlined" | "raised";
7
+ /** Scale of the toast: padding, text, the icon (and the raised tile), and the dismiss button. */
8
+ export type DTToastSize = "sm" | "md" | "lg";
4
9
  /** A single button rendered inside the toast, e.g. "Undo". Clicking it runs `onClick`, then dismisses the toast. */
5
10
  export interface DTToastAction {
6
11
  label: string;
@@ -20,6 +25,8 @@ export interface DTToastOptions {
20
25
  closable?: boolean;
21
26
  action?: DTToastAction;
22
27
  variant?: DTToastVariant;
28
+ /** `md` by default. For `raised`, `lg` is the design's full size. */
29
+ size?: DTToastSize;
23
30
  /** Shows a thin bar with the time left before auto-dismiss; it pauses with the countdown. */
24
31
  progress?: boolean;
25
32
  }
@@ -63,6 +70,7 @@ export declare function useToast(): {
63
70
  readonly paused: boolean;
64
71
  readonly revision: number;
65
72
  readonly variant: DTToastVariant;
73
+ readonly size: DTToastSize;
66
74
  readonly progress: boolean;
67
75
  readonly tone: DTToastTone;
68
76
  readonly duration: number;
package/dist/index.d.ts CHANGED
@@ -68,7 +68,7 @@ export { default as DTModal } from './components/modal/DTModal.vue';
68
68
  export type { DTModalFullscreen, DTModalSize } from './components/modal/DTModal.vue';
69
69
  export { default as DTToastRegion } from './components/toast/DTToastRegion.vue';
70
70
  export { useToast } from './components/toast/toastStore';
71
- export type { DTToastAction, DTToastItem, DTToastOptions, DTToastPromiseMessage, DTToastPromiseOptions, DTToastTone, DTToastVariant } from './components/toast/toastStore';
71
+ export type { DTToastAction, DTToastItem, DTToastOptions, DTToastPromiseMessage, DTToastPromiseOptions, DTToastSize, DTToastTone, DTToastVariant } from './components/toast/toastStore';
72
72
  export type { DTToastLocation } from './components/toast/DTToastRegion.vue';
73
73
  export { default as DTAlert } from './components/alert/DTAlert.vue';
74
74
  export type { DTAlertBorder, DTAlertDensity, DTAlertTone, DTAlertVariant } from './components/alert/DTAlert.vue';
@@ -96,6 +96,7 @@ export { default as DTChipGroup } from './components/chip/DTChipGroup.vue';
96
96
  export { default as DTList } from './components/list/DTList.vue';
97
97
  export { default as DTListItem } from './components/list/DTListItem.vue';
98
98
  export { default as DTListSubheader } from './components/list/DTListSubheader.vue';
99
+ export { default as DTListGroup } from './components/list/DTListGroup.vue';
99
100
  export type { DTListDensity, DTListLines, DTListSelectable } from './components/list/listContext';
100
101
  export { default as DTFileInput } from './components/file-input/DTFileInput.vue';
101
102
  export type { DTFileRejection } from './components/file-input/DTFileInput.vue';