@swiftwc/ui 0.0.0-dev.57 → 0.0.0-dev.58

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.
@@ -0,0 +1,7 @@
1
+ export declare class ColorScheme extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ constructor();
4
+ connectedCallback(): void;
5
+ disconnectedCallback(): void;
6
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
7
+ }
@@ -0,0 +1,54 @@
1
+ import { devFlags } from '../internal/utils';
2
+ export class ColorScheme extends HTMLElement {
3
+ static get observedAttributes() {
4
+ return ['dark'];
5
+ }
6
+ constructor() {
7
+ super();
8
+ }
9
+ connectedCallback() {
10
+ if (devFlags.debug)
11
+ console.debug(`${ColorScheme.name} ⚡️ connect`);
12
+ this.hidden = true;
13
+ this.inert = true;
14
+ }
15
+ disconnectedCallback() {
16
+ if (devFlags.debug)
17
+ console.debug(`${ColorScheme.name} ⚡️ disconnect`);
18
+ }
19
+ attributeChangedCallback(name, oldValue, newValue) {
20
+ if (devFlags.debug)
21
+ console.debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
22
+ // self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
23
+ if (newValue)
24
+ self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
25
+ // @property --canvas {
26
+ // syntax: "<color>";
27
+ // initial-value: oklch(100% 0 0deg);
28
+ // inherits: false;
29
+ // }
30
+ // @media (prefers-color-scheme: dark) {
31
+ // @property --canvas {
32
+ // syntax: "<color>";
33
+ // initial-value: oklch(0% 0 0deg);
34
+ // inherits: false;
35
+ // }
36
+ // }
37
+ // @property --canvastext {
38
+ // syntax: "<color>";
39
+ // initial-value: oklch(0% 0 0deg);
40
+ // inherits: false;
41
+ // }
42
+ // @media (prefers-color-scheme: dark) {
43
+ // @property --canvastext {
44
+ // syntax: "<color>";
45
+ // initial-value: oklch(100% 0 0deg);
46
+ // inherits: false;
47
+ // }
48
+ // }
49
+ // if (CSS.supports('interpolate-size', 'allow-keywords')) {
50
+ // self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
51
+ if (null !== newValue)
52
+ self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
53
+ }
54
+ }
@@ -3,6 +3,7 @@ export * from './body-view';
3
3
  export * from './bordered-button';
4
4
  export * from './bordered-prominent-button';
5
5
  export * from './borderless-button';
6
+ export * from './color-scheme';
6
7
  export * from './confirmation-dialog';
7
8
  export * from './content-unavailable-view';
8
9
  export * from './date-picker';
@@ -3,6 +3,7 @@ export * from './body-view';
3
3
  export * from './bordered-button';
4
4
  export * from './bordered-prominent-button';
5
5
  export * from './borderless-button';
6
+ export * from './color-scheme';
6
7
  export * from './confirmation-dialog';
7
8
  export * from './content-unavailable-view';
8
9
  export * from './date-picker';
@@ -6086,8 +6086,8 @@
6086
6086
  }
6087
6087
  h-stack[distribution=center],
6088
6088
  v-flex-stack[distribution=center] {
6089
- justify-items: safe center ;
6090
- justify-content: safe center ;
6089
+ justify-items: center ;
6090
+ justify-content: center ;
6091
6091
  }
6092
6092
  h-stack[distribution=trailing],
6093
6093
  v-flex-stack[distribution=trailing] {
@@ -6132,6 +6132,16 @@
6132
6132
  v-flex-stack[alignment=space-between] {
6133
6133
  align-content: space-between ;
6134
6134
  }
6135
+ h-stack[placement=fill],
6136
+ v-flex-stack[placement=fill] {
6137
+ place-items: stretch ;
6138
+ place-content: stretch ;
6139
+ }
6140
+ h-stack[placement="leading fill"],
6141
+ v-flex-stack[placement="leading fill"] {
6142
+ place-items: stretch start ;
6143
+ place-content: stretch start ;
6144
+ }
6135
6145
  h-stack[placement="fill leading"],
6136
6146
  v-flex-stack[placement="fill leading"] {
6137
6147
  place-items: start stretch ;
@@ -6184,8 +6194,8 @@
6184
6194
  }
6185
6195
  v-stack[alignment=center],
6186
6196
  h-flex-stack[alignment=center] {
6187
- justify-items: safe center ;
6188
- justify-content: safe center ;
6197
+ justify-items: center ;
6198
+ justify-content: center ;
6189
6199
  }
6190
6200
  v-stack[alignment=trailing],
6191
6201
  h-flex-stack[alignment=trailing] {
@@ -6211,6 +6221,11 @@
6211
6221
  place-items: start stretch ;
6212
6222
  place-content: start stretch ;
6213
6223
  }
6224
+ v-stack[placement="fill leading"],
6225
+ h-flex-stack[placement="fill leading"] {
6226
+ place-items: stretch start ;
6227
+ place-content: stretch start ;
6228
+ }
6214
6229
  v-stack[placement="space-between fill"],
6215
6230
  h-flex-stack[placement="space-between fill"] {
6216
6231
  align-content: space-between ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swiftwc/ui",
3
- "version": "0.0.0-dev.57",
3
+ "version": "0.0.0-dev.58",
4
4
  "description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,8 +13,8 @@ $inline-map: (
13
13
  (justify-content (stretch)),
14
14
  ),
15
15
  center: (
16
- (justify-items (safe center)),
17
- (justify-content (safe center)),
16
+ (justify-items (center)),
17
+ (justify-content (center)),
18
18
  ),
19
19
  trailing: (
20
20
  (justify-items (end)),
@@ -56,6 +56,14 @@ $block-map: (
56
56
  );
57
57
 
58
58
  $h-placement-map: (
59
+ 'fill': (
60
+ (place-items (stretch)),
61
+ (place-content (stretch)),
62
+ ),
63
+ 'leading fill': (
64
+ (place-items (stretch start)),
65
+ (place-content (stretch start)),
66
+ ),
59
67
  'fill leading': (
60
68
  (place-items (start stretch)),
61
69
  (place-content (start stretch)),
@@ -76,6 +84,10 @@ $v-placement-map: (
76
84
  (place-items (start stretch)),
77
85
  (place-content (start stretch)),
78
86
  ),
87
+ 'fill leading': (
88
+ (place-items (stretch start)),
89
+ (place-content (stretch start)),
90
+ ),
79
91
  'space-between fill': (
80
92
  (align-content (space-between)),
81
93
  (justify-items (stretch)),
@@ -49,6 +49,14 @@
49
49
  }
50
50
  ]
51
51
  },
52
+ {
53
+ "name": "color-scheme",
54
+ "attributes": [
55
+ {
56
+ "name": "dark"
57
+ }
58
+ ]
59
+ },
52
60
  {
53
61
  "name": "confirmation-dialog",
54
62
  "attributes": [