@djangocfg/ui-core 2.1.512 → 2.1.514
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/README.md +5 -3
- package/package.json +4 -4
- package/src/components/data/calendar/calendar.tsx +38 -6
- package/src/components/data/table/index.tsx +8 -1
- package/src/components/forms/checkbox/index.tsx +3 -1
- package/src/components/forms/datetime-field/README.md +80 -0
- package/src/components/forms/datetime-field/date-field.tsx +165 -0
- package/src/components/forms/datetime-field/date-time-field.tsx +214 -0
- package/src/components/forms/datetime-field/date-time-utils.ts +48 -0
- package/src/components/forms/datetime-field/index.ts +30 -0
- package/src/components/forms/datetime-field/native-field-shell.tsx +113 -0
- package/src/components/forms/datetime-field/popover-chevron.tsx +66 -0
- package/src/components/forms/datetime-field/time-field.tsx +103 -0
- package/src/components/forms/label/index.tsx +9 -1
- package/src/components/forms/radio-group/index.tsx +3 -1
- package/src/components/forms/switch/index.tsx +3 -1
- package/src/components/index.ts +21 -1
- package/src/components/overlay/popover/index.tsx +7 -0
- package/src/styles/css/presets/dense.css +13 -2
- package/src/styles/css/presets/ios.css +17 -3
- package/src/styles/css/presets/macos.css +17 -3
- package/src/styles/css/presets/soft.css +12 -2
- package/src/styles/css/presets/windows.css +12 -2
- package/src/styles/css/theme/dark.css +12 -2
- package/src/styles/css/utilities/datetime-field.css +65 -0
- package/src/styles/css/utilities.css +1 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native date/time field — chrome suppression.
|
|
3
|
+
*
|
|
4
|
+
* The native-engine fields (`DateField` / `TimeField` / `DateTimeField`) use a
|
|
5
|
+
* real `<input type="date|time|datetime-local">` as the input engine and wrap it
|
|
6
|
+
* in `NativeFieldShell`, which supplies OUR icon and OUR popover. So the
|
|
7
|
+
* browser's built-in indicator glyph and inner spin buttons must be hidden —
|
|
8
|
+
* otherwise there are two icons and a double-picker.
|
|
9
|
+
*
|
|
10
|
+
* The `.native-datetime-input` class is applied by the field to the raw input.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
.native-datetime-input::-webkit-calendar-picker-indicator {
|
|
14
|
+
/* Kill the browser clock/calendar button entirely. We suppress it rather than
|
|
15
|
+
* repurpose it because clicking it opens the OS picker, which would race our
|
|
16
|
+
* own popover. Our leading icon / chevron drives our popover instead. */
|
|
17
|
+
display: none;
|
|
18
|
+
-webkit-appearance: none;
|
|
19
|
+
appearance: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.native-datetime-input::-webkit-inner-spin-button,
|
|
23
|
+
.native-datetime-input::-webkit-outer-spin-button {
|
|
24
|
+
display: none;
|
|
25
|
+
-webkit-appearance: none;
|
|
26
|
+
appearance: none;
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Firefox draws a clear ("×") button on filled date inputs — hide it so the
|
|
31
|
+
* clearing affordance stays inside our own UI, consistent across browsers. */
|
|
32
|
+
.native-datetime-input::-moz-clear {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Segment text follows the active theme. (No blanket `padding:0` here — the
|
|
37
|
+
* in-shell inputs already sit flush via their own flex layout, and the standalone
|
|
38
|
+
* time input in the DateTimeField popover NEEDS its px-* padding; a global reset
|
|
39
|
+
* would fight it.) */
|
|
40
|
+
.native-datetime-input {
|
|
41
|
+
color-scheme: light dark;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Horizontal centering of a native time/date input's VALUE.
|
|
45
|
+
*
|
|
46
|
+
* `text-align: center` on the input alone does NOT center a `type="time"` value:
|
|
47
|
+
* the value is a group of segments (HH, MM, …) the browser lays out inside
|
|
48
|
+
* `::-webkit-datetime-edit`, which is left-aligned and only as wide as its
|
|
49
|
+
* content. The reliable cross-engine fix (verified against MDN + WebKit
|
|
50
|
+
* internals) is to make the INPUT ITSELF a centering flex container — that
|
|
51
|
+
* centers `::-webkit-datetime-edit` as a flex child regardless of text-align —
|
|
52
|
+
* and keep `text-align:center` for Firefox (which ignores `::-webkit-*` and
|
|
53
|
+
* renders the value as plain inline text). Opt in with
|
|
54
|
+
* `.native-datetime-input--center`. */
|
|
55
|
+
.native-datetime-input--center {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
text-align: center; /* Firefox path */
|
|
59
|
+
}
|
|
60
|
+
.native-datetime-input--center::-webkit-datetime-edit {
|
|
61
|
+
text-align: center; /* Chrome/Safari: centers the segment group */
|
|
62
|
+
}
|
|
63
|
+
.native-datetime-input--center::-webkit-datetime-edit-fields-wrapper {
|
|
64
|
+
justify-content: center; /* belt-and-braces for older Safari */
|
|
65
|
+
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
@import './utilities/divider.css';
|
|
11
11
|
@import './utilities/overlay.css';
|
|
12
12
|
@import './utilities/controls.css';
|
|
13
|
+
@import './utilities/datetime-field.css';
|
|
13
14
|
@import './utilities/step.css';
|
|
14
15
|
@import './utilities/animations.css';
|
|
15
16
|
@import './utilities/glass.css';
|