oneslash-design-system 2.10.1 → 2.12.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 oneSlash
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -38,10 +38,12 @@ Use class names that mean the same thing in Tailwind v3 and v4 inside components
38
38
 
39
39
  The Swift package `OneSlashDesign` (iOS 26 and macOS 26 and later) is this repository: `https://github.com/oneSlash-app/design-system`.
40
40
 
41
- 1. Add the package with Swift Package Manager (`.package(url: "https://github.com/oneSlash-app/design-system", from: "2.10.0")`) and the `OneSlashDesign` product to the target (`.product(name: "OneSlashDesign", package: "design-system")`; by URL the package identity is `design-system`), then `import OneSlashDesign`.
41
+ 1. Add the package with Swift Package Manager (`.package(url: "https://github.com/oneSlash-app/design-system", from: "2.12.0")`) and the `OneSlashDesign` product to the target (`.product(name: "OneSlashDesign", package: "design-system")`; by URL the package identity is `design-system`), then `import OneSlashDesign`.
42
42
  2. In the app's asset catalog, define the `AccentColor` color set with an "Any Appearance" value and a "Dark" value, both sRGB, replacing the empty default Xcode creates. Take the two values from the chosen theme's `accent.main` row (light and dark columns) in the color table in [DESIGN.md](./dist/DESIGN.md). Name it as the app's global accent color (the `ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME` build setting, `AccentColor` by default in new Xcode projects). It is required: it tints controls, alerts and selection, and on macOS it yields to the user's system accent choice by design.
43
43
  3. Apply one theme at the scene root: `.odsTheme(.forest)`. It sets the text foreground styles, as fixed colors resolved for the current appearance, and no tint and no background.
44
44
  4. Read colors from `@Environment(\.odsTheme)`, for example `theme.background.default`, and use `ODSSpacing`, `ODSRadius`, `ODSDuration` and `Font.ods(_:)` for our own content views.
45
+ 5. Use `.odsProminentButton()` instead of `.buttonStyle(.borderedProminent)`: under `.odsTheme` a prominent label is otherwise unreadable on most themes.
46
+ 6. `ODSBanner`, `ODSTag` and `ODSAvatar` are the parts SwiftUI has no control for.
45
47
 
46
48
  [DESIGN.md](./dist/DESIGN.md) has the rules for a "100% ODS" native app and the table that maps each web component to its native control. The Compose theme is not built yet.
47
49
 
@@ -101,3 +103,7 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
101
103
  The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
102
104
 
103
105
  Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
106
+
107
+ ## License
108
+
109
+ MIT. See [LICENSE](LICENSE). The oneSlash and Scindo names and logos are not covered by it.
package/dist/DESIGN.md CHANGED
@@ -37,9 +37,9 @@ Use one semantic name, never a hex value. Each name resolves to a light and a da
37
37
  | primary.dark | #262626 | #E9E9E9 | #262626 | #E9E9E9 | #262626 | #E9E9E9 | #262626 | #E9E9E9 | #262626 | #E9E9E9 |
38
38
  | primary.light | #888888 | #9A9A9A | #888888 | #9A9A9A | #888888 | #9A9A9A | #888888 | #9A9A9A | #888888 | #9A9A9A |
39
39
  | primary.contrast | #ffffff | #000000 | #ffffff | #000000 | #ffffff | #000000 | #ffffff | #000000 | #ffffff | #000000 |
40
- | secondary.main | #B0B0B0 | #4F4F4F | #6E7A5A | #6E7A5A | #CDB49A | #5C4630 | #B4C6DC | #344566 | #D5BCC8 | #4E3346 |
41
- | secondary.dark | #888888 | #454545 | #5D6849 | #5D6849 | #B89A7C | #4D3A27 | #8EA6C4 | #2B3A57 | #BF93A8 | #43293C |
42
- | secondary.light | #D1D1D1 | #6D6D6D | #828D6B | #828D6B | #E2D1BE | #75593D | #CFDCEA | #44587F | #E6D4DC | #634257 |
40
+ | secondary.main | #B0B0B0 | #4F4F4F | #5D6849 | #5D6849 | #CDB49A | #5C4630 | #B4C6DC | #344566 | #D5BCC8 | #4E3346 |
41
+ | secondary.dark | #888888 | #454545 | #3B4628 | #3B4628 | #B89A7C | #4D3A27 | #8EA6C4 | #2B3A57 | #BF93A8 | #43293C |
42
+ | secondary.light | #D1D1D1 | #6D6D6D | #6E7A5A | #6E7A5A | #E2D1BE | #75593D | #CFDCEA | #44587F | #E6D4DC | #634257 |
43
43
  | secondary.contrast | #000000 | #eeeeee | #FFFFFF | #FFFFFF | #2B1F12 | #F2E2CE | #111A2E | #E3ECF5 | #2A1622 | #F2EDE4 |
44
44
  | error.main | #D32F2F | #E74C4C | #D32F2F | #E74C4C | #D32F2F | #E74C4C | #D32F2F | #E74C4C | #D32F2F | #E74C4C |
45
45
  | error.dark | #A82121 | #B22323 | #A82121 | #B22323 | #A82121 | #B22323 | #A82121 | #B22323 | #A82121 | #B22323 |
@@ -108,6 +108,28 @@ Use one semantic name, never a hex value. Each name resolves to a light and a da
108
108
  | misc.tooltipBg | #4F4F4F | #FFFFFF | #424F34 | #F4F7EC | #514034 | #FCF8F2 | #33405A | #F7F9FC | #51404D | #FCF9F7 |
109
109
  | misc.tooltipText | #eeeeee | #000000 | #D9E5C7 | #1C2213 | #F2E2CE | #2B1F12 | #E3ECF5 | #111A2E | #F2EDE4 | #2A1622 |
110
110
 
111
+ ## Increased contrast
112
+
113
+ Every color also has an increased-contrast value in light and in dark. The build derives them from the standard values; nobody picks them by hand, and they are not in `designTokens.js`. One look was chosen by the owner: in forest dark the secondary fill takes the theme's dark ink as its label and gets lighter, where the derivation alone would have darkened it toward the page.
114
+
115
+ - **Web:** each theme file answers `prefers-contrast: more`. Nothing to do per page or component.
116
+ - **Apple:** each color in the Swift package follows the system's Increase Contrast setting. Nothing to do per screen.
117
+ - **`tokens.json`:** each theme has `lightIncreased` and `darkIncreased` beside `light` and `dark`.
118
+
119
+ What changes: text, status colors, fills under a label, dividers and outlined borders. Text reaches 7:1 where the standard value is held to 4.5:1; dividers and borders reach 3:1. What does not change: surfaces (`background.*`), so a theme keeps its look, and `text.disabled`.
120
+
121
+ Do not branch on the setting in a view or a component. Use the same token name; the value follows the setting.
122
+
123
+ An Apple app's `AccentColor` asset is the one color the package cannot supply. The table gives `accent.main` per theme. Where the last column says "add high-contrast variants", add the "High Contrast" appearances to the color set with the increased values.
124
+
125
+ | Theme | Light | Light, increased | Dark | Dark, increased | AccentColor asset |
126
+ | --- | --- | --- | --- | --- | --- |
127
+ | default | #EEAE03 | #EEAE03 | #FFCD29 | #FFCD29 | same |
128
+ | forest | #1C2213 | #1C2213 | #E7ECDA | #E7ECDA | same |
129
+ | clay | #D9B26A | #D9B26A | #F2D57E | #F2D57E | same |
130
+ | indigo | #204F8C | #204F8C | #C2E0F2 | #C2E0F2 | same |
131
+ | wine | #8C2668 | #8C2668 | #E2B4CC | #E2B4CC | same |
132
+
111
133
  ## Spacing
112
134
 
113
135
  | Token | Value |
@@ -195,13 +217,15 @@ Spacing and radius tokens apply to our own content views. System containers (lis
195
217
 
196
218
  Platforms: iOS 26 and macOS 26 and later.
197
219
 
198
- 1. Add the package with Swift Package Manager: `.package(url: "https://github.com/oneSlash-app/design-system", from: "2.10.0")`. Add the `OneSlashDesign` product to the target. By URL the package identity is `design-system`, so a manifest writes `.product(name: "OneSlashDesign", package: "design-system")`.
220
+ 1. Add the package with Swift Package Manager: `.package(url: "https://github.com/oneSlash-app/design-system", from: "2.12.0")`. Add the `OneSlashDesign` product to the target. By URL the package identity is `design-system`, so a manifest writes `.product(name: "OneSlashDesign", package: "design-system")`.
199
221
  2. `import OneSlashDesign`.
200
222
  3. In the app's asset catalog, define the `AccentColor` color set with an "Any Appearance" value and a "Dark" value, both sRGB, replacing the empty default Xcode creates. Take the two values from the chosen theme's `accent.main` row in the color table above (its light and dark columns). Name it as the app's global accent color (the `ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME` build setting, `AccentColor` by default in new Xcode projects). This is required: the package sets no tint, so this asset is what tints controls, alerts and selection. On macOS it yields to the user's system accent choice, by design.
201
223
  4. Apply one theme at the scene root: `.odsTheme(.forest)`. The themes are `ODSTheme.default`, `.forest`, `.clay`, `.indigo` and `.wine`. The modifier sets the `odsTheme` environment value and the primary, secondary and tertiary foreground styles from the theme's text colors. It sets no tint and no background. The foreground styles are fixed colors, resolved for the current appearance and resolved again when it changes: system toolbars and menus resolve a dynamic root color without the window's appearance, which draws dark glyphs on a dark toolbar. Under the modifier, text-like controls (borderless buttons, links) take `text.primary`, not the accent; to give one the accent, apply `.foregroundStyle(.tint)` to it (the tint is the `AccentColor` asset). `text.disabled` is the tertiary level, so `.foregroundStyle(.tertiary)` is the disabled text color. Apply `.odsToolbarMenuLabel()` to the label of a toolbar `Menu`: without it, an iPhone toolbar menu draws its label white in both appearances. Menu item icons take `text.primary`.
202
224
  5. Read the theme with `@Environment(\.odsTheme) private var theme` for backgrounds and status colors, for example `theme.background.default` and `theme.error.main`. Each color has the same group and key names as the color table above.
203
225
  6. Spacing, radius and motion are constants for our own content views: `ODSSpacing`, `ODSRadius` and `ODSDuration` (in seconds).
204
- 7. Fonts: `Font.ods(_ role: ODSTextRole)` returns the system text style for a type role. See the type roles table below. Native apps use the system fonts with Dynamic Type; Inter and Fira Code stay on the web.
226
+ 7. Prominent buttons: use `.odsProminentButton()` (or `.odsProminentButton(.glass)`) instead of `.buttonStyle(.borderedProminent)`. Under `.odsTheme` a prominent label takes `text.primary`, which is unreadable on the accent in most themes; the modifier keeps the system style and sets the label to `accent.contrast`. On the Mac, while the user has chosen their own system accent, the label is white.
227
+ 8. Parts: `ODSBanner`, `ODSTag` and `ODSAvatar` cover what SwiftUI has no control for. See "Parts" below. For an empty state use the system `ContentUnavailableView`.
228
+ 9. Fonts: `Font.ods(_ role: ODSTextRole)` returns the system text style for a type role. See the type roles table below. Native apps use the system fonts with Dynamic Type; Inter and Fira Code stay on the web.
205
229
 
206
230
  Limits to know:
207
231
 
@@ -231,14 +255,14 @@ ODS type roles map to system text styles, so they keep Dynamic Type. No font fil
231
255
 
232
256
  ### Component mapping
233
257
 
234
- For each web component, the table gives the native control to use. System controls keep their standard styles; ODS supplies only tokens. "ODS part (planned)" means ODS will provide the part and does not yet. "Not applicable: web page pattern" means the web component has no native counterpart; use the note.
258
+ For each web component, the table gives the native control to use. System controls keep their standard styles; ODS supplies only tokens. "ODS part (planned)" means ODS will provide the part and does not yet; an `ODS…` name is a part the package ships. "Not applicable: web page pattern" means the web component has no native counterpart; use the note.
235
259
 
236
260
  | ODS | SwiftUI | Compose | Note |
237
261
  | --- | --- | --- | --- |
238
- | alert | ODS part (planned) | ODS part (planned) | Until then: SwiftUI `.alert` for messages that need a decision; Compose `Snackbar` in a `SnackbarHost` for toasts. |
239
- | button | `Button` with `.borderedProminent` or `.glassProminent` for accent, `.bordered` for primary | `Button`, `OutlinedButton` | Tertiary and text-only: `.borderless` / `TextButton`. A prominent button's system label is white; on themes whose accent is light (default, clay) that fails contrast in light mode, so set the label's `.foregroundStyle(theme.accent.contrast)`. Forest, indigo and wine pass as is. |
262
+ | alert | `ODSBanner` for an inline message; `.alert` for one that needs a decision | ODS part (planned) | ODS has no native toast. Compose until the part exists: `Snackbar` in a `SnackbarHost`. |
263
+ | button | `Button` with `.odsProminentButton()` for accent (`.odsProminentButton(.glass)` for the glass style), `.bordered` for primary | `Button`, `OutlinedButton` | Tertiary and text-only: `.borderless` / `TextButton`. On Apple, apply `.odsProminentButton()` to every prominent button. Under `odsTheme` the label of a `.borderedProminent` or `.glassProminent` button takes `text.primary`, not the system white, which is below 4.5:1 on the accent in default dark, forest light, forest dark, clay dark, indigo light, indigo dark, wine light, wine dark. In forest light it is the same color as the fill, so the label cannot be seen. The modifier keeps the system style and sets the label to `accent.contrast`. Compose needs nothing: `onPrimary` is `accent.contrast`. |
240
264
  | checkBox | `Toggle` (switch on iOS, `.toggleStyle(.checkbox)` on macOS) | `Checkbox` | |
241
- | emptyBox | ODS part (planned) | ODS part (planned) | Until then: SwiftUI `ContentUnavailableView`; Compose a centered `Icon` and `Text` in a `Column`. |
265
+ | emptyBox | `ContentUnavailableView` | ODS part (planned) | The system has this control on Apple, so ODS adds no part there. Compose until the part exists: a centered `Icon` and `Text` in a `Column`. |
242
266
  | factsRow | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `LabeledContent` rows in a `Form` / `ListItem` rows. |
243
267
  | figure | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: an `Image` with a caption `Text` in the caption text style. |
244
268
  | heading | `Text` with the type role's text style and `.accessibilityAddTraits(.isHeader)` | `Text` with the type role's `MaterialTheme.typography` style and `Modifier.semantics { heading() }` | |
@@ -270,9 +294,44 @@ For each web component, the table gives the native control to use. System contro
270
294
  | tableHeaderCell | A `TableColumn` title | `Text` in the header `Row` | Material 3 has no table. |
271
295
  | tableRow | `TableRow` | `Row` | Material 3 has no table. |
272
296
  | tabsContainer | `TabView` or segmented `Picker` | `PrimaryTabRow` | `TabRow` is deprecated in Material 3. |
273
- | tag | ODS part (planned) | ODS part (planned) | Until then: SwiftUI `.badge` for counts, else a `Label`; Compose `AssistChip` or `FilterChip`. |
297
+ | tag | `ODSTag` | ODS part (planned) | A count on a list row or tab stays `.badge`. A tag that acts: wrap `ODSTag` in a `Button` with the plain style. Compose until the part exists: `AssistChip` or `FilterChip`. |
274
298
  | textarea | `TextField(_:text:axis: .vertical)` or `TextEditor` | `OutlinedTextField` with `minLines` | |
275
299
  | textField | `TextField` (`SecureField` for passwords) | `OutlinedTextField` or `TextField` | |
276
300
  | timeStamp | `Text(_:style:)` (`.relative`) or `Text(_:format:)` (`.dateTime`) | `Text` with `DateUtils.getRelativeTimeSpanString` or `DateTimeFormatter.ofLocalizedDateTime` | |
277
301
  | tooltip | `.help` | `TooltipBox` | `.help` shows on pointer hover only. `TooltipBox` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
278
- | userImage | ODS part (planned) | ODS part (planned) | Until then: SwiftUI `AsyncImage` clipped to a `Circle`, `person.crop.circle` placeholder; Compose `Image` clipped to `CircleShape`, `account_circle` placeholder. |
302
+ | userImage | `ODSAvatar` | ODS part (planned) | Load the picture yourself and pass it as an `Image`. Compose until the part exists: `Image` clipped to `CircleShape`, `account_circle` placeholder. |
303
+
304
+ ### Parts
305
+
306
+ The parts ODS ships where the platform has no control of its own: `ODSBanner` (an inline message), `ODSTag` and `ODSAvatar` in the Swift package. They follow the OS-update rules: system text styles, Dynamic Type, SF Symbols, no fixed sizes. Their colors come from one table, `native/parts.js`, which the Swift code is generated from and the contrast gate checks, so a part has the same colors on every platform and on the web. Do not re-color a part.
307
+
308
+ A style is named `<part>.<variant>.<color or state>`. Each piece of it takes one color token.
309
+
310
+ | Style | Fill | Label | Border | Dot |
311
+ | --- | --- | --- | --- | --- |
312
+ | `banner.default` | `secondary.main` | `secondary.contrast` | | |
313
+ | `tag.contained.plain` | `background.accent300` | `text.primary` | `misc.divider` | |
314
+ | `tag.contained.selected` | `accent.main` | `accent.contrast` | `misc.divider` | |
315
+ | `tag.contained.default` | `secondary.main` | `secondary.contrast` | `misc.divider` | |
316
+ | `tag.textOnly.plain` | | `text.primary` | | |
317
+ | `tag.textOnly.selected` | | `text.primary` | `accent.main` | |
318
+ | `tag.textOnly.default` | | `text.secondary` | | |
319
+ | `tag.dot.plain` | | `text.primary` | | `text.secondary` |
320
+ | `tag.dot.selected` | | `text.primary` | | `text.secondary` |
321
+ | `tag.dot.default` | | `text.primary` | | `text.secondary` |
322
+ | `banner.error` | `error.alertBg` | `text.primary` | | |
323
+ | `tag.contained.error` | `error.fill` | `error.onFill` | `error.fill` | |
324
+ | `tag.textOnly.error` | | `error.text` | `error.fill` | |
325
+ | `tag.dot.error` | | `text.primary` | | `error.main` |
326
+ | `banner.warning` | `warning.alertBg` | `text.primary` | | |
327
+ | `tag.contained.warning` | `warning.fill` | `warning.onFill` | `warning.fill` | |
328
+ | `tag.textOnly.warning` | | `warning.text` | `warning.fill` | |
329
+ | `tag.dot.warning` | | `text.primary` | | `warning.main` |
330
+ | `banner.info` | `info.alertBg` | `text.primary` | | |
331
+ | `tag.contained.info` | `info.fill` | `info.onFill` | `info.fill` | |
332
+ | `tag.textOnly.info` | | `info.text` | `info.fill` | |
333
+ | `tag.dot.info` | | `text.primary` | | `info.main` |
334
+ | `banner.success` | `success.alertBg` | `text.primary` | | |
335
+ | `tag.contained.success` | `success.fill` | `success.onFill` | `success.fill` | |
336
+ | `tag.textOnly.success` | | `success.text` | `success.fill` | |
337
+ | `tag.dot.success` | | `text.primary` | | `success.main` |
@@ -364,13 +364,13 @@ var baseColors = base.colors;
364
364
  var forestLight = override(baseColors.light, {
365
365
  text: { primary: '#1C2213', secondary: '#515E3C', disabled: '#8A9670' },
366
366
  accent: { main: '#1C2213', dark: '#2A331E', light: '#3A472B', contrast: '#E7ECDA' },
367
- secondary: { main: '#6E7A5A', dark: '#5D6849', light: '#828D6B' },
367
+ secondary: { main: '#5D6849', dark: '#3B4628', light: '#6E7A5A' },
368
368
  background: { default: '#D9E5C7', accent100: '#E2ECD4', accent200: '#EBF1E0', accent300: '#F4F7EC' },
369
369
  });
370
370
  var forestDark = override(baseColors.dark, {
371
371
  text: { primary: '#D9E5C7', secondary: '#9DAA85', disabled: '#6D7956' },
372
372
  accent: { main: '#E7ECDA', dark: '#D6DEC3', light: '#F2F5EA', contrast: '#1C2213' },
373
- secondary: { main: '#6E7A5A', dark: '#5D6849', light: '#828D6B' },
373
+ secondary: { main: '#5D6849', dark: '#3B4628', light: '#6E7A5A' },
374
374
  background: { default: '#1C2213', accent100: '#27301B', accent200: '#364228', accent300: '#424F34' },
375
375
  });
376
376
  // Clay, Indigo and Wine follow default's shape (tinted secondary per mode, so secondary buttons keep the
@@ -420,8 +420,8 @@ var themeSets = function (light, dark) { return withTooltips(withSemanticKeys(li
420
420
  * @returns {S}
421
421
  */
422
422
  var withForestInfoText = function (set) { return (__assign(__assign({}, set), { info: __assign(__assign({}, set.info), { text: '#0068A3', textHover: '#0068A3' }) })); };
423
- // Forest's secondary.main (#6E7A5A) is mid-tone: its text.primary gives 3.5:1 and Scindo's cream 3.8:1, so the
424
- // label is white (4.56:1) in both modes.
423
+ // Forest's secondary.main (#5D6849) takes a white label (5.93:1) in both modes: text.primary gives 2.75:1 on it
424
+ // in light. The ramp was one step lighter until 2.12.0 (main #6E7A5A, 4.57:1).
425
425
  /**
426
426
  * @template {typeof base.colors.light} S
427
427
  * @param {S} set
@@ -2,15 +2,15 @@
2
2
  "components": [
3
3
  {
4
4
  "ods": "alert",
5
- "swiftui": "ODS part (planned)",
5
+ "swiftui": "`ODSBanner` for an inline message; `.alert` for one that needs a decision",
6
6
  "compose": "ODS part (planned)",
7
- "note": "Until then: SwiftUI `.alert` for messages that need a decision; Compose `Snackbar` in a `SnackbarHost` for toasts."
7
+ "note": "ODS has no native toast. Compose until the part exists: `Snackbar` in a `SnackbarHost`."
8
8
  },
9
9
  {
10
10
  "ods": "button",
11
- "swiftui": "`Button` with `.borderedProminent` or `.glassProminent` for accent, `.bordered` for primary",
11
+ "swiftui": "`Button` with `.odsProminentButton()` for accent (`.odsProminentButton(.glass)` for the glass style), `.bordered` for primary",
12
12
  "compose": "`Button`, `OutlinedButton`",
13
- "note": "Tertiary and text-only: `.borderless` / `TextButton`. A prominent button's system label is white; on themes whose accent is light (default, clay) that fails contrast in light mode, so set the label's `.foregroundStyle(theme.accent.contrast)`. Forest, indigo and wine pass as is."
13
+ "note": "Tertiary and text-only: `.borderless` / `TextButton`. On Apple, apply `.odsProminentButton()` to every prominent button. Under `odsTheme` the label of a `.borderedProminent` or `.glassProminent` button takes `text.primary`, not the system white, which is below 4.5:1 on the accent in default dark, forest light, forest dark, clay dark, indigo light, indigo dark, wine light, wine dark. In forest light it is the same color as the fill, so the label cannot be seen. The modifier keeps the system style and sets the label to `accent.contrast`. Compose needs nothing: `onPrimary` is `accent.contrast`."
14
14
  },
15
15
  {
16
16
  "ods": "checkBox",
@@ -19,9 +19,9 @@
19
19
  },
20
20
  {
21
21
  "ods": "emptyBox",
22
- "swiftui": "ODS part (planned)",
22
+ "swiftui": "`ContentUnavailableView`",
23
23
  "compose": "ODS part (planned)",
24
- "note": "Until then: SwiftUI `ContentUnavailableView`; Compose a centered `Icon` and `Text` in a `Column`."
24
+ "note": "The system has this control on Apple, so ODS adds no part there. Compose until the part exists: a centered `Icon` and `Text` in a `Column`."
25
25
  },
26
26
  {
27
27
  "ods": "factsRow",
@@ -200,9 +200,9 @@
200
200
  },
201
201
  {
202
202
  "ods": "tag",
203
- "swiftui": "ODS part (planned)",
203
+ "swiftui": "`ODSTag`",
204
204
  "compose": "ODS part (planned)",
205
- "note": "Until then: SwiftUI `.badge` for counts, else a `Label`; Compose `AssistChip` or `FilterChip`."
205
+ "note": "A count on a list row or tab stays `.badge`. A tag that acts: wrap `ODSTag` in a `Button` with the plain style. Compose until the part exists: `AssistChip` or `FilterChip`."
206
206
  },
207
207
  {
208
208
  "ods": "textarea",
@@ -227,9 +227,9 @@
227
227
  },
228
228
  {
229
229
  "ods": "userImage",
230
- "swiftui": "ODS part (planned)",
230
+ "swiftui": "`ODSAvatar`",
231
231
  "compose": "ODS part (planned)",
232
- "note": "Until then: SwiftUI `AsyncImage` clipped to a `Circle`, `person.crop.circle` placeholder; Compose `Image` clipped to `CircleShape`, `account_circle` placeholder."
232
+ "note": "Load the picture yourself and pass it as an `Image`. Compose until the part exists: `Image` clipped to `CircleShape`, `account_circle` placeholder."
233
233
  }
234
234
  ],
235
235
  "typeRoles": {
@@ -258,3 +258,70 @@
258
258
  --os-color-misc-tooltipText: 43 31 18;
259
259
  }
260
260
  }
261
+ @media (prefers-contrast: more) {
262
+ :root {
263
+ --os-color-text-secondary: 88 68 48;
264
+ --os-color-accent-contrast: 7 2 0;
265
+ --os-color-secondary-contrast: 29 17 5;
266
+ --os-color-error-main: 182 0 21;
267
+ --os-color-error-text: 128 0 10;
268
+ --os-color-error-textHover: 149 3 15;
269
+ --os-color-warning-fill: 150 62 0;
270
+ --os-color-warning-text: 124 49 0;
271
+ --os-color-warning-textHover: 124 49 0;
272
+ --os-color-info-fill: 0 93 149;
273
+ --os-color-info-text: 0 76 120;
274
+ --os-color-info-textHover: 0 76 120;
275
+ --os-color-success-fill: 36 101 40;
276
+ --os-color-success-text: 15 84 22;
277
+ --os-color-success-textHover: 15 84 22;
278
+ --os-color-actionOutlinedBorder-enabled: 128 128 128;
279
+ --os-color-misc-divider: 128 128 128;
280
+ }
281
+ .dark {
282
+ --os-color-text-primary: 243 227 206;
283
+ --os-color-text-secondary: 202 181 154;
284
+ --os-color-accent-contrast: 43 31 18;
285
+ --os-color-secondary-contrast: 243 227 206;
286
+ --os-color-error-main: 253 96 94;
287
+ --os-color-error-dark: 247 102 93;
288
+ --os-color-error-fill: 253 96 94;
289
+ --os-color-error-text: 255 168 165;
290
+ --os-color-error-textHover: 255 139 138;
291
+ --os-color-warning-fill: 255 140 10;
292
+ --os-color-warning-text: 255 145 37;
293
+ --os-color-warning-textHover: 255 167 50;
294
+ --os-color-info-fill: 0 175 255;
295
+ --os-color-info-text: 58 182 255;
296
+ --os-color-info-textHover: 44 193 255;
297
+ --os-color-success-fill: 70 169 74;
298
+ --os-color-success-text: 96 194 99;
299
+ --os-color-success-textHover: 103 193 107;
300
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
301
+ --os-color-misc-divider: 108 108 108;
302
+ }
303
+ }
304
+ @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
305
+ :root:not(.light) {
306
+ --os-color-text-primary: 243 227 206;
307
+ --os-color-text-secondary: 202 181 154;
308
+ --os-color-accent-contrast: 43 31 18;
309
+ --os-color-secondary-contrast: 243 227 206;
310
+ --os-color-error-main: 253 96 94;
311
+ --os-color-error-dark: 247 102 93;
312
+ --os-color-error-fill: 253 96 94;
313
+ --os-color-error-text: 255 168 165;
314
+ --os-color-error-textHover: 255 139 138;
315
+ --os-color-warning-fill: 255 140 10;
316
+ --os-color-warning-text: 255 145 37;
317
+ --os-color-warning-textHover: 255 167 50;
318
+ --os-color-info-fill: 0 175 255;
319
+ --os-color-info-text: 58 182 255;
320
+ --os-color-info-textHover: 44 193 255;
321
+ --os-color-success-fill: 70 169 74;
322
+ --os-color-success-text: 96 194 99;
323
+ --os-color-success-textHover: 103 193 107;
324
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
325
+ --os-color-misc-divider: 108 108 108;
326
+ }
327
+ }
@@ -171,3 +171,46 @@
171
171
  --os-color-misc-tooltipBg: 252 248 242;
172
172
  --os-color-misc-tooltipText: 43 31 18;
173
173
  }
174
+ @media (prefers-contrast: more) {
175
+ :root {
176
+ --os-color-text-secondary: 88 68 48;
177
+ --os-color-accent-contrast: 7 2 0;
178
+ --os-color-secondary-contrast: 29 17 5;
179
+ --os-color-error-main: 182 0 21;
180
+ --os-color-error-text: 128 0 10;
181
+ --os-color-error-textHover: 149 3 15;
182
+ --os-color-warning-fill: 150 62 0;
183
+ --os-color-warning-text: 124 49 0;
184
+ --os-color-warning-textHover: 124 49 0;
185
+ --os-color-info-fill: 0 93 149;
186
+ --os-color-info-text: 0 76 120;
187
+ --os-color-info-textHover: 0 76 120;
188
+ --os-color-success-fill: 36 101 40;
189
+ --os-color-success-text: 15 84 22;
190
+ --os-color-success-textHover: 15 84 22;
191
+ --os-color-actionOutlinedBorder-enabled: 128 128 128;
192
+ --os-color-misc-divider: 128 128 128;
193
+ }
194
+ .dark {
195
+ --os-color-text-primary: 243 227 206;
196
+ --os-color-text-secondary: 202 181 154;
197
+ --os-color-accent-contrast: 43 31 18;
198
+ --os-color-secondary-contrast: 243 227 206;
199
+ --os-color-error-main: 253 96 94;
200
+ --os-color-error-dark: 247 102 93;
201
+ --os-color-error-fill: 253 96 94;
202
+ --os-color-error-text: 255 168 165;
203
+ --os-color-error-textHover: 255 139 138;
204
+ --os-color-warning-fill: 255 140 10;
205
+ --os-color-warning-text: 255 145 37;
206
+ --os-color-warning-textHover: 255 167 50;
207
+ --os-color-info-fill: 0 175 255;
208
+ --os-color-info-text: 58 182 255;
209
+ --os-color-info-textHover: 44 193 255;
210
+ --os-color-success-fill: 70 169 74;
211
+ --os-color-success-text: 96 194 99;
212
+ --os-color-success-textHover: 103 193 107;
213
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
214
+ --os-color-misc-divider: 108 108 108;
215
+ }
216
+ }
@@ -258,3 +258,65 @@
258
258
  --os-color-misc-tooltipText: 0 0 0;
259
259
  }
260
260
  }
261
+ @media (prefers-contrast: more) {
262
+ :root {
263
+ --os-color-text-secondary: 76 76 76;
264
+ --os-color-secondary-dark: 149 149 149;
265
+ --os-color-error-main: 182 0 21;
266
+ --os-color-error-text: 128 0 10;
267
+ --os-color-error-textHover: 154 13 20;
268
+ --os-color-warning-fill: 150 62 0;
269
+ --os-color-warning-text: 130 52 0;
270
+ --os-color-warning-textHover: 130 52 0;
271
+ --os-color-info-fill: 0 93 149;
272
+ --os-color-info-text: 0 79 129;
273
+ --os-color-info-textHover: 0 79 129;
274
+ --os-color-success-fill: 36 101 40;
275
+ --os-color-success-text: 20 88 26;
276
+ --os-color-success-textHover: 20 88 26;
277
+ --os-color-actionOutlinedBorder-enabled: 133 133 133;
278
+ --os-color-misc-divider: 133 133 133;
279
+ }
280
+ .dark {
281
+ --os-color-text-secondary: 193 193 193;
282
+ --os-color-secondary-dark: 69 69 69;
283
+ --os-color-error-main: 253 96 94;
284
+ --os-color-error-dark: 247 102 93;
285
+ --os-color-error-fill: 253 96 94;
286
+ --os-color-error-text: 255 171 167;
287
+ --os-color-error-textHover: 255 146 144;
288
+ --os-color-warning-fill: 255 140 10;
289
+ --os-color-warning-text: 255 151 57;
290
+ --os-color-warning-textHover: 255 167 50;
291
+ --os-color-info-fill: 0 175 255;
292
+ --os-color-info-text: 72 186 255;
293
+ --os-color-info-textHover: 44 193 255;
294
+ --os-color-success-fill: 70 169 74;
295
+ --os-color-success-text: 100 197 102;
296
+ --os-color-success-textHover: 105 196 109;
297
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
298
+ --os-color-misc-divider: 111 111 111;
299
+ }
300
+ }
301
+ @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
302
+ :root:not(.light) {
303
+ --os-color-text-secondary: 193 193 193;
304
+ --os-color-secondary-dark: 69 69 69;
305
+ --os-color-error-main: 253 96 94;
306
+ --os-color-error-dark: 247 102 93;
307
+ --os-color-error-fill: 253 96 94;
308
+ --os-color-error-text: 255 171 167;
309
+ --os-color-error-textHover: 255 146 144;
310
+ --os-color-warning-fill: 255 140 10;
311
+ --os-color-warning-text: 255 151 57;
312
+ --os-color-warning-textHover: 255 167 50;
313
+ --os-color-info-fill: 0 175 255;
314
+ --os-color-info-text: 72 186 255;
315
+ --os-color-info-textHover: 44 193 255;
316
+ --os-color-success-fill: 70 169 74;
317
+ --os-color-success-text: 100 197 102;
318
+ --os-color-success-textHover: 105 196 109;
319
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
320
+ --os-color-misc-divider: 111 111 111;
321
+ }
322
+ }
@@ -171,3 +171,43 @@
171
171
  --os-color-misc-tooltipBg: 255 255 255;
172
172
  --os-color-misc-tooltipText: 0 0 0;
173
173
  }
174
+ @media (prefers-contrast: more) {
175
+ :root {
176
+ --os-color-text-secondary: 76 76 76;
177
+ --os-color-secondary-dark: 149 149 149;
178
+ --os-color-error-main: 182 0 21;
179
+ --os-color-error-text: 128 0 10;
180
+ --os-color-error-textHover: 154 13 20;
181
+ --os-color-warning-fill: 150 62 0;
182
+ --os-color-warning-text: 130 52 0;
183
+ --os-color-warning-textHover: 130 52 0;
184
+ --os-color-info-fill: 0 93 149;
185
+ --os-color-info-text: 0 79 129;
186
+ --os-color-info-textHover: 0 79 129;
187
+ --os-color-success-fill: 36 101 40;
188
+ --os-color-success-text: 20 88 26;
189
+ --os-color-success-textHover: 20 88 26;
190
+ --os-color-actionOutlinedBorder-enabled: 133 133 133;
191
+ --os-color-misc-divider: 133 133 133;
192
+ }
193
+ .dark {
194
+ --os-color-text-secondary: 193 193 193;
195
+ --os-color-secondary-dark: 69 69 69;
196
+ --os-color-error-main: 253 96 94;
197
+ --os-color-error-dark: 247 102 93;
198
+ --os-color-error-fill: 253 96 94;
199
+ --os-color-error-text: 255 171 167;
200
+ --os-color-error-textHover: 255 146 144;
201
+ --os-color-warning-fill: 255 140 10;
202
+ --os-color-warning-text: 255 151 57;
203
+ --os-color-warning-textHover: 255 167 50;
204
+ --os-color-info-fill: 0 175 255;
205
+ --os-color-info-text: 72 186 255;
206
+ --os-color-info-textHover: 44 193 255;
207
+ --os-color-success-fill: 70 169 74;
208
+ --os-color-success-text: 100 197 102;
209
+ --os-color-success-textHover: 105 196 109;
210
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
211
+ --os-color-misc-divider: 111 111 111;
212
+ }
213
+ }
@@ -15,9 +15,9 @@
15
15
  --os-color-primary-dark: 38 38 38;
16
16
  --os-color-primary-light: 136 136 136;
17
17
  --os-color-primary-contrast: 255 255 255;
18
- --os-color-secondary-main: 110 122 90;
19
- --os-color-secondary-dark: 93 104 73;
20
- --os-color-secondary-light: 130 141 107;
18
+ --os-color-secondary-main: 93 104 73;
19
+ --os-color-secondary-dark: 59 70 40;
20
+ --os-color-secondary-light: 110 122 90;
21
21
  --os-color-secondary-contrast: 255 255 255;
22
22
  --os-color-error-main: 211 47 47;
23
23
  --os-color-error-dark: 168 33 33;
@@ -100,9 +100,9 @@
100
100
  --os-color-primary-dark: 233 233 233;
101
101
  --os-color-primary-light: 154 154 154;
102
102
  --os-color-primary-contrast: 0 0 0;
103
- --os-color-secondary-main: 110 122 90;
104
- --os-color-secondary-dark: 93 104 73;
105
- --os-color-secondary-light: 130 141 107;
103
+ --os-color-secondary-main: 93 104 73;
104
+ --os-color-secondary-dark: 59 70 40;
105
+ --os-color-secondary-light: 110 122 90;
106
106
  --os-color-secondary-contrast: 255 255 255;
107
107
  --os-color-error-main: 231 76 76;
108
108
  --os-color-error-dark: 178 35 35;
@@ -186,9 +186,9 @@
186
186
  --os-color-primary-dark: 233 233 233;
187
187
  --os-color-primary-light: 154 154 154;
188
188
  --os-color-primary-contrast: 0 0 0;
189
- --os-color-secondary-main: 110 122 90;
190
- --os-color-secondary-dark: 93 104 73;
191
- --os-color-secondary-light: 130 141 107;
189
+ --os-color-secondary-main: 93 104 73;
190
+ --os-color-secondary-dark: 59 70 40;
191
+ --os-color-secondary-light: 110 122 90;
192
192
  --os-color-secondary-contrast: 255 255 255;
193
193
  --os-color-error-main: 231 76 76;
194
194
  --os-color-error-dark: 178 35 35;
@@ -258,3 +258,71 @@
258
258
  --os-color-misc-tooltipText: 28 34 19;
259
259
  }
260
260
  }
261
+ @media (prefers-contrast: more) {
262
+ :root {
263
+ --os-color-text-secondary: 65 75 44;
264
+ --os-color-secondary-main: 82 93 63;
265
+ --os-color-error-main: 182 0 21;
266
+ --os-color-error-text: 128 0 10;
267
+ --os-color-error-textHover: 148 1 14;
268
+ --os-color-warning-fill: 150 62 0;
269
+ --os-color-warning-text: 123 49 0;
270
+ --os-color-warning-textHover: 123 49 0;
271
+ --os-color-info-fill: 0 93 149;
272
+ --os-color-info-text: 0 75 120;
273
+ --os-color-info-textHover: 0 75 120;
274
+ --os-color-success-fill: 36 101 40;
275
+ --os-color-success-text: 13 83 21;
276
+ --os-color-success-textHover: 13 83 21;
277
+ --os-color-actionOutlinedBorder-enabled: 128 128 128;
278
+ --os-color-misc-divider: 128 128 128;
279
+ }
280
+ .dark {
281
+ --os-color-text-primary: 222 235 204;
282
+ --os-color-text-secondary: 177 190 152;
283
+ --os-color-secondary-main: 162 175 141;
284
+ --os-color-secondary-dark: 161 175 140;
285
+ --os-color-secondary-contrast: 28 34 19;
286
+ --os-color-error-main: 253 96 94;
287
+ --os-color-error-dark: 247 102 93;
288
+ --os-color-error-fill: 253 96 94;
289
+ --os-color-error-text: 255 168 165;
290
+ --os-color-error-textHover: 255 135 134;
291
+ --os-color-warning-fill: 255 140 10;
292
+ --os-color-warning-text: 255 141 15;
293
+ --os-color-warning-textHover: 255 167 50;
294
+ --os-color-info-fill: 0 175 255;
295
+ --os-color-info-text: 45 180 255;
296
+ --os-color-info-textHover: 44 193 255;
297
+ --os-color-success-fill: 70 169 74;
298
+ --os-color-success-text: 93 191 96;
299
+ --os-color-success-textHover: 103 193 107;
300
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
301
+ --os-color-misc-divider: 106 106 106;
302
+ }
303
+ }
304
+ @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
305
+ :root:not(.light) {
306
+ --os-color-text-primary: 222 235 204;
307
+ --os-color-text-secondary: 177 190 152;
308
+ --os-color-secondary-main: 162 175 141;
309
+ --os-color-secondary-dark: 161 175 140;
310
+ --os-color-secondary-contrast: 28 34 19;
311
+ --os-color-error-main: 253 96 94;
312
+ --os-color-error-dark: 247 102 93;
313
+ --os-color-error-fill: 253 96 94;
314
+ --os-color-error-text: 255 168 165;
315
+ --os-color-error-textHover: 255 135 134;
316
+ --os-color-warning-fill: 255 140 10;
317
+ --os-color-warning-text: 255 141 15;
318
+ --os-color-warning-textHover: 255 167 50;
319
+ --os-color-info-fill: 0 175 255;
320
+ --os-color-info-text: 45 180 255;
321
+ --os-color-info-textHover: 44 193 255;
322
+ --os-color-success-fill: 70 169 74;
323
+ --os-color-success-text: 93 191 96;
324
+ --os-color-success-textHover: 103 193 107;
325
+ --os-color-actionOutlinedBorder-enabled: 123 123 123;
326
+ --os-color-misc-divider: 106 106 106;
327
+ }
328
+ }