@swiftwc/ui 1.0.0-canary.2 → 1.0.0-canary.4

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.
@@ -24,6 +24,19 @@ export class Snapshot {
24
24
  static get config() {
25
25
  return this.#config;
26
26
  }
27
+ static async mock() {
28
+ this.#config = {
29
+ 'delete-button-icon': 'trash',
30
+ 'confirm-button-icon': 'check',
31
+ 'close-button-icon': 'x',
32
+ 'cancel-button-icon': 'x',
33
+ 'ipad-sheet-view-height': '27.75rem',
34
+ 'ipad-sheet-view-inline-size': '37rem',
35
+ 'vt-fwd-class-name': 'fwd',
36
+ };
37
+ this.#postSet();
38
+ debug(this.#config);
39
+ }
27
40
  static async setOwnConfig() {
28
41
  if (!this.#readyCalled)
29
42
  this.#readyCalled = true;
@@ -39,6 +52,9 @@ export class Snapshot {
39
52
  catch {
40
53
  console.error('could-not-parse-config');
41
54
  }
55
+ this.#postSet();
56
+ }
57
+ static #postSet() {
42
58
  for (const off of this.#listeners ?? [])
43
59
  off?.();
44
60
  this.#listeners = new Set();
package/html-data/en.json CHANGED
@@ -657,7 +657,7 @@
657
657
  "description": "Value Type: boolean"
658
658
  }
659
659
  ],
660
- "description": "A control that selects one value from a set of options.\n---\n\n```ts\ninterface PickerViewSignature {\n Attributes: {\n 'label-value-placement'?: 'vertical' | 'horizontal' | 'auto'\n 'horizontal-radio-group-layout'?: boolean\n prompt?: string\n 'prompt-icon'?: string\n label?: string\n name?: string\n 'picker-style'?:\n | 'menu'\n | 'inline'\n | 'navigation-link'\n | 'sheet'\n | 'automatic'\n selection?: string\n searchable?: boolean\n 'current-value-label'?: string\n 'current-value-icon'?: string\n help?: string // Adds a help tooltip to the trigger of the picker, if style supports one\n dictionary?: Array<DictEntry> // Renders all options using this array\n required?: boolean\n }\n\n Slots: {\n default: HTMLElement[] // The default slot\n label: HTMLElement[]\n list: HTMLElement[]\n 'validity-options': HTMLOptionElement[]\n }\n}\n\nclass PickerView extends HTMLElement<PickerViewSignature> {\n static formAssociated = true\n\n selection: string\n readonly template: DocumentFragment\n readonly pickerStyle:\n | 'automatic'\n | 'menu'\n | 'inline'\n | 'navigation-link'\n | 'sheet'\n | 'radio-group'\n readonly name: string // Form participation property\n\n setValidity(): void\n setCustomValidity(): void\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'picker-view': PickerView // <picker-view></picker-view>\n }\n}\n\n```\n"
660
+ "description": "A control that selects one value from a set of options.\n---\n\n```ts\ninterface PickerViewSignature {\n Attributes: {\n 'label-value-placement'?: 'vertical' | 'horizontal' | 'auto'\n 'horizontal-radio-group-layout'?: boolean\n prompt?: string\n 'prompt-icon'?: string\n label?: string\n name?: string\n 'picker-style'?:\n | 'menu'\n | 'inline'\n | 'navigation-link'\n | 'sheet'\n | 'automatic'\n selection?: string\n searchable?: boolean\n 'current-value-label'?: string\n 'current-value-icon'?: string\n help?: string // Adds a help tooltip to the trigger of the picker, if style supports one\n dictionary?: Array<DictEntry> // Renders all options using this array\n required?: boolean\n }\n\n Slots: {\n default: HTMLElement[] // The default slot\n label: HTMLElement[]\n list: HTMLElement[]\n 'validity-options': HTMLOptionElement[]\n }\n}\n\nclass PickerView extends HTMLElement<PickerViewSignature> {\n static formAssociated = true\n\n selection: string\n readonly template: DocumentFragment\n readonly pickerStyle:\n | 'automatic'\n | 'menu'\n | 'inline'\n | 'navigation-link'\n | 'sheet'\n | 'radio-group'\n | 'palette'\n | 'segmented'\n readonly name: string // Form participation property\n\n setValidity(): void\n setCustomValidity(): void\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'picker-view': PickerView // <picker-view></picker-view>\n }\n}\n\n```\n"
661
661
  },
662
662
  {
663
663
  "name": "plain-button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftwc/ui",
3
- "version": "1.0.0-canary.2",
3
+ "version": "1.0.0-canary.4",
4
4
  "description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -59,8 +59,6 @@
59
59
  "swiftwc": "./generated/index.js"
60
60
  },
61
61
  "scripts": {
62
- "typecheck": "tsc --noEmit && sass --no-source-map scss/index.scss > /dev/null",
63
- "typecheck:scripts": "tsc -p tsconfig.scripts.json --noEmit",
64
62
  "prebuild": "rm -rf generated",
65
63
  "build": "npm run build:ts && npm run build:scss && npm run debug:off",
66
64
  "build:ts": "tsc",
@@ -79,9 +77,11 @@
79
77
  "codegen:barrelize:morphdom": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/morphdom --exclude \".\\.test\\.ts\"",
80
78
  "codegen:barrelize:decorators": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/internal/decorators --exclude \".\\.test\\.ts\"",
81
79
  "codegen:barrelize:utils": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/internal/utils --exclude \".\\.test\\.ts\"",
82
- "verify": "npm run codegen && npm run typecheck && npm run format:write && vitest run --dom",
83
- "format:check": "prettier . --check",
84
- "format:write": "prettier . --write",
80
+ "verify": "npm run codegen && npm run lint:types && npm run format && vitest run --dom",
81
+ "lint": "prettier . --check",
82
+ "lint:types": "tsc --noEmit && sass --no-source-map scss/index.scss > /dev/null",
83
+ "lint:types:scripts": "tsc -p tsconfig.scripts.json --noEmit",
84
+ "format": "prettier . --write",
85
85
  "test": "vitest --dom",
86
86
  "version:pkg": "npm version $npm_config_bump --no-git-tag-version --preid=dev"
87
87
  },
package/scss/_maps.scss CHANGED
@@ -1,4 +1,4 @@
1
- $picker-styles-names: menu, navigation-link, sheet, radio-group;
1
+ $picker-styles-names: menu, navigation-link, sheet, radio-group, palette, segmented;
2
2
  $label-styles-names: icon-only, title-only, title-and-icon;
3
3
  $list-styles-names: inset, inset-grouped, sidebar;
4
4
  $form-styles-names: inset, inset-grouped, sidebar;
@@ -244,6 +244,13 @@
244
244
 
245
245
  --toggle-dot-box-shadow: var(--control-clear-glass-box-shadow);
246
246
 
247
+ --segented-picker-track-bg: red;
248
+ --segented-picker-track-border-radius: var(--pill-border-radius);
249
+ --segented-picker-track-block-size: 3rem;
250
+ --segented-picker-track-padding-inline: 0.1rem;
251
+ --segented-picker-track-padding-block: 0.1rem;
252
+ --segented-picker-button-min-inline-size: 3rem;
253
+
247
254
  // @media (prefers-color-scheme: dark) {
248
255
  // @include dark-theme;
249
256
  // }
@@ -7,6 +7,8 @@
7
7
  :where(&) {
8
8
  container: labeled-content / inline-size;
9
9
 
10
+ --labeled-content--labelstack-place-items: start;
11
+
10
12
  &::part(labeled-content-container) {
11
13
  grid-template-columns: subgrid;
12
14
 
@@ -16,7 +18,7 @@
16
18
  &::part(labeled-content-stack) {
17
19
  display: flex;
18
20
 
19
- flex-flow: var(--labeled-content--value-stack-flex-flow, row wrap);
21
+ flex-flow: var(--labeled-content--valuestack-flex-flow, row wrap);
20
22
  // flex-wrap: wrap;
21
23
 
22
24
  justify-content: space-between;
@@ -29,32 +31,34 @@
29
31
  --label-truncation-mode: tail;
30
32
 
31
33
  --label-line-limit: 1;
34
+
35
+ place-items: var(--labeled-content--labelstack-place-items, center);
32
36
  }
33
37
 
34
38
  &::part(labeled-content-value-stack) {
35
39
  color: var(--secondary);
36
40
 
37
- justify-items: var(--labeled-content--value-stack-justify-items, flex-end);
41
+ justify-items: var(--labeled-content--valuestack-justify-items, flex-end);
38
42
 
39
43
  word-break: break-word;
40
44
  }
41
45
 
42
46
  @media (pointer: fine) {
43
- --labeled-content--value-stack-flex-flow: column;
47
+ --labeled-content--valuestack-flex-flow: column;
44
48
 
45
- --labeled-content--value-stack-justify-items: flex-start;
49
+ --labeled-content--valuestack-justify-items: flex-start;
46
50
  }
47
51
 
48
52
  &[labeled-content-style='vertical'] {
49
- --labeled-content--value-stack-flex-flow: column;
53
+ --labeled-content--valuestack-flex-flow: column;
50
54
 
51
- --labeled-content--value-stack-justify-items: flex-start;
55
+ --labeled-content--valuestack-justify-items: flex-start;
52
56
  }
53
57
 
54
58
  &[labeled-content-style='horizontal'] {
55
- --labeled-content--value-stack-flex-flow: row wrap;
59
+ --labeled-content--valuestack-flex-flow: row wrap;
56
60
 
57
- --labeled-content--value-stack-justify-items: flex-end;
61
+ --labeled-content--valuestack-justify-items: flex-end;
58
62
  }
59
63
  }
60
64
 
@@ -5,29 +5,74 @@
5
5
  @use '../mixins';
6
6
 
7
7
  $picker-ifs: (
8
+ segmented: (
9
+ --picker--inputstack-grid-auto-flow: column,
10
+ --picker--inputstack-gap: 1rem,
11
+ ),
12
+ palette: (
13
+ --picker--inputstack-display: flex,
14
+ --picker--inputstack-flex-flow: row wrap,
15
+ --picker--inputstack-gap: 1rem,
16
+ ),
8
17
  radio-group: (
18
+ --picker--inputstack-gap: 1rem,
19
+ ),
20
+ menu: (),
21
+ navigation-link: (),
22
+ sheet: (),
23
+ );
24
+ $picker-elses: ();
25
+
26
+ $picker-inform-ifs: (
27
+ segmented: (
9
28
  --picker--labelstack-display: grid,
10
- // --picker--inputstack-display: flex,
11
- // --picker--inputstack-flex-flow: row wrap,
12
29
  --picker--inputstack-text-align: start,
13
- --picker--inputstack-gap: 1rem,
30
+ --picker--inputstack-background: var(--segented-picker-track-bg),
31
+ --picker--inputstack-border-radius: var(--segented-picker-track-border-radius),
32
+ --picker--inputstack-position: relative,
33
+ --picker--inputstack-min-inline-size: calc(var(--segented-picker-button-min-inline-size) + 1rem),
34
+ --picker--inputstack-block-size: var(--segented-picker-track-block-size),
35
+ --picker--inputstack-padding-inline: var(--segented-picker-track-padding-inline),
36
+ --picker--inputstack-padding-block: var(--segented-picker-track-padding-block),
37
+ --picker--inputstack-overflow: auto clip,
14
38
  // copy from labeled-content
15
- // --picker--host-display: flex,
16
- // --picker--host-justify-content: space-between,
17
39
  --picker--host-row-gap: var(--labeled-content-row-gap),
18
40
  --picker--host-column-gap: var(--labeled-content-column-gap),
19
41
  //
20
- --picker--host-grid-padding-inline: var(--itempadistart,) var(--itempadiend,),
21
- --picker--host-grid-padding-block: var(--itempadbstart,) var(--itempadbend,),
22
- --picker--host-grid-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
23
- --picker--host-grid-background: var(--itemface,),
24
- --picker--host-grid-color: var(--itemtext,),
25
- --picker--host-grid-border: var(--itemborder,),
26
- // --picker--inputstack-child-place-self: end,
42
+ --picker--host-padding-inline: var(--itempadistart,) var(--itempadiend,),
43
+ --picker--host-padding-block: var(--itempadbstart,) var(--itempadbend,),
44
+ --picker--host-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
45
+ --picker--host-background: var(--itemface,),
46
+ --picker--host-color: var(--itemtext,),
47
+ --picker--host-border: var(--itemborder,),
48
+ ),
49
+ palette: (
50
+ --picker--labelstack-display: grid,
51
+ --picker--inputstack-text-align: start,
52
+ // copy from labeled-content
53
+ --picker--host-row-gap: var(--labeled-content-row-gap),
54
+ --picker--host-column-gap: var(--labeled-content-column-gap),
27
55
  //
28
- // --picker--host-flex-wrap: wrap,
29
- // --picker--inputstack-flex-shrink: 0,
30
- // --picker--inputstack-max-width: 70%,
56
+ --picker--host-padding-inline: var(--itempadistart,) var(--itempadiend,),
57
+ --picker--host-padding-block: var(--itempadbstart,) var(--itempadbend,),
58
+ --picker--host-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
59
+ --picker--host-background: var(--itemface,),
60
+ --picker--host-color: var(--itemtext,),
61
+ --picker--host-border: var(--itemborder,),
62
+ ),
63
+ radio-group: (
64
+ --picker--labelstack-display: grid,
65
+ --picker--inputstack-text-align: start,
66
+ // copy from labeled-content
67
+ --picker--host-row-gap: var(--labeled-content-row-gap),
68
+ --picker--host-column-gap: var(--labeled-content-column-gap),
69
+ //
70
+ --picker--host-padding-inline: var(--itempadistart,) var(--itempadiend,),
71
+ --picker--host-padding-block: var(--itempadbstart,) var(--itempadbend,),
72
+ --picker--host-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
73
+ --picker--host-background: var(--itemface,),
74
+ --picker--host-color: var(--itemtext,),
75
+ --picker--host-border: var(--itemborder,),
31
76
  ),
32
77
  menu: (
33
78
  --picker--labelstack-display: grid,
@@ -38,12 +83,12 @@ $picker-ifs: (
38
83
  --picker--host-row-gap: var(--labeled-content-row-gap),
39
84
  --picker--host-column-gap: var(--labeled-content-column-gap),
40
85
  //
41
- --picker--host-grid-padding-inline: var(--itempadistart,) var(--itempadiend,),
42
- --picker--host-grid-padding-block: var(--itempadbstart,) var(--itempadbend,),
43
- --picker--host-grid-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
44
- --picker--host-grid-background: var(--itemface,),
45
- --picker--host-grid-color: var(--itemtext,),
46
- --picker--host-grid-border: var(--itemborder,),
86
+ --picker--host-padding-inline: var(--itempadistart,) var(--itempadiend,),
87
+ --picker--host-padding-block: var(--itempadbstart,) var(--itempadbend,),
88
+ --picker--host-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
89
+ --picker--host-background: var(--itemface,),
90
+ --picker--host-color: var(--itemtext,),
91
+ --picker--host-border: var(--itemborder,),
47
92
  // --picker--inputstack-child-place-self: end,
48
93
  //
49
94
  // --picker--host-flex-wrap: wrap,
@@ -59,12 +104,12 @@ $picker-ifs: (
59
104
  --picker--host-row-gap: var(--labeled-content-row-gap),
60
105
  --picker--host-column-gap: var(--labeled-content-column-gap),
61
106
  //
62
- --picker--host-grid-padding-inline: var(--itempadistart,) var(--itempadiend,),
63
- --picker--host-grid-padding-block: var(--itempadbstart,) var(--itempadbend,),
64
- --picker--host-grid-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
65
- --picker--host-grid-background: var(--itemface,),
66
- --picker--host-grid-color: var(--itemtext,),
67
- --picker--host-grid-border: var(--itemborder,),
107
+ --picker--host-padding-inline: var(--itempadistart,) var(--itempadiend,),
108
+ --picker--host-padding-block: var(--itempadbstart,) var(--itempadbend,),
109
+ --picker--host-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
110
+ --picker--host-background: var(--itemface,),
111
+ --picker--host-color: var(--itemtext,),
112
+ --picker--host-border: var(--itemborder,),
68
113
  // --picker--inputstack-child-place-self: end,
69
114
  //
70
115
  // --picker--host-flex-wrap: wrap,
@@ -80,12 +125,12 @@ $picker-ifs: (
80
125
  --picker--host-row-gap: var(--labeled-content-row-gap),
81
126
  --picker--host-column-gap: var(--labeled-content-column-gap),
82
127
  //
83
- --picker--host-grid-padding-inline: var(--itempadistart,) var(--itempadiend,),
84
- --picker--host-grid-padding-block: var(--itempadbstart,) var(--itempadbend,),
85
- --picker--host-grid-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
86
- --picker--host-grid-background: var(--itemface,),
87
- --picker--host-grid-color: var(--itemtext,),
88
- --picker--host-grid-border: var(--itemborder,),
128
+ --picker--host-padding-inline: var(--itempadistart,) var(--itempadiend,),
129
+ --picker--host-padding-block: var(--itempadbstart,) var(--itempadbend,),
130
+ --picker--host-border-radius: var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,),
131
+ --picker--host-background: var(--itemface,),
132
+ --picker--host-color: var(--itemtext,),
133
+ --picker--host-border: var(--itemborder,),
89
134
  // --picker--inputstack-child-place-self: end,
90
135
  //
91
136
  // --picker--host-flex-wrap: wrap,
@@ -93,14 +138,28 @@ $picker-ifs: (
93
138
  // --picker--inputstack-max-width: 70%,
94
139
  ),
95
140
  );
96
- $picker-elses: (
141
+ $picker-inform-elses: (
97
142
  --picker--labelstack-display: none,
98
143
  );
99
144
 
100
- // $picker-elses: (
101
- // --picker--host-grid-template-columns: minmax(0, 1fr), //auto minmax(0, 1fr),
102
- // );
103
-
145
+ // @mixin make-trigger-affordance() {
146
+ // position: relative;
147
+ // @include mixins.make-marker-pseudos(vars.$picker-affordance, after);
148
+ // &::after {
149
+ // display: grid;
150
+ // block-size: var(--picker-affordance-size);
151
+ // inline-size: var(--picker-affordance-size);
152
+ // background-color: var(--menuitemtext, var(--text));
153
+ // transform: var(--tablecol--after-rotate,);
154
+ // @media (prefers-reduced-motion: no-preference) {
155
+ // transition: transform 100ms ease-out;
156
+ // will-change: transform;
157
+ // }
158
+ // // opacity: 0;
159
+ // position: absolute;
160
+ // inset: 0 calc(var(--picker-affordance-size) * -1) auto auto;
161
+ // }
162
+ // }
104
163
  // @mixin make-button-affordance() {
105
164
  // position: relative;
106
165
  // grid-auto-flow: column;
@@ -132,12 +191,12 @@ $picker-elses: (
132
191
  grid-template-rows: minmax(0, 1fr);
133
192
 
134
193
  // wire these to mimic componentize
135
- padding-inline: var(--picker--host-grid-padding-inline,);
136
- padding-block: var(--picker--host-grid-padding-block,);
137
- background: var(--picker--host-grid-background,);
138
- border-radius: var(--picker--host-grid-border-radius,);
139
- border: var(--picker--host-grid-border,);
140
- color: var(--picker--host-grid-color,);
194
+ padding-inline: var(--picker--host-padding-inline,);
195
+ padding-block: var(--picker--host-padding-block,);
196
+ background: var(--picker--host-background,);
197
+ border-radius: var(--picker--host-border-radius,);
198
+ border: var(--picker--host-border,);
199
+ color: var(--picker--host-color,);
141
200
 
142
201
  &::part(picker-stack) {
143
202
  // grid-auto-flow: column;
@@ -161,12 +220,12 @@ $picker-elses: (
161
220
  // column-gap: 1rem;
162
221
 
163
222
  // // wire these to mimic componentize
164
- // padding-inline: var(--picker--host-grid-padding-inline,);
165
- // padding-block: var(--picker--host-grid-padding-block,);
166
- // background: var(--picker--host-grid-background,);
167
- // border-radius: var(--picker--host-grid-border-radius,);
168
- // border: var(--picker--host-grid-border,);
169
- // color: var(--picker--host-grid-color,);
223
+ // padding-inline: var(--picker--host-padding-inline,);
224
+ // padding-block: var(--picker--host-padding-block,);
225
+ // background: var(--picker--host-background,);
226
+ // border-radius: var(--picker--host-border-radius,);
227
+ // border: var(--picker--host-border,);
228
+ // color: var(--picker--host-color,);
170
229
  }
171
230
 
172
231
  &::part(picker-input-stack) {
@@ -178,6 +237,17 @@ $picker-elses: (
178
237
 
179
238
  flex-flow: var(--picker--inputstack-flex-flow,);
180
239
 
240
+ grid-auto-flow: var(--picker--inputstack-grid-auto-flow,);
241
+
242
+ background: var(--picker--inputstack-background,); //red
243
+ border-radius: var(--picker--inputstack-border-radius,); //9999rem;
244
+ position: var(--picker--inputstack-position,); //relative;
245
+ min-inline-size: var(--picker--inputstack-min-inline-size,); //1rem;
246
+ block-size: var(--picker--inputstack-block-size,); //3rem;
247
+ padding-inline: var(--picker--inputstack-padding-inline,); //0.1rem;
248
+ padding-block: var(--picker--inputstack-padding-block,); //0.1rem;
249
+ overflow: var(--picker--inputstack-overflow,); //auto clip;
250
+
181
251
  // flex-shrink: var(--picker--inputstack-flex-shrink,); //none;
182
252
 
183
253
  // max-width: var(--picker--inputstack-max-width,); //70%;
@@ -245,42 +315,12 @@ $picker-elses: (
245
315
 
246
316
  // SECTION: ifs
247
317
  @supports (x: #{string.unquote('if(else:red)')}) {
248
- :where(form &) {
318
+ :where(&) {
249
319
  @include mixins.write-ifs(--picker-style, $picker-ifs, $picker-elses);
320
+ }
250
321
 
251
- // --picker--labelstack-display: if(style(--picker-style: sheet): grid ; style(--picker-style: navigation-link): grid ; style(--picker-style: menu): grid ; else: none ;);
252
- // // --picker--host-grid-template-columns: if(style(--picker-style: menu): auto minmax(0, 1fr) ; else: minmax(0, 1fr) ;);
253
-
254
- // --picker--host-display: if(style(--picker-style: sheet): flex ; style(--picker-style: navigation-link): flex ; style(--picker-style: menu): flex ;);
255
- // --picker--host-justify-content: if(style(--picker-style: sheet): space-between ; style(--picker-style: navigation-link): space-between ; style(--picker-style: menu): space-between ;);
256
- // --picker--host-row-gap: if(
257
- // style(--picker-style: sheet): var(--labeled-content-row-gap) ; style(--picker-style: navigation-link): var(--labeled-content-row-gap) ;
258
- // style(--picker-style: menu): var(--labeled-content-row-gap) ;
259
- // );
260
- // --picker--host-column-gap: if(
261
- // style(--picker-style: sheet): var(--labeled-content-column-gap) ; style(--picker-style: navigation-link): var(--labeled-content-column-gap) ;
262
- // style(--picker-style: menu): var(--labeled-content-column-gap) ;
263
- // );
264
- //
265
- // --picker--host-grid-padding-inline: if(
266
- // style(--picker-style: sheet): var(--itempadistart,) var(--itempadiend,) ; style(--picker-style: navigation-link): var(--itempadistart,) var(--itempadiend,) ;
267
- // style(--picker-style: menu): var(--itempadistart,) var(--itempadiend,) ;
268
- // );
269
- // --picker--host-grid-padding-block: if(
270
- // style(--picker-style: sheet): var(--itempadbstart,) var(--itempadbend,) ; style(--picker-style: navigation-link): var(--itempadbstart,) var(--itempadbend,) ;
271
- // style(--picker-style: menu): var(--itempadbstart,) var(--itempadbend,) ;
272
- // );
273
- // --picker--host-grid-border-radius: if(
274
- // style(--picker-style: sheet): var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,) ; style(--picker-style: navigation-link): var(--itemradiustl,)
275
- // var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,) ; style(--picker-style: menu): var(--itemradiustl,) var(--itemradiustr,) var(--itemradiusbr,) var(--itemradiusbl,) ;
276
- // );
277
- // --picker--host-grid-background: if(style(--picker-style: sheet): var(--itemface,) ; style(--picker-style: navigation-link): var(--itemface,) ; style(--picker-style: menu): var(--itemface,) ;);
278
- // --picker--host-grid-color: if(style(--picker-style: sheet): var(--itemtext,) ; style(--picker-style: navigation-link): var(--itemtext,) ; style(--picker-style: menu): var(--itemtext,) ;);
279
- // --picker--host-grid-border: if(
280
- // style(--picker-style: sheet): var(--itemborder,) ; style(--picker-style: navigation-link): var(--itemborder,) ; style(--picker-style: menu): var(--itemborder,) ;
281
- // );
282
- // --picker--inputstack-child-place-self: if(style(--picker-style: sheet): end ; style(--picker-style: navigation-link): end ; style(--picker-style: menu): end ;);
283
- // --picker--inputstack-text-align: if(style(--picker-style: sheet): end ; style(--picker-style: navigation-link): end ; style(--picker-style: menu): start ;);
322
+ :where(form &) {
323
+ @include mixins.write-ifs(--picker-style, $picker-inform-ifs, $picker-inform-elses);
284
324
 
285
325
  // SECTION experimental only in chrome
286
326
  // --picker--inputstack-flex-shrink: if(
@@ -314,19 +354,40 @@ $picker-elses: (
314
354
  }
315
355
  }
316
356
  }
357
+ :where(form &:not([picker-style])) {
358
+ @each $v in maps.$picker-styles-names {
359
+ @container style(--picker-style: #{$v}) {
360
+ @include mixins.write-props(map.get($picker-inform-ifs, $v)); //@include set-picker-style($v);
361
+ }
362
+ }
363
+ }
317
364
  @each $v in maps.$picker-styles-names {
318
- :where(form &[picker-style='#{$v}']) {
365
+ :where(&[picker-style='#{$v}']) {
366
+ --picker-style: #{$v};
367
+
319
368
  @include mixins.write-props(map.get($picker-ifs, $v)); //@include set-picker-style($v);
320
369
  }
321
- :where(&[picker-style='#{$v}']) {
322
- // :where(& menu-view > menu-view > label-view[slot='label']) {
323
- // margin-inline-start: 3rem;
324
- // }
325
370
 
326
- // :where(& menu-view > button, & menu-view > [is='disclosure-group'] > button, & menu-view > [is='disclosure-group'] > summary) {
327
- // @include make-button-affordance;
328
- // }
371
+ :where(form &[picker-style='#{$v}']) {
372
+ @include mixins.write-props(map.get($picker-inform-ifs, $v)); //@include set-picker-style($v);
329
373
  }
374
+ // :where(&[picker-style='#{$v}']) {
375
+ // :where(& menu-view > menu-view > label-view[slot='label']) {
376
+ // margin-inline-start: 3rem;
377
+ // }
378
+
379
+ // :where(& menu-view > button, & menu-view > [is='disclosure-group'] > button, & menu-view > [is='disclosure-group'] > summary) {
380
+ // @include make-button-affordance;
381
+ // }
382
+
383
+ // :where(& menu-view > label-view[slot='label']) {
384
+ // margin-inline-end: 3rem;
385
+ // }
386
+
387
+ // :where(& menu-view > label-view[slot='label']) {
388
+ // @include make-trigger-affordance;
389
+ // }
390
+ // }
330
391
  }
331
392
  }
332
393
 
@@ -337,6 +398,135 @@ $picker-elses: (
337
398
  --picker--inputstack-flex-flow: row wrap;
338
399
  }
339
400
  }
401
+
402
+ > label:not([slot]) {
403
+ @container style(--picker-style: radio-group) {
404
+ input[type='radio'] {
405
+ min-inline-size: 20px;
406
+
407
+ margin: 0;
408
+ }
409
+ }
410
+
411
+ @container style(--picker-style: palette) {
412
+ :where(&) {
413
+ --label-font: callout;
414
+
415
+ color: var(--secondary);
416
+ }
417
+
418
+ &:has(input[type='radio']:not(:disabled)) {
419
+ :where(&) {
420
+ cursor: pointer;
421
+ }
422
+ }
423
+
424
+ &:has(input[type='radio']:checked) {
425
+ :where(&) {
426
+ color: var(--primary);
427
+
428
+ font-weight: 600;
429
+ }
430
+ }
431
+
432
+ input[type='radio'] {
433
+ :where(&) {
434
+ appearance: none;
435
+ margin: 0;
436
+
437
+ inline-size: 2rem;
438
+ block-size: 2rem;
439
+ border-radius: 0.4rem;
440
+
441
+ pointer-events: none;
442
+
443
+ transition: outline 100ms ease-out;
444
+
445
+ &:checked {
446
+ outline: var(--accentColor) solid 0.3rem;
447
+
448
+ outline-offset: 0.1rem;
449
+ }
450
+ }
451
+ }
452
+
453
+ // &:focus {
454
+ // :where(&) {
455
+ // outline: none;
456
+ // }
457
+
458
+ // input[type='radio'] {
459
+ // :where(&) {
460
+ // outline: var(--accentColor) solid 0.2rem;
461
+ // outline-offset: 0.1rem;
462
+ // }
463
+ // }
464
+ // }
465
+ }
466
+
467
+ @container style(--picker-style: segmented) {
468
+ :where(&) {
469
+ --label-font: callout;
470
+
471
+ color: var(--secondary);
472
+
473
+ min-inline-size: var(--segented-picker-button-min-inline-size);
474
+ background-color: blue;
475
+ border-radius: inherit;
476
+
477
+ inline-size: fit-content;
478
+ block-size: calc(var(--segented-picker-track-block-size) - calc(var(--segented-picker-track-padding-block) * 2));
479
+ }
480
+
481
+ &:has(input[type='radio']:not(:disabled)) {
482
+ :where(&) {
483
+ cursor: pointer;
484
+ }
485
+ }
486
+
487
+ &:has(input[type='radio']:checked) {
488
+ :where(&) {
489
+ color: var(--primary);
490
+
491
+ font-weight: 600;
492
+ }
493
+ }
494
+
495
+ input[type='radio'] {
496
+ :where(&) {
497
+ appearance: none;
498
+ margin: 0;
499
+
500
+ inline-size: 2rem;
501
+ block-size: 2rem;
502
+ border-radius: 0.4rem;
503
+
504
+ pointer-events: none;
505
+
506
+ transition: outline 100ms ease-out;
507
+
508
+ &:checked {
509
+ outline: var(--accentColor) solid 0.3rem;
510
+
511
+ outline-offset: 0.1rem;
512
+ }
513
+ }
514
+ }
515
+
516
+ // &:focus {
517
+ // :where(&) {
518
+ // outline: none;
519
+ // }
520
+
521
+ // input[type='radio'] {
522
+ // :where(&) {
523
+ // outline: var(--accentColor) solid 0.2rem;
524
+ // outline-offset: 0.1rem;
525
+ // }
526
+ // }
527
+ // }
528
+ }
529
+ }
340
530
  }
341
531
  }
342
532