tandd-ui 0.0.0-stage → 0.2.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.
- package/CHANGELOG.md +96 -0
- package/LICENSE +21 -0
- package/README.md +96 -2
- package/dist/components/_shared/direction.d.ts +6 -0
- package/dist/components/_shared/escapeLayers.d.ts +21 -0
- package/dist/components/_shared/formatLabel.d.ts +5 -0
- package/dist/components/_shared/useDismissiblePopup.d.ts +4 -0
- package/dist/components/_shared/useFieldValidation.d.ts +34 -0
- package/dist/components/_shared/useFocusTrap.d.ts +16 -0
- package/dist/components/_shared/useMessages.d.ts +18 -0
- package/dist/components/_shared/usePopover.d.ts +122 -0
- package/dist/components/_shared/useRipple.d.ts +37 -0
- package/dist/components/_shared/useRovingFocus.d.ts +25 -0
- package/dist/components/accordion/DTAccordion.vue.d.ts +42 -0
- package/dist/components/accordion/DTAccordionItem.vue.d.ts +34 -0
- package/dist/components/accordion/accordionContext.d.ts +13 -0
- package/dist/components/alert/DTAlert.vue.d.ts +57 -0
- package/dist/components/anchor/DTAnchor.vue.d.ts +48 -0
- package/dist/components/anchor/DTAnchorLink.vue.d.ts +21 -0
- package/dist/components/anchor/anchorContext.d.ts +10 -0
- package/dist/components/app-bar/DTAppBar.vue.d.ts +56 -0
- package/dist/components/autocomplete/DTAutocomplete.vue.d.ts +131 -0
- package/dist/components/avatar/DTAvatar.vue.d.ts +37 -0
- package/dist/components/avatar/DTAvatarGroup.vue.d.ts +18 -0
- package/dist/components/badge/DTBadge.vue.d.ts +47 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/border-beam/DTBorderBeam.vue.d.ts +47 -0
- package/dist/components/breadcrumb/DTBreadcrumb.vue.d.ts +46 -0
- package/dist/components/button/DTButton.vue.d.ts +60 -0
- package/dist/components/button-group/DTButtonGroup.vue.d.ts +56 -0
- package/dist/components/button-group/buttonGroupContext.d.ts +16 -0
- package/dist/components/card/DTCard.vue.d.ts +38 -0
- package/dist/components/card/DTCardBody.vue.d.ts +13 -0
- package/dist/components/card/DTCardFooter.vue.d.ts +13 -0
- package/dist/components/card/DTCardHeader.vue.d.ts +17 -0
- package/dist/components/card/DTCardMedia.vue.d.ts +24 -0
- package/dist/components/card/DTCardSubtitle.vue.d.ts +13 -0
- package/dist/components/card/DTCardText.vue.d.ts +13 -0
- package/dist/components/card/DTCardTitle.vue.d.ts +24 -0
- package/dist/components/card/context.d.ts +6 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/carousel/DTCarousel.vue.d.ts +69 -0
- package/dist/components/carousel/DTCarouselItem.vue.d.ts +21 -0
- package/dist/components/carousel/carouselContext.d.ts +22 -0
- package/dist/components/checkbox/DTCheckbox.vue.d.ts +50 -0
- package/dist/components/chip/DTChip.vue.d.ts +62 -0
- package/dist/components/chip/DTChipGroup.vue.d.ts +36 -0
- package/dist/components/chip/chipGroupContext.d.ts +9 -0
- package/dist/components/code/DTCode.vue.d.ts +13 -0
- package/dist/components/col/DTCol.vue.d.ts +55 -0
- package/dist/components/color-input/DTColorInput.vue.d.ts +89 -0
- package/dist/components/color-input/colorMath.d.ts +36 -0
- package/dist/components/color-picker/DTColorPicker.vue.d.ts +66 -0
- package/dist/components/color-picker/context.d.ts +9 -0
- package/dist/components/combobox/DTCombobox.vue.d.ts +106 -0
- package/dist/components/container/DTContainer.vue.d.ts +29 -0
- package/dist/components/data-table/DTDataTable.vue.d.ts +112 -0
- package/dist/components/data-table/types.d.ts +70 -0
- package/dist/components/date-picker/DTDateInput.vue.d.ts +98 -0
- package/dist/components/date-picker/DTDatePicker.vue.d.ts +106 -0
- package/dist/components/date-picker/DTDateShortcuts.vue.d.ts +15 -0
- package/dist/components/date-picker/isoDate.d.ts +38 -0
- package/dist/components/date-picker/shortcuts.d.ts +11 -0
- package/dist/components/date-time-picker/DTDateTimeInput.vue.d.ts +107 -0
- package/dist/components/date-time-picker/DTDateTimePicker.vue.d.ts +94 -0
- package/dist/components/date-time-picker/isoDateTime.d.ts +30 -0
- package/dist/components/divider/DTDivider.vue.d.ts +19 -0
- package/dist/components/empty-state/DTEmptyState.vue.d.ts +51 -0
- package/dist/components/field/DTField.vue.d.ts +36 -0
- package/dist/components/field/fieldContext.d.ts +14 -0
- package/dist/components/field-control/DTFieldControl.vue.d.ts +135 -0
- package/dist/components/field-control/index.d.ts +1 -0
- package/dist/components/file-input/DTFileInput.vue.d.ts +142 -0
- package/dist/components/file-upload/DTFileUpload.vue.d.ts +132 -0
- package/dist/components/file-upload/icons.d.ts +1 -0
- package/dist/components/file-upload/types.d.ts +47 -0
- package/dist/components/grid/DTGrid.vue.d.ts +44 -0
- package/dist/components/grid/DTGridItem.vue.d.ts +42 -0
- package/dist/components/heading/DTHeading.vue.d.ts +31 -0
- package/dist/components/icon/DTIcon.vue.d.ts +43 -0
- package/dist/components/icon/play.d.ts +6 -0
- package/dist/components/icon/registry.d.ts +16 -0
- package/dist/components/infinite-scroll/DTInfiniteScroll.vue.d.ts +67 -0
- package/dist/components/infinite-scroll/icons.d.ts +1 -0
- package/dist/components/inline/DTInline.vue.d.ts +26 -0
- package/dist/components/kbd/DTKbd.vue.d.ts +13 -0
- package/dist/components/layout-app/DTLayout.vue.d.ts +18 -0
- package/dist/components/layout-app/DTMain.vue.d.ts +21 -0
- package/dist/components/layout-app/layoutContext.d.ts +33 -0
- package/dist/components/link/DTLink.vue.d.ts +26 -0
- package/dist/components/list/DTList.vue.d.ts +53 -0
- package/dist/components/list/DTListItem.vue.d.ts +61 -0
- package/dist/components/list/DTListSubheader.vue.d.ts +24 -0
- package/dist/components/list/listContext.d.ts +16 -0
- package/dist/components/mention/DTMention.vue.d.ts +93 -0
- package/dist/components/mention/caret.d.ts +7 -0
- package/dist/components/menu/DTMenu.vue.d.ts +66 -0
- package/dist/components/menu/DTMenuItem.vue.d.ts +45 -0
- package/dist/components/menu/DTMenuLabel.vue.d.ts +13 -0
- package/dist/components/menu/DTMenuSeparator.vue.d.ts +3 -0
- package/dist/components/menu/menuContext.d.ts +38 -0
- package/dist/components/modal/DTModal.vue.d.ts +52 -0
- package/dist/components/modal/modalStack.d.ts +20 -0
- package/dist/components/navigation-drawer/DTNavigationDrawer.vue.d.ts +93 -0
- package/dist/components/number-input/DTNumberInput.vue.d.ts +66 -0
- package/dist/components/otp-input/DTOtpInput.vue.d.ts +71 -0
- package/dist/components/pagination/DTPagination.vue.d.ts +55 -0
- package/dist/components/popover/DTPopover.vue.d.ts +67 -0
- package/dist/components/progress/DTProgress.vue.d.ts +48 -0
- package/dist/components/pull-refresh/DTPullRefresh.vue.d.ts +69 -0
- package/dist/components/radio/DTRadio.vue.d.ts +41 -0
- package/dist/components/radio/DTRadioGroup.vue.d.ts +35 -0
- package/dist/components/radio/radioGroupContext.d.ts +12 -0
- package/dist/components/rating/DTRating.vue.d.ts +65 -0
- package/dist/components/row/DTRow.vue.d.ts +38 -0
- package/dist/components/select/DTSelect.vue.d.ts +140 -0
- package/dist/components/sheet/DTSheet.vue.d.ts +57 -0
- package/dist/components/skeleton/DTSkeleton.vue.d.ts +34 -0
- package/dist/components/skip-link/DTSkipLink.vue.d.ts +33 -0
- package/dist/components/slider/DTSlider.vue.d.ts +88 -0
- package/dist/components/spinner/DTSpinner.vue.d.ts +34 -0
- package/dist/components/stack/DTStack.vue.d.ts +24 -0
- package/dist/components/statistic/DTCountdown.vue.d.ts +49 -0
- package/dist/components/statistic/DTStatistic.vue.d.ts +49 -0
- package/dist/components/statistic/format.d.ts +39 -0
- package/dist/components/stepper/DTStep.vue.d.ts +41 -0
- package/dist/components/stepper/DTStepHeader.vue.d.ts +8 -0
- package/dist/components/stepper/DTStepper.vue.d.ts +46 -0
- package/dist/components/stepper/stepperContext.d.ts +39 -0
- package/dist/components/surface/DTSurface.vue.d.ts +43 -0
- package/dist/components/surface/index.d.ts +2 -0
- package/dist/components/switch/DTSwitch.vue.d.ts +59 -0
- package/dist/components/table/DTTable.vue.d.ts +55 -0
- package/dist/components/table/DTTableScrollbars.vue.d.ts +9 -0
- package/dist/components/tabs/DTTab.vue.d.ts +23 -0
- package/dist/components/tabs/DTTabs.vue.d.ts +45 -0
- package/dist/components/tabs/tabsContext.d.ts +19 -0
- package/dist/components/text/DTText.vue.d.ts +32 -0
- package/dist/components/text-field/DTFieldShell.vue.d.ts +59 -0
- package/dist/components/text-field/DTInput.vue.d.ts +70 -0
- package/dist/components/text-field/fieldShared.d.ts +87 -0
- package/dist/components/textarea/DTTextarea.vue.d.ts +56 -0
- package/dist/components/time-picker/DTTimeInput.vue.d.ts +71 -0
- package/dist/components/time-picker/DTTimePicker.vue.d.ts +52 -0
- package/dist/components/time-picker/isoTime.d.ts +21 -0
- package/dist/components/timeline/DTTimeline.vue.d.ts +36 -0
- package/dist/components/timeline/DTTimelineItem.vue.d.ts +46 -0
- package/dist/components/timeline/timelineContext.d.ts +13 -0
- package/dist/components/toast/DTToastRegion.vue.d.ts +18 -0
- package/dist/components/toast/toastStore.d.ts +77 -0
- package/dist/components/tooltip/DTTooltip.vue.d.ts +45 -0
- package/dist/components/tour/DTTour.vue.d.ts +62 -0
- package/dist/components/tour/DTTourStep.vue.d.ts +31 -0
- package/dist/components/tour/tourContext.d.ts +20 -0
- package/dist/components/tree-select/DTTreeSelect.vue.d.ts +86 -0
- package/dist/components/treeview/DTTreeview.vue.d.ts +92 -0
- package/dist/components/watermark/DTWatermark.vue.d.ts +48 -0
- package/dist/config.d.ts +58 -0
- package/dist/index.d.ts +183 -0
- package/dist/locale/en.d.ts +311 -0
- package/dist/locale/en.js +192 -0
- package/dist/locale/messages.d.ts +295 -0
- package/dist/locale/vi.d.ts +309 -0
- package/dist/locale/vi.js +192 -0
- package/dist/plugin.d.ts +26 -0
- package/dist/tandd-ui.css +11585 -0
- package/dist/tandd-ui.js +13039 -0
- package/dist/theme/cssVariables.d.ts +14 -0
- package/dist/theme/defaultTheme.d.ts +5 -0
- package/dist/theme/index.d.ts +34 -0
- package/dist/useLocale.d.ts +15 -0
- package/dist/useTheme.d.ts +9 -0
- package/package.json +112 -4
- package/src/components/_index.scss +73 -0
- package/src/components/accordion/DTAccordion.scss +123 -0
- package/src/components/alert/DTAlert.scss +222 -0
- package/src/components/anchor/DTAnchor.scss +137 -0
- package/src/components/app-bar/DTAppBar.scss +151 -0
- package/src/components/autocomplete/DTAutocomplete.scss +89 -0
- package/src/components/avatar/DTAvatar.scss +67 -0
- package/src/components/badge/DTBadge.scss +218 -0
- package/src/components/border-beam/DTBorderBeam.scss +67 -0
- package/src/components/breadcrumb/DTBreadcrumb.scss +58 -0
- package/src/components/button/DTButton.scss +252 -0
- package/src/components/button-group/DTButtonGroup.scss +103 -0
- package/src/components/card/DTCard.scss +183 -0
- package/src/components/carousel/DTCarousel.scss +228 -0
- package/src/components/checkbox/DTChoice.scss +351 -0
- package/src/components/chip/DTChip.scss +280 -0
- package/src/components/code/DTCode.scss +10 -0
- package/src/components/col/DTCol.scss +124 -0
- package/src/components/color-input/DTColorInput.scss +118 -0
- package/src/components/color-picker/DTColorPicker.scss +334 -0
- package/src/components/container/DTContainer.scss +24 -0
- package/src/components/data-table/DTDataTable.scss +274 -0
- package/src/components/date-picker/DTDatePicker.scss +474 -0
- package/src/components/date-time-picker/DTDateTimePicker.scss +144 -0
- package/src/components/divider/DTDivider.scss +67 -0
- package/src/components/empty-state/DTEmptyState.scss +106 -0
- package/src/components/field/DTField.scss +69 -0
- package/src/components/field-control/DTFieldControl.scss +221 -0
- package/src/components/file-input/DTFileInput.scss +98 -0
- package/src/components/file-upload/DTFileUpload.scss +185 -0
- package/src/components/grid/DTGrid.scss +135 -0
- package/src/components/heading/DTHeading.scss +9 -0
- package/src/components/icon/DTIcon.scss +64 -0
- package/src/components/infinite-scroll/DTInfiniteScroll.scss +67 -0
- package/src/components/inline/DTInline.scss +19 -0
- package/src/components/kbd/DTKbd.scss +17 -0
- package/src/components/layout-app/DTLayout.scss +69 -0
- package/src/components/link/DTLink.scss +35 -0
- package/src/components/list/DTList.scss +261 -0
- package/src/components/mention/DTMention.scss +24 -0
- package/src/components/menu/DTMenu.scss +282 -0
- package/src/components/modal/DTModal.scss +178 -0
- package/src/components/navigation-drawer/DTNavigationDrawer.scss +172 -0
- package/src/components/number-input/DTNumberInput.scss +124 -0
- package/src/components/otp-input/DTOtpInput.scss +121 -0
- package/src/components/pagination/DTPagination.scss +115 -0
- package/src/components/popover/DTPopover.scss +119 -0
- package/src/components/progress/DTProgress.scss +227 -0
- package/src/components/pull-refresh/DTPullRefresh.scss +83 -0
- package/src/components/rating/DTRating.scss +153 -0
- package/src/components/row/DTRow.scss +73 -0
- package/src/components/select/DTSelect.scss +347 -0
- package/src/components/sheet/DTSheet.scss +256 -0
- package/src/components/skeleton/DTSkeleton.scss +74 -0
- package/src/components/skip-link/DTSkipLink.scss +76 -0
- package/src/components/slider/DTSlider.scss +652 -0
- package/src/components/spinner/DTSpinner.scss +123 -0
- package/src/components/stack/DTStack.scss +8 -0
- package/src/components/statistic/DTStatistic.scss +44 -0
- package/src/components/stepper/DTStepper.scss +268 -0
- package/src/components/surface/DTSurface.scss +99 -0
- package/src/components/switch/DTSwitch.scss +306 -0
- package/src/components/table/DTTable.scss +287 -0
- package/src/components/tabs/DTTabs.scss +402 -0
- package/src/components/text/DTText.scss +9 -0
- package/src/components/text-field/DTTextField.scss +452 -0
- package/src/components/time-picker/DTTimePicker.scss +131 -0
- package/src/components/timeline/DTTimeline.scss +322 -0
- package/src/components/toast/DTToast.scss +297 -0
- package/src/components/tooltip/DTTooltip.scss +168 -0
- package/src/components/tour/DTTour.scss +173 -0
- package/src/components/tree-select/DTTreeSelect.scss +60 -0
- package/src/components/treeview/DTTreeview.scss +205 -0
- package/src/components/watermark/DTWatermark.scss +8 -0
- package/src/styles/foundation/_direction.scss +6 -0
- package/src/styles/foundation/_focus.scss +12 -0
- package/src/styles/foundation/_forced-colors.scss +9 -0
- package/src/styles/foundation/_motion.scss +10 -0
- package/src/styles/foundation/_reset.scss +39 -0
- package/src/styles/foundation/_root.scss +112 -0
- package/src/styles/foundation/_state.scss +29 -0
- package/src/styles/foundation/_typography.scss +81 -0
- package/src/styles/foundation/_visually-hidden.scss +21 -0
- package/src/styles/index.scss +9 -0
- package/src/styles/tokens/_border.scss +2 -0
- package/src/styles/tokens/_breakpoint.scss +15 -0
- package/src/styles/tokens/_color.scss +56 -0
- package/src/styles/tokens/_index.scss +11 -0
- package/src/styles/tokens/_motion.scss +13 -0
- package/src/styles/tokens/_radius.scss +13 -0
- package/src/styles/tokens/_shadow.scss +18 -0
- package/src/styles/tokens/_spacing.scss +21 -0
- package/src/styles/tokens/_state.scss +30 -0
- package/src/styles/tokens/_surface.scss +33 -0
- package/src/styles/tokens/_typography.scss +40 -0
- package/src/styles/tokens/_z-index.scss +11 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
// Text fields: DTInput and DTTextarea (HTML reference .dt-field / .dt-field-box / .dt-control).
|
|
2
|
+
// Variants and sizes only set custom properties; the box reads them. Focus recolours the border
|
|
3
|
+
// (no ring), as in the reference.
|
|
4
|
+
.dt-text-field {
|
|
5
|
+
--dt-field-height: 40px;
|
|
6
|
+
--dt-field-font-size: var(--dt-font-size-md);
|
|
7
|
+
--dt-field-label-font-size: var(--dt-font-size-sm);
|
|
8
|
+
--dt-field-icon: var(--dt-icon-md);
|
|
9
|
+
--dt-field-gap: 8px;
|
|
10
|
+
--dt-field-pad-x: 12px;
|
|
11
|
+
--dt-field-bg: var(--dt-color-surface);
|
|
12
|
+
--dt-field-bg-focus: var(--dt-field-bg);
|
|
13
|
+
--dt-field-bg-disabled: var(--dt-color-surface-muted);
|
|
14
|
+
--dt-field-bg-readonly: var(--dt-color-surface-muted);
|
|
15
|
+
--dt-field-border-color: var(--dt-color-border-strong);
|
|
16
|
+
--dt-field-focus-color: var(--dt-color-primary);
|
|
17
|
+
--dt-field-border: 1px;
|
|
18
|
+
--dt-field-border-focus: var(--dt-field-border);
|
|
19
|
+
--dt-field-radius: var(--dt-radius-sm);
|
|
20
|
+
--dt-field-float-space: 0px;
|
|
21
|
+
--dt-field-label-rest-top: 50%;
|
|
22
|
+
--dt-field-label-rest-left: var(--dt-field-pad-x);
|
|
23
|
+
--dt-field-label-float-top: 0px;
|
|
24
|
+
--dt-field-label-float-font-size: 12px;
|
|
25
|
+
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: 6px;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
color: var(--dt-color-text);
|
|
31
|
+
font-family: inherit;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Sizes
|
|
35
|
+
.dt-text-field--sm {
|
|
36
|
+
--dt-field-height: 32px;
|
|
37
|
+
--dt-field-font-size: var(--dt-font-size-sm);
|
|
38
|
+
--dt-field-label-font-size: var(--dt-font-size-xs);
|
|
39
|
+
--dt-field-icon: var(--dt-icon-sm);
|
|
40
|
+
--dt-field-gap: 6px;
|
|
41
|
+
--dt-field-pad-x: 10px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dt-text-field--lg {
|
|
45
|
+
--dt-field-height: 48px;
|
|
46
|
+
--dt-field-font-size: 15px;
|
|
47
|
+
--dt-field-label-font-size: var(--dt-font-size-md);
|
|
48
|
+
--dt-field-gap: 10px;
|
|
49
|
+
--dt-field-pad-x: 14px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Variants
|
|
53
|
+
.dt-text-field--soft {
|
|
54
|
+
--dt-field-bg: var(--dt-color-surface-muted);
|
|
55
|
+
--dt-field-bg-focus: var(--dt-color-surface);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dt-text-field--filled {
|
|
59
|
+
--dt-field-bg: var(--dt-color-surface-muted);
|
|
60
|
+
--dt-field-border: 0 0 2px;
|
|
61
|
+
--dt-field-radius: var(--dt-radius-sm) var(--dt-radius-sm) 0 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.dt-text-field--outlined {
|
|
65
|
+
--dt-field-radius: var(--dt-radius-md);
|
|
66
|
+
--dt-field-border-focus: 2px;
|
|
67
|
+
--dt-field-float-space: 7px;
|
|
68
|
+
--dt-field-label-float-top: -1px;
|
|
69
|
+
--dt-field-label-float-font-size: 11px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dt-text-field--underlined,
|
|
73
|
+
.dt-text-field--plain {
|
|
74
|
+
--dt-field-bg: transparent;
|
|
75
|
+
--dt-field-bg-focus: transparent;
|
|
76
|
+
--dt-field-bg-disabled: transparent;
|
|
77
|
+
--dt-field-bg-readonly: transparent;
|
|
78
|
+
--dt-field-radius: 0;
|
|
79
|
+
--dt-field-pad-x: 0px;
|
|
80
|
+
--dt-field-float-space: 10px;
|
|
81
|
+
--dt-field-label-float-top: -2px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dt-text-field--underlined {
|
|
85
|
+
--dt-field-border: 0 0 1px;
|
|
86
|
+
--dt-field-border-focus: 0 0 2px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.dt-text-field--plain {
|
|
90
|
+
--dt-field-border: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Declared after the variants so a real error wins over every variant's focus colour.
|
|
94
|
+
.dt-text-field.is-invalid {
|
|
95
|
+
--dt-field-border-color: var(--dt-color-danger);
|
|
96
|
+
--dt-field-focus-color: var(--dt-color-danger);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Focus must stay visible where the reference border change is not: an invalid field already
|
|
100
|
+
// has the danger border, and plain has no border at all. Inset shadows avoid any layout shift.
|
|
101
|
+
.dt-text-field.is-invalid:is(.dt-text-field--soft, .dt-text-field--filled) .dt-text-field__box:focus-within {
|
|
102
|
+
box-shadow: inset 0 0 0 1px var(--dt-field-focus-color);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.dt-text-field--plain .dt-text-field__box:focus-within {
|
|
106
|
+
box-shadow: inset 0 -2px 0 var(--dt-field-focus-color);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Parts
|
|
110
|
+
.dt-text-field__label {
|
|
111
|
+
color: var(--dt-color-text-muted);
|
|
112
|
+
font-size: var(--dt-field-label-font-size);
|
|
113
|
+
font-weight: var(--dt-font-weight-medium);
|
|
114
|
+
line-height: 1.35;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// A label slot may hold a layout box (e.g. DTInline, a flex row). Inside this inline-flex wrapper it
|
|
118
|
+
// shrinks to its content, so the required "*" stays on the same line instead of wrapping below it.
|
|
119
|
+
.dt-text-field__label-content {
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
max-width: 100%;
|
|
122
|
+
vertical-align: bottom;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.dt-text-field__required {
|
|
126
|
+
color: var(--dt-color-danger);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dt-text-field__helper {
|
|
130
|
+
color: var(--dt-color-text-subtle);
|
|
131
|
+
font-size: 12px;
|
|
132
|
+
line-height: 1.4;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.dt-text-field.is-invalid .dt-text-field__helper {
|
|
136
|
+
color: var(--dt-color-danger);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.dt-text-field__row {
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
gap: 12px;
|
|
143
|
+
min-width: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.dt-text-field__outer,
|
|
147
|
+
.dt-text-field__inner {
|
|
148
|
+
display: inline-flex;
|
|
149
|
+
flex: none;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
color: var(--dt-color-text-muted);
|
|
153
|
+
font-size: var(--dt-field-icon);
|
|
154
|
+
|
|
155
|
+
.dt-icon {
|
|
156
|
+
width: var(--dt-field-icon);
|
|
157
|
+
height: var(--dt-field-icon);
|
|
158
|
+
font-size: var(--dt-field-icon);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.dt-text-field__inner {
|
|
163
|
+
color: var(--dt-color-text-subtle);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Label and helper line up with the box, not with an outer prepend icon.
|
|
167
|
+
.dt-text-field--has-prepend > :is(.dt-text-field__label, .dt-text-field__helper) {
|
|
168
|
+
padding-left: calc(var(--dt-field-icon) + 12px);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.dt-text-field__box {
|
|
172
|
+
position: relative;
|
|
173
|
+
display: flex;
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
flex: 1;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: var(--dt-field-gap);
|
|
178
|
+
min-width: 0;
|
|
179
|
+
height: var(--dt-field-height);
|
|
180
|
+
padding: 0 var(--dt-field-pad-x);
|
|
181
|
+
border: solid var(--dt-field-border-color);
|
|
182
|
+
border-width: var(--dt-field-border);
|
|
183
|
+
border-radius: var(--dt-field-radius);
|
|
184
|
+
background: var(--dt-field-bg);
|
|
185
|
+
transition: border-color var(--dt-duration-fast), background var(--dt-duration-fast);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.dt-text-field__box:focus-within {
|
|
189
|
+
border-color: var(--dt-field-focus-color);
|
|
190
|
+
border-width: var(--dt-field-border-focus);
|
|
191
|
+
background: var(--dt-field-bg-focus);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.dt-text-field__box:has(> .dt-text-field__control:disabled) {
|
|
195
|
+
border-color: var(--dt-color-border);
|
|
196
|
+
background: var(--dt-field-bg-disabled);
|
|
197
|
+
color: var(--dt-color-text-disabled);
|
|
198
|
+
cursor: not-allowed;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.dt-text-field__box:has(> .dt-text-field__control[readonly]) {
|
|
202
|
+
background: var(--dt-field-bg-readonly);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.dt-text-field__control {
|
|
206
|
+
flex: 1;
|
|
207
|
+
align-self: stretch;
|
|
208
|
+
box-sizing: border-box;
|
|
209
|
+
width: 100%;
|
|
210
|
+
min-width: 0;
|
|
211
|
+
margin: 0;
|
|
212
|
+
padding: 0;
|
|
213
|
+
border: 0;
|
|
214
|
+
border-radius: 0;
|
|
215
|
+
outline: none;
|
|
216
|
+
color: var(--dt-color-text);
|
|
217
|
+
background: transparent;
|
|
218
|
+
font: inherit;
|
|
219
|
+
font-size: var(--dt-field-font-size);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.dt-text-field__control::placeholder {
|
|
223
|
+
color: var(--dt-color-text-subtle);
|
|
224
|
+
opacity: 1;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.dt-text-field__control:disabled {
|
|
228
|
+
color: var(--dt-color-text-disabled);
|
|
229
|
+
cursor: not-allowed;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Prefix / suffix: non-editable text tight against the value.
|
|
233
|
+
.dt-text-field__affix {
|
|
234
|
+
flex: none;
|
|
235
|
+
color: var(--dt-color-text-subtle);
|
|
236
|
+
font-size: var(--dt-field-font-size);
|
|
237
|
+
white-space: nowrap;
|
|
238
|
+
transition: opacity var(--dt-duration-fast) var(--dt-ease-standard);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.dt-text-field__affix--prefix {
|
|
242
|
+
margin-right: calc(4px - var(--dt-field-gap));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.dt-text-field__affix--suffix {
|
|
246
|
+
margin-left: calc(4px - var(--dt-field-gap));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Textarea
|
|
250
|
+
.dt-text-field--multiline {
|
|
251
|
+
--dt-field-label-rest-top: 21px;
|
|
252
|
+
|
|
253
|
+
.dt-text-field__box {
|
|
254
|
+
align-items: flex-start;
|
|
255
|
+
height: auto;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Height follows `rows`: rows × 1.5 line height + padding. From 3 rows (the default) up,
|
|
259
|
+
// the design reference's 96 px minimum also applies; 1 or 2 rows give a shorter box.
|
|
260
|
+
.dt-text-field__control {
|
|
261
|
+
min-height: max(
|
|
262
|
+
calc(var(--dt-textarea-rows, 3) * 1.5em + 20px),
|
|
263
|
+
calc(min(1, max(0, var(--dt-textarea-rows, 3) - 2)) * 96px)
|
|
264
|
+
);
|
|
265
|
+
padding: 10px 0;
|
|
266
|
+
line-height: 1.5;
|
|
267
|
+
resize: vertical;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.dt-text-field__control--auto-grow {
|
|
271
|
+
overflow: hidden;
|
|
272
|
+
resize: none;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.dt-text-field__box > :is(.dt-text-field__inner, .dt-text-field__affix) {
|
|
276
|
+
margin-top: 10px;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Floating label: rests where the value goes, floats on focus or when there is a value.
|
|
281
|
+
// Prefix, suffix and placeholder only show once it has floated.
|
|
282
|
+
.dt-text-field--floating {
|
|
283
|
+
padding-top: var(--dt-field-float-space);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.dt-text-field__label--floating {
|
|
287
|
+
position: absolute;
|
|
288
|
+
z-index: 1;
|
|
289
|
+
top: var(--dt-field-label-rest-top);
|
|
290
|
+
left: var(--dt-field-label-rest-left);
|
|
291
|
+
max-width: calc(100% - 2 * var(--dt-field-pad-x));
|
|
292
|
+
overflow: hidden;
|
|
293
|
+
color: var(--dt-color-text-subtle);
|
|
294
|
+
font-size: var(--dt-field-font-size);
|
|
295
|
+
font-weight: var(--dt-font-weight-regular);
|
|
296
|
+
line-height: 1.2;
|
|
297
|
+
white-space: nowrap;
|
|
298
|
+
text-overflow: ellipsis;
|
|
299
|
+
pointer-events: none;
|
|
300
|
+
transform: translateY(-50%);
|
|
301
|
+
transition: all var(--dt-duration-fast) var(--dt-ease-standard);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.dt-text-field__box:has(> .dt-text-field__inner--prepend) {
|
|
305
|
+
--dt-field-label-rest-left: calc(var(--dt-field-pad-x) + var(--dt-field-icon) + var(--dt-field-gap));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.dt-text-field.has-value .dt-text-field__label--floating,
|
|
309
|
+
.dt-text-field__box:focus-within > .dt-text-field__label--floating {
|
|
310
|
+
top: var(--dt-field-label-float-top);
|
|
311
|
+
left: var(--dt-field-pad-x);
|
|
312
|
+
max-width: calc(100% - var(--dt-field-pad-x));
|
|
313
|
+
color: var(--dt-color-text-muted);
|
|
314
|
+
font-size: var(--dt-field-label-float-font-size);
|
|
315
|
+
font-weight: var(--dt-font-weight-medium);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.dt-text-field__box:focus-within > .dt-text-field__label--floating {
|
|
319
|
+
color: var(--dt-field-focus-color);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.dt-text-field.is-invalid .dt-text-field__label--floating {
|
|
323
|
+
color: var(--dt-color-danger);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.dt-text-field--floating:not(.has-value) .dt-text-field__box:not(:focus-within) {
|
|
327
|
+
> .dt-text-field__affix {
|
|
328
|
+
opacity: 0;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
> .dt-text-field__control::placeholder {
|
|
332
|
+
color: transparent;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Outlined: the floated label sits on the top border, on a surface-coloured notch.
|
|
337
|
+
.dt-text-field--outlined {
|
|
338
|
+
.dt-text-field__label--floating {
|
|
339
|
+
margin-left: -4px;
|
|
340
|
+
padding: 0 4px;
|
|
341
|
+
background: var(--dt-color-surface);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.dt-text-field__box:focus-within {
|
|
345
|
+
padding-inline: calc(var(--dt-field-pad-x) - 1px);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.dt-text-field__box:focus-within > .dt-text-field__label--floating {
|
|
349
|
+
left: calc(var(--dt-field-pad-x) - 1px);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Icon buttons: an icon prop whose `click:<position>` event has a listener. Same size and colour as
|
|
354
|
+
// the decorative icon, with a pointer, a hover colour, and the global focus ring.
|
|
355
|
+
.dt-text-field__icon-button {
|
|
356
|
+
display: inline-flex;
|
|
357
|
+
align-items: center;
|
|
358
|
+
justify-content: center;
|
|
359
|
+
margin: 0;
|
|
360
|
+
padding: 0;
|
|
361
|
+
border: 0;
|
|
362
|
+
border-radius: var(--dt-radius-full);
|
|
363
|
+
color: inherit;
|
|
364
|
+
background: transparent;
|
|
365
|
+
font: inherit;
|
|
366
|
+
cursor: pointer;
|
|
367
|
+
transition: color var(--dt-duration-fast);
|
|
368
|
+
|
|
369
|
+
&:hover:not(:disabled) {
|
|
370
|
+
color: var(--dt-color-text);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
&:disabled {
|
|
374
|
+
cursor: not-allowed;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Hit area (WCAG 2.5.8, D32 item 9): icon buttons and the clear button are as big as their icon
|
|
379
|
+
// (16 or 20 px). A transparent layer, centred on the button, grows the clickable area to 24 × 24.
|
|
380
|
+
// It adds no layout, and the 2–4 px it reaches out stays inside the field gap (6–10 px), so it does
|
|
381
|
+
// not cover the text control. The focus ring is still the button's own outline.
|
|
382
|
+
.dt-text-field__icon-button,
|
|
383
|
+
.dt-text-field__clear {
|
|
384
|
+
position: relative;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.dt-text-field__icon-button::before,
|
|
388
|
+
.dt-text-field__clear::before {
|
|
389
|
+
content: "";
|
|
390
|
+
position: absolute;
|
|
391
|
+
inset: min(0px, calc(50% - 12px));
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Clear button (DTInput `clearable`): sits first in the append-inner position.
|
|
395
|
+
.dt-text-field__clear {
|
|
396
|
+
display: inline-flex;
|
|
397
|
+
flex: none;
|
|
398
|
+
align-items: center;
|
|
399
|
+
justify-content: center;
|
|
400
|
+
margin: 0;
|
|
401
|
+
padding: 0;
|
|
402
|
+
border: 0;
|
|
403
|
+
border-radius: var(--dt-radius-full);
|
|
404
|
+
color: var(--dt-color-text-subtle);
|
|
405
|
+
background: transparent;
|
|
406
|
+
font: inherit;
|
|
407
|
+
cursor: pointer;
|
|
408
|
+
transition: color var(--dt-duration-fast);
|
|
409
|
+
|
|
410
|
+
&:hover {
|
|
411
|
+
color: var(--dt-color-text);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Logical (D32): the gap sits before the next trailing button in both directions.
|
|
415
|
+
&:not(:last-child) {
|
|
416
|
+
margin-inline-end: 6px;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Loading (DTInput `loading`): an indeterminate 2px bar on the bottom edge of the box. The clip
|
|
421
|
+
// layer covers the box and inherits its radius so the bar follows rounded corners.
|
|
422
|
+
.dt-text-field__loader {
|
|
423
|
+
position: absolute;
|
|
424
|
+
z-index: 1;
|
|
425
|
+
inset: 0;
|
|
426
|
+
overflow: hidden;
|
|
427
|
+
border-radius: inherit;
|
|
428
|
+
pointer-events: none;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.dt-text-field__loader-bar {
|
|
432
|
+
position: absolute;
|
|
433
|
+
bottom: 0;
|
|
434
|
+
left: 0;
|
|
435
|
+
width: 40%;
|
|
436
|
+
height: 2px;
|
|
437
|
+
background: var(--dt-field-focus-color);
|
|
438
|
+
animation: dt-text-field-loading 1.4s var(--dt-ease-standard) infinite;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
@media (prefers-reduced-motion: reduce) {
|
|
442
|
+
.dt-text-field__loader-bar {
|
|
443
|
+
width: 100%;
|
|
444
|
+
animation: none;
|
|
445
|
+
opacity: 0.6;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
@keyframes dt-text-field-loading {
|
|
450
|
+
0% { transform: translateX(-110%); }
|
|
451
|
+
100% { transform: translateX(260%); }
|
|
452
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Time picker (D31 item 46). No HTML reference page: columns of options in the DTDatePicker panel
|
|
2
|
+
// look; the selected option is the accent fill, as a selected day.
|
|
3
|
+
.dt-time-picker {
|
|
4
|
+
--dt-time-option: 36px;
|
|
5
|
+
--dt-time-rows: 5;
|
|
6
|
+
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
align-items: stretch;
|
|
10
|
+
gap: 4px;
|
|
11
|
+
padding: 8px;
|
|
12
|
+
border: 1px solid var(--dt-color-border);
|
|
13
|
+
border-radius: var(--dt-radius-md);
|
|
14
|
+
color: var(--dt-color-text);
|
|
15
|
+
background: var(--dt-color-surface);
|
|
16
|
+
font-size: var(--dt-font-size-sm);
|
|
17
|
+
font-variant-numeric: tabular-nums;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dt-time-picker__separator {
|
|
21
|
+
align-self: center;
|
|
22
|
+
color: var(--dt-color-text-subtle);
|
|
23
|
+
font-weight: var(--dt-font-weight-semibold);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.dt-time-picker__column {
|
|
27
|
+
position: relative;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
width: 56px;
|
|
30
|
+
height: calc(var(--dt-time-option) * var(--dt-time-rows));
|
|
31
|
+
// Space above and below so the first and last options can scroll to the middle.
|
|
32
|
+
padding-block: calc(var(--dt-time-option) * (var(--dt-time-rows) - 1) / 2);
|
|
33
|
+
overflow-y: auto;
|
|
34
|
+
overscroll-behavior: contain;
|
|
35
|
+
border-radius: var(--dt-radius-sm);
|
|
36
|
+
outline: none;
|
|
37
|
+
scrollbar-width: none;
|
|
38
|
+
scroll-snap-type: y proximity;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dt-time-picker__column::-webkit-scrollbar {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dt-time-picker__column--period {
|
|
46
|
+
width: 64px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dt-time-picker__column:focus-visible {
|
|
50
|
+
outline: var(--dt-focus-ring-width) solid var(--dt-focus-ring-color);
|
|
51
|
+
outline-offset: 1px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dt-time-picker__option {
|
|
55
|
+
display: grid;
|
|
56
|
+
height: var(--dt-time-option);
|
|
57
|
+
place-items: center;
|
|
58
|
+
border-radius: var(--dt-radius-sm);
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
scroll-snap-align: center;
|
|
61
|
+
user-select: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.dt-time-picker__option:hover:not([aria-disabled="true"], .is-selected) {
|
|
65
|
+
background: var(--dt-color-surface-hover);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.dt-time-picker__option.is-selected {
|
|
69
|
+
color: var(--dt-color-primary-on);
|
|
70
|
+
background: var(--dt-color-primary);
|
|
71
|
+
font-weight: var(--dt-font-weight-semibold);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// The focused column's current option gets the ring, since focus sits on the column.
|
|
75
|
+
.dt-time-picker__column:focus-visible .dt-time-picker__option.is-current {
|
|
76
|
+
box-shadow: 0 0 0 2px var(--dt-color-surface), 0 0 0 4px var(--dt-color-primary);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.dt-time-picker__option[aria-disabled="true"] {
|
|
80
|
+
color: var(--dt-color-text-disabled);
|
|
81
|
+
text-decoration: line-through;
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.dt-time-picker.is-disabled {
|
|
86
|
+
opacity: 0.55;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.dt-time-picker.is-disabled .dt-time-picker__option,
|
|
90
|
+
.dt-time-picker.is-readonly .dt-time-picker__option {
|
|
91
|
+
cursor: default;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (forced-colors: active) {
|
|
95
|
+
.dt-time-picker__option.is-selected {
|
|
96
|
+
outline: 2px solid Highlight;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// The keyboard position in a focused column is a box-shadow ring, which forced colors drop; with
|
|
100
|
+
// no value (nothing selected) the column showed no option at all (D32).
|
|
101
|
+
.dt-time-picker__column:focus-visible .dt-time-picker__option.is-current:not(.is-selected) {
|
|
102
|
+
outline: 2px dashed CanvasText;
|
|
103
|
+
outline-offset: -2px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// DTTimeInput: the picker in the DTDateInput dialog, with a Done row.
|
|
108
|
+
.dt-time-input__dialog {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
gap: 8px;
|
|
112
|
+
padding: 8px;
|
|
113
|
+
border: 1px solid var(--dt-color-border);
|
|
114
|
+
border-radius: var(--dt-radius-md);
|
|
115
|
+
background: var(--dt-color-surface-raised);
|
|
116
|
+
box-shadow: var(--dt-shadow-md);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.dt-time-input__dialog .dt-time-picker {
|
|
120
|
+
padding: 0;
|
|
121
|
+
border: 0;
|
|
122
|
+
background: transparent;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.dt-time-input__actions {
|
|
126
|
+
display: flex;
|
|
127
|
+
justify-content: flex-end;
|
|
128
|
+
padding-top: 8px;
|
|
129
|
+
border-top: 1px solid var(--dt-color-border);
|
|
130
|
+
}
|
|
131
|
+
|