Initial commit: HMDesignSystem baseline
This commit is contained in:
commit
b6a0a61103
486 files changed
+68432
No files matched your search
@@ -0,0 +1,89 @@
|
||||
/* Date Picker mapping. ui-viz lists Date Picker by name only (no spec), so these are current HM values built from the HM Semantic /
|
||||
Primitive tokens. Date Picker is a composition (Popover + Calendar): the popup surface comes from Popover and the calendar from
|
||||
Calendar, so only the trigger (a field, in the two Select sizes) is styled here. The Popover padding / width are overridden per
|
||||
instance through an inline style in the component (the popup hugs the Calendar, which has its own padding).
|
||||
The trigger look is in `@layer components` so a consumer's utility classes (width, height) still win. Nothing here references
|
||||
Button / Input / Select / Popover tokens. */
|
||||
:root, [data-hm-theme] {
|
||||
/* Inner heights; the 1px border is added around them (outer 34 / 44), like the Select trigger. */
|
||||
--hm-date-picker-height-md: 32px;
|
||||
--hm-date-picker-height-lg: 42px;
|
||||
--hm-date-picker-border-width: 1px;
|
||||
--hm-date-picker-padding-x: 12px;
|
||||
--hm-date-picker-gap: 12px;
|
||||
--hm-date-picker-radius: var(--hm-radius-control-md);
|
||||
--hm-date-picker-font-size-md: 14px;
|
||||
--hm-date-picker-line-height-md: 20px;
|
||||
--hm-date-picker-font-size-lg: 16px;
|
||||
--hm-date-picker-line-height-lg: 24px;
|
||||
|
||||
--hm-date-picker-background: var(--hm-sem-bg-surface);
|
||||
--hm-date-picker-text: var(--hm-sem-fg-primary);
|
||||
--hm-date-picker-placeholder: var(--hm-sem-fg-placeholder);
|
||||
--hm-date-picker-border-color: var(--hm-sem-stroke-input-default);
|
||||
--hm-date-picker-focus-border-color: var(--hm-sem-stroke-input-focus);
|
||||
--hm-date-picker-icon-size: 18px;
|
||||
--hm-date-picker-icon-color: var(--hm-sem-fg-secondary);
|
||||
|
||||
/* Current HM value for this component only; not a global Disabled rule. */
|
||||
--hm-date-picker-disabled-opacity: 0.6;
|
||||
}
|
||||
|
||||
@layer components {
|
||||
[data-slot="date-picker-trigger"] {
|
||||
--hm-date-picker-height: var(--hm-date-picker-height-lg);
|
||||
--hm-date-picker-font-size: var(--hm-date-picker-font-size-lg);
|
||||
--hm-date-picker-line-height: var(--hm-date-picker-line-height-lg);
|
||||
box-sizing: border-box;
|
||||
min-width: 0; /* lets a long value truncate instead of widening a grid / flex parent */
|
||||
max-width: 100%;
|
||||
min-height: calc(var(--hm-date-picker-height) + 2 * var(--hm-date-picker-border-width));
|
||||
gap: var(--hm-date-picker-gap);
|
||||
padding: 0 var(--hm-date-picker-padding-x);
|
||||
border: var(--hm-date-picker-border-width) solid var(--hm-date-picker-border-color);
|
||||
border-radius: var(--hm-date-picker-radius);
|
||||
background: var(--hm-date-picker-background);
|
||||
color: var(--hm-date-picker-text);
|
||||
font-size: var(--hm-date-picker-font-size);
|
||||
line-height: var(--hm-date-picker-line-height);
|
||||
font-weight: 400;
|
||||
cursor: pointer;
|
||||
}
|
||||
[data-slot="date-picker-trigger"][data-size="medium"] {
|
||||
--hm-date-picker-height: var(--hm-date-picker-height-md);
|
||||
--hm-date-picker-font-size: var(--hm-date-picker-font-size-md);
|
||||
--hm-date-picker-line-height: var(--hm-date-picker-line-height-md);
|
||||
}
|
||||
[data-slot="date-picker-trigger"][data-empty] [data-slot="date-picker-value"] {
|
||||
color: var(--hm-date-picker-placeholder);
|
||||
}
|
||||
[data-slot="date-picker-value"] {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
[data-slot="date-picker-icon"] {
|
||||
flex-shrink: 0;
|
||||
width: var(--hm-date-picker-icon-size);
|
||||
height: var(--hm-date-picker-icon-size);
|
||||
color: var(--hm-date-picker-icon-color);
|
||||
}
|
||||
/* Focus and open: the whole outline turns to the focus color (no ring, like the Input / Select focus). */
|
||||
[data-slot="date-picker-trigger"]:focus-visible,
|
||||
[data-slot="date-picker-trigger"][data-state="open"] {
|
||||
border-color: var(--hm-date-picker-focus-border-color);
|
||||
}
|
||||
/* Existing native aria-invalid is the source; Calendar selection/focus remains independent. */
|
||||
[data-slot="date-picker-trigger"][aria-invalid="true"] {
|
||||
border-color: var(--hm-sem-action-destructive);
|
||||
}
|
||||
[data-slot="date-picker-trigger"][aria-invalid="true"]:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
|
||||
}
|
||||
[data-slot="date-picker-trigger"]:disabled {
|
||||
opacity: var(--hm-date-picker-disabled-opacity);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user