@tangible/ui 0.0.21 → 0.1.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/components/Button/Button.js +6 -8
- package/components/Button/types.d.ts +0 -5
- package/components/DatePicker/Calendar.d.ts +12 -0
- package/components/DatePicker/Calendar.js +145 -0
- package/components/DatePicker/DatePicker.d.ts +23 -0
- package/components/DatePicker/DatePicker.js +123 -0
- package/components/DatePicker/DateRangePicker.d.ts +16 -0
- package/components/DatePicker/DateRangePicker.js +114 -0
- package/components/DatePicker/date-utils.d.ts +51 -0
- package/components/DatePicker/date-utils.js +228 -0
- package/components/DatePicker/index.d.ts +8 -0
- package/components/DatePicker/index.js +6 -0
- package/components/DatePicker/presets.d.ts +3 -0
- package/components/DatePicker/presets.js +37 -0
- package/components/DatePicker/types.d.ts +138 -0
- package/components/DatePicker/types.js +39 -0
- package/components/Popover/Popover.js +16 -2
- package/components/SegmentedControl/types.d.ts +2 -2
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/package.json +5 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +384 -47
- package/styles/all.expanded.unlayered.css +384 -47
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +2 -0
- package/styles/components/button.scss +14 -8
- package/styles/components/card.scss +1 -1
- package/styles/components/chip.scss +27 -10
- package/styles/components/date-picker.scss +400 -0
- package/styles/components/icon-button.scss +4 -4
- package/styles/components/notice.scss +15 -6
- package/styles/components/popover.scss +6 -0
- package/styles/components/progress.scss +22 -5
- package/styles/components/segmented-control.scss +13 -1
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/system/_control.scss +9 -8
- package/styles/system/_tokens.scss +3 -0
- package/tui-manifest.json +98 -10
- package/utils/portal.d.ts +0 -4
- package/utils/portal.js +38 -5
package/tui-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0
|
|
3
|
-
"generated": "2026-07-
|
|
2
|
+
"version": "0.1.0",
|
|
3
|
+
"generated": "2026-07-28T18:00:32.949Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"props": {
|
|
@@ -272,12 +272,6 @@
|
|
|
272
272
|
"required": false,
|
|
273
273
|
"description": "Custom right icon element. Overrides rightIconName."
|
|
274
274
|
},
|
|
275
|
-
"iconSize": {
|
|
276
|
-
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
|
|
277
|
-
"required": false,
|
|
278
|
-
"defaultValue": "'sm'",
|
|
279
|
-
"description": "Size of icons."
|
|
280
|
-
},
|
|
281
275
|
"className": {
|
|
282
276
|
"type": "string",
|
|
283
277
|
"required": false,
|
|
@@ -320,6 +314,7 @@
|
|
|
320
314
|
"--tui-button-border-interact",
|
|
321
315
|
"--tui-button-fg-active",
|
|
322
316
|
"--tui-button-icon-scale",
|
|
317
|
+
"--tui-control-height-xs",
|
|
323
318
|
"--tui-control-height-sm",
|
|
324
319
|
"--tui-control-height-md",
|
|
325
320
|
"--tui-control-height-lg"
|
|
@@ -954,6 +949,93 @@
|
|
|
954
949
|
"use": null,
|
|
955
950
|
"notFor": null
|
|
956
951
|
},
|
|
952
|
+
"DatePicker": {
|
|
953
|
+
"props": {
|
|
954
|
+
"min": {
|
|
955
|
+
"type": "Date",
|
|
956
|
+
"required": false,
|
|
957
|
+
"description": "Earliest selectable day (inclusive, time-of-day ignored)."
|
|
958
|
+
},
|
|
959
|
+
"max": {
|
|
960
|
+
"type": "Date",
|
|
961
|
+
"required": false,
|
|
962
|
+
"description": "Latest selectable day (inclusive, time-of-day ignored)."
|
|
963
|
+
},
|
|
964
|
+
"isDayDisabled": {
|
|
965
|
+
"type": "(day: Date) => boolean",
|
|
966
|
+
"required": false,
|
|
967
|
+
"description": "Per-day disable hook, applied on top of min/max."
|
|
968
|
+
},
|
|
969
|
+
"weekStartsOn": {
|
|
970
|
+
"type": "0 | 1 | 2 | 3 | 4 | 5 | 6",
|
|
971
|
+
"required": false,
|
|
972
|
+
"defaultValue": "1",
|
|
973
|
+
"description": "First day of the week. 0 = Sunday … 6 = Saturday."
|
|
974
|
+
},
|
|
975
|
+
"locale": {
|
|
976
|
+
"type": "string",
|
|
977
|
+
"required": false,
|
|
978
|
+
"defaultValue": "the document language, falling back to 'en-US'",
|
|
979
|
+
"description": "BCP 47 locale for month/weekday names and numeric formats."
|
|
980
|
+
},
|
|
981
|
+
"onChange": {
|
|
982
|
+
"type": "(value: Date) => void",
|
|
983
|
+
"required": false
|
|
984
|
+
},
|
|
985
|
+
"withTime": {
|
|
986
|
+
"type": "boolean",
|
|
987
|
+
"required": false,
|
|
988
|
+
"defaultValue": "false",
|
|
989
|
+
"description": "Include the time field (and format the trigger with time)."
|
|
990
|
+
},
|
|
991
|
+
"hour12": {
|
|
992
|
+
"type": "boolean",
|
|
993
|
+
"required": false,
|
|
994
|
+
"defaultValue": "true",
|
|
995
|
+
"description": "12-hour time UI with an AM/PM toggle."
|
|
996
|
+
},
|
|
997
|
+
"zoneLabel": {
|
|
998
|
+
"type": "ReactNode",
|
|
999
|
+
"required": false,
|
|
1000
|
+
"description": "Display-only zone badge next to the time field, e.g. \"UTC+0\"."
|
|
1001
|
+
},
|
|
1002
|
+
"disabled": {
|
|
1003
|
+
"type": "boolean",
|
|
1004
|
+
"required": false
|
|
1005
|
+
},
|
|
1006
|
+
"className": {
|
|
1007
|
+
"type": "string",
|
|
1008
|
+
"required": false
|
|
1009
|
+
},
|
|
1010
|
+
"id": {
|
|
1011
|
+
"type": "string",
|
|
1012
|
+
"required": false
|
|
1013
|
+
}
|
|
1014
|
+
},
|
|
1015
|
+
"cssTokens": [
|
|
1016
|
+
"--tui-calendar-cell-size",
|
|
1017
|
+
"--tui-calendar-cell-radius",
|
|
1018
|
+
"--tui-calendar-selected-bg",
|
|
1019
|
+
"--tui-calendar-selected-fg",
|
|
1020
|
+
"--tui-calendar-range-bg",
|
|
1021
|
+
"--tui-calendar-today-bg",
|
|
1022
|
+
"--tui-calendar-caption-color",
|
|
1023
|
+
"--tui-date-picker-width"
|
|
1024
|
+
],
|
|
1025
|
+
"story": {
|
|
1026
|
+
"title": "Forms/DatePicker",
|
|
1027
|
+
"tags": [
|
|
1028
|
+
"autodocs"
|
|
1029
|
+
]
|
|
1030
|
+
},
|
|
1031
|
+
"subcomponents": null,
|
|
1032
|
+
"description": null,
|
|
1033
|
+
"gotchas": null,
|
|
1034
|
+
"examples": null,
|
|
1035
|
+
"related": null,
|
|
1036
|
+
"use": null,
|
|
1037
|
+
"notFor": null
|
|
1038
|
+
},
|
|
957
1039
|
"Dropdown": {
|
|
958
1040
|
"props": {
|
|
959
1041
|
"open": {
|
|
@@ -1575,6 +1657,7 @@
|
|
|
1575
1657
|
"cssTokens": [
|
|
1576
1658
|
"--tui-notice-bg",
|
|
1577
1659
|
"--tui-notice-border",
|
|
1660
|
+
"--tui-notice-border-width",
|
|
1578
1661
|
"--tui-notice-stripe",
|
|
1579
1662
|
"--tui-notice-stripe-width",
|
|
1580
1663
|
"--tui-notice-fg",
|
|
@@ -1900,7 +1983,12 @@
|
|
|
1900
1983
|
"--tui-progress-z2-fill",
|
|
1901
1984
|
"--tui-progress-z3-fill",
|
|
1902
1985
|
"--tui-progress-z4-fill",
|
|
1903
|
-
"--tui-progress-z5-fill"
|
|
1986
|
+
"--tui-progress-z5-fill",
|
|
1987
|
+
"--tui-progress-z1-label",
|
|
1988
|
+
"--tui-progress-z2-label",
|
|
1989
|
+
"--tui-progress-z3-label",
|
|
1990
|
+
"--tui-progress-z4-label",
|
|
1991
|
+
"--tui-progress-z5-label"
|
|
1904
1992
|
],
|
|
1905
1993
|
"story": {
|
|
1906
1994
|
"title": "Primitives/Progress",
|
|
@@ -2067,7 +2155,7 @@
|
|
|
2067
2155
|
"description": "Visual style"
|
|
2068
2156
|
},
|
|
2069
2157
|
"size": {
|
|
2070
|
-
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
2158
|
+
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
|
|
2071
2159
|
"required": false,
|
|
2072
2160
|
"description": "Size scale"
|
|
2073
2161
|
},
|
package/utils/portal.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets or creates a portal root inside the first .tui-interface.
|
|
3
|
-
* If no interface wrapper exists, creates a global one at body level.
|
|
4
|
-
*/
|
|
5
1
|
export declare function getPortalRoot(): HTMLElement;
|
|
6
2
|
/**
|
|
7
3
|
* Gets portal root for a specific element (finds its nearest .tui-interface ancestor).
|
package/utils/portal.js
CHANGED
|
@@ -34,6 +34,11 @@ const GLOBAL_INTERFACE_ID = `${PREFIX}-global-interface`;
|
|
|
34
34
|
/**
|
|
35
35
|
* Gets or creates a global .tui-interface wrapper at body level.
|
|
36
36
|
* Used as fallback when no interface wrapper exists in the DOM.
|
|
37
|
+
*
|
|
38
|
+
* The fallback mirrors the host's `data-theme` (body, then html) at creation
|
|
39
|
+
* time so portaled content doesn't render light-mode inside a dark host —
|
|
40
|
+
* this is a snapshot, not a live sync; hosts that switch theme after mount
|
|
41
|
+
* should render a real .tui-interface instead of relying on the fallback.
|
|
37
42
|
*/
|
|
38
43
|
function getOrCreateGlobalInterface() {
|
|
39
44
|
let globalInterface = document.getElementById(GLOBAL_INTERFACE_ID);
|
|
@@ -41,6 +46,10 @@ function getOrCreateGlobalInterface() {
|
|
|
41
46
|
globalInterface = document.createElement('div');
|
|
42
47
|
globalInterface.id = GLOBAL_INTERFACE_ID;
|
|
43
48
|
globalInterface.className = INTERFACE_CLASS;
|
|
49
|
+
const theme = document.body.getAttribute('data-theme') ??
|
|
50
|
+
document.documentElement.getAttribute('data-theme');
|
|
51
|
+
if (theme)
|
|
52
|
+
globalInterface.setAttribute('data-theme', theme);
|
|
44
53
|
document.body.appendChild(globalInterface);
|
|
45
54
|
}
|
|
46
55
|
return globalInterface;
|
|
@@ -49,9 +58,32 @@ function getOrCreateGlobalInterface() {
|
|
|
49
58
|
* Gets or creates a portal root inside the first .tui-interface.
|
|
50
59
|
* If no interface wrapper exists, creates a global one at body level.
|
|
51
60
|
*/
|
|
61
|
+
/**
|
|
62
|
+
* A root created against the global fallback goes stale the moment a real
|
|
63
|
+
* interface exists (render-phase calls can beat the first commit,
|
|
64
|
+
* manufacturing the fallback next to a perfectly good interface). Re-home
|
|
65
|
+
* the root — moving the node keeps any mounted portals attached — and drop
|
|
66
|
+
* the empty fallback. Runs cheaply on every resolution.
|
|
67
|
+
*/
|
|
68
|
+
function reconcileFallback() {
|
|
69
|
+
const fallback = document.getElementById(GLOBAL_INTERFACE_ID);
|
|
70
|
+
if (!fallback)
|
|
71
|
+
return;
|
|
72
|
+
const real = document.querySelector(`.${INTERFACE_CLASS}:not(#${GLOBAL_INTERFACE_ID})`);
|
|
73
|
+
if (!real)
|
|
74
|
+
return;
|
|
75
|
+
const strandedRoot = fallback.querySelector(`[id^="${PORTAL_ID}"]`);
|
|
76
|
+
if (strandedRoot) {
|
|
77
|
+
real.appendChild(strandedRoot);
|
|
78
|
+
portalRoots.set(real, strandedRoot);
|
|
79
|
+
}
|
|
80
|
+
if (fallback.childElementCount === 0)
|
|
81
|
+
fallback.remove();
|
|
82
|
+
}
|
|
52
83
|
export function getPortalRoot() {
|
|
84
|
+
reconcileFallback();
|
|
53
85
|
// Check if we already have a global portal root
|
|
54
|
-
|
|
86
|
+
const portalRoot = document.getElementById(PORTAL_ID);
|
|
55
87
|
if (portalRoot)
|
|
56
88
|
return portalRoot;
|
|
57
89
|
// Find the interface wrapper, or create global fallback
|
|
@@ -60,10 +92,10 @@ export function getPortalRoot() {
|
|
|
60
92
|
interfaceEl = getOrCreateGlobalInterface();
|
|
61
93
|
}
|
|
62
94
|
// Create portal root inside the interface
|
|
63
|
-
|
|
64
|
-
interfaceEl.appendChild(
|
|
65
|
-
portalRoots.set(interfaceEl,
|
|
66
|
-
return
|
|
95
|
+
const created = createPortalRoot(PORTAL_ID);
|
|
96
|
+
interfaceEl.appendChild(created);
|
|
97
|
+
portalRoots.set(interfaceEl, created);
|
|
98
|
+
return created;
|
|
67
99
|
}
|
|
68
100
|
/**
|
|
69
101
|
* Gets portal root for a specific element (finds its nearest .tui-interface ancestor).
|
|
@@ -71,6 +103,7 @@ export function getPortalRoot() {
|
|
|
71
103
|
* Always returns a valid portal root inside .tui-interface scope.
|
|
72
104
|
*/
|
|
73
105
|
export function getPortalRootFor(element) {
|
|
106
|
+
reconcileFallback();
|
|
74
107
|
if (!element)
|
|
75
108
|
return getPortalRoot();
|
|
76
109
|
// Find nearest interface ancestor
|