@gravionlabs/helix-ui 22.8.0 → 22.9.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/package.json CHANGED
@@ -61,5 +61,5 @@
61
61
  "./core.css": "./core.css",
62
62
  "./tokens.css": "./tokens.css"
63
63
  },
64
- "version": "22.8.0"
64
+ "version": "22.9.0"
65
65
  }
package/styles.css CHANGED
@@ -3124,6 +3124,69 @@
3124
3124
  }
3125
3125
  }
3126
3126
 
3127
+ /* field */
3128
+ /*
3129
+ * Form field: `<hx-field>`, a column of label, control, hint and error. A checkbox, radio or switch stands
3130
+ * before its label on one line. Type scale and spacing tokens; the colours are the semantic text and form
3131
+ * field tokens.
3132
+ */
3133
+ .hx-field {
3134
+ display: grid;
3135
+ grid-template-columns: minmax(0, 1fr);
3136
+ row-gap: var(--h-space-1);
3137
+ }
3138
+
3139
+ .hx-field-label {
3140
+ font-size: var(--h-font-size-sm);
3141
+ font-weight: 500;
3142
+ }
3143
+
3144
+ .hx-field-required {
3145
+ color: var(--h-form-field-invalid-placeholder-color);
3146
+ }
3147
+
3148
+ .hx-field-control {
3149
+ display: flex;
3150
+ flex-direction: column;
3151
+ align-items: flex-start;
3152
+ min-width: 0;
3153
+ }
3154
+
3155
+ .hx-field-control > :is(.hx-input, .hx-select) {
3156
+ align-self: stretch;
3157
+ }
3158
+
3159
+ .hx-field-hint {
3160
+ color: var(--h-text-muted-color);
3161
+ font-size: var(--h-font-size-sm);
3162
+ }
3163
+
3164
+ .hx-field-error {
3165
+ color: var(--h-form-field-invalid-placeholder-color);
3166
+ font-size: var(--h-font-size-sm);
3167
+ }
3168
+
3169
+ /* the empty live region stays in the accessibility tree but takes no room, not even a gap */
3170
+ .hx-field-error:not(.hx-field-error-shown) {
3171
+ position: absolute;
3172
+ }
3173
+
3174
+ /* checkbox, radio, switch: control and label on one line, the texts below */
3175
+ .hx-field:has(> .hx-field-control > :is(.hx-checkbox, .hx-radio, .hx-switch)) {
3176
+ grid-template-columns: auto minmax(0, 1fr);
3177
+ align-items: center;
3178
+ column-gap: var(--h-space-2);
3179
+ }
3180
+ .hx-field:has(> .hx-field-control > :is(.hx-checkbox, .hx-radio, .hx-switch)) > .hx-field-control {
3181
+ grid-area: 1/1;
3182
+ }
3183
+ .hx-field:has(> .hx-field-control > :is(.hx-checkbox, .hx-radio, .hx-switch)) > .hx-field-label {
3184
+ grid-area: 1/2;
3185
+ }
3186
+ .hx-field:has(> .hx-field-control > :is(.hx-checkbox, .hx-radio, .hx-switch)) > :is(.hx-field-hint, .hx-field-error) {
3187
+ grid-column: 1/-1;
3188
+ }
3189
+
3127
3190
  /* fieldset */
3128
3191
  /*
3129
3192
  * Fieldset: `<hx-fieldset>`. A native fieldset and legend from the `--h-fieldset-*` tokens; a toggleable legend is a
@@ -4518,6 +4581,116 @@
4518
4581
  margin-inline-start: 0.5rem;
4519
4582
  }
4520
4583
 
4584
+ /* list */
4585
+ /*
4586
+ * List and list rows: `<hx-list>` with `[hx-list-row]` buttons and links, from the `--h-list-row-*` tokens. A row
4587
+ * holds a leading `.hx-list-row-icon`, a `.hx-list-row-label` that truncates and a trailing `.hx-list-row-meta`
4588
+ * (text or badge). The tokens are rem based, so the compact density scales the rows.
4589
+ */
4590
+ .hx-list {
4591
+ display: flex;
4592
+ flex-direction: column;
4593
+ gap: var(--h-list-row-list-gap);
4594
+ min-width: 0;
4595
+ }
4596
+
4597
+ .hx-list-row {
4598
+ display: flex;
4599
+ flex: none;
4600
+ align-items: center;
4601
+ gap: var(--h-list-row-gap);
4602
+ box-sizing: border-box;
4603
+ width: 100%;
4604
+ min-width: 0;
4605
+ margin: 0;
4606
+ padding: var(--h-list-row-padding-y) var(--h-list-row-padding-x);
4607
+ border: 0 none;
4608
+ border-radius: var(--h-list-row-border-radius);
4609
+ background: var(--h-list-row-background);
4610
+ color: var(--h-list-row-color);
4611
+ font: inherit;
4612
+ font-size: var(--h-list-row-font-size);
4613
+ text-align: start;
4614
+ text-decoration: none;
4615
+ cursor: pointer;
4616
+ }
4617
+
4618
+ /* the author `display` above would otherwise win over the `hidden` attribute */
4619
+ .hx-list-row[hidden] {
4620
+ display: none;
4621
+ }
4622
+
4623
+ :where(.hx-list-row-icon) {
4624
+ flex: none;
4625
+ color: var(--h-list-row-icon-color);
4626
+ }
4627
+
4628
+ .hx-list-row-label {
4629
+ flex: 1;
4630
+ min-width: 0;
4631
+ overflow: hidden;
4632
+ text-overflow: ellipsis;
4633
+ white-space: nowrap;
4634
+ }
4635
+
4636
+ /* no specificity (`:where`), so a badge or tag used as the meta keeps its own colour and size */
4637
+ :where(.hx-list-row-meta) {
4638
+ flex: none;
4639
+ margin-inline-start: auto;
4640
+ color: var(--h-list-row-meta-color);
4641
+ font-size: var(--h-list-row-meta-font-size);
4642
+ }
4643
+
4644
+ .hx-list-row:hover {
4645
+ background: var(--h-list-row-hover-background);
4646
+ color: var(--h-list-row-hover-color);
4647
+ }
4648
+
4649
+ /* current: an accent bar at the start edge and a heavier label */
4650
+ .hx-list-row-current {
4651
+ background: var(--h-list-row-current-background);
4652
+ color: var(--h-list-row-current-color);
4653
+ box-shadow: inset var(--h-list-row-current-indicator-width) 0 0 var(--h-list-row-current-indicator-color);
4654
+ font-weight: var(--h-list-row-current-font-weight);
4655
+ }
4656
+
4657
+ .hx-list-row-current:dir(rtl) {
4658
+ box-shadow: inset calc(-1 * var(--h-list-row-current-indicator-width)) 0 0 var(--h-list-row-current-indicator-color);
4659
+ }
4660
+
4661
+ .hx-list-row-selected {
4662
+ background: var(--h-list-row-selected-background);
4663
+ color: var(--h-list-row-selected-color);
4664
+ }
4665
+
4666
+ .hx-list-row-selected:hover {
4667
+ background: var(--h-list-row-selected-hover-background);
4668
+ color: var(--h-list-row-selected-hover-color);
4669
+ }
4670
+
4671
+ /* on a state background the muted colours would lose contrast: icon and meta follow the row */
4672
+ :where(.hx-list-row:is(:hover, .hx-list-row-current, .hx-list-row-selected)) > :where(.hx-list-row-icon, .hx-list-row-meta) {
4673
+ color: inherit;
4674
+ }
4675
+
4676
+ .hx-list-row:focus-visible {
4677
+ outline: var(--h-list-row-focus-ring-width) var(--h-list-row-focus-ring-style) var(--h-list-row-focus-ring-color);
4678
+ outline-offset: var(--h-list-row-focus-ring-offset);
4679
+ }
4680
+
4681
+ .hx-list-row:disabled,
4682
+ .hx-list-row[aria-disabled=true] {
4683
+ opacity: var(--h-list-row-disabled-opacity);
4684
+ cursor: default;
4685
+ pointer-events: none;
4686
+ }
4687
+
4688
+ @media (forced-colors: active) {
4689
+ .hx-list-row-selected {
4690
+ border: 1px solid Highlight;
4691
+ }
4692
+ }
4693
+
4521
4694
  /* listbox */
4522
4695
  /*
4523
4696
  * Listbox: `<hx-listbox>`. An inline list of options in a bordered box from the `--h-listbox-*` tokens, with an