oneslash-design-system 2.11.0 → 2.13.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/README.md CHANGED
@@ -38,12 +38,14 @@ 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
- [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.
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. An Android app wraps its content in `OneSlashTheme(theme = OdsTheme.Forest) { … }` from the Compose library in `native/android` (`io.github.oneslash-app:oneslash-design`; see [PUBLISHING.md](./native/android/PUBLISHING.md) for whether it is on Maven Central yet).
47
49
 
48
50
  ## Building a page
49
51
 
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 |
@@ -110,7 +110,7 @@ Use one semantic name, never a hex value. Each name resolves to a light and a da
110
110
 
111
111
  ## Increased contrast
112
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`.
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
114
 
115
115
  - **Web:** each theme file answers `prefers-contrast: more`. Nothing to do per page or component.
116
116
  - **Apple:** each color in the Swift package follows the system's Increase Contrast setting. Nothing to do per screen.
@@ -217,13 +217,15 @@ Spacing and radius tokens apply to our own content views. System containers (lis
217
217
 
218
218
  Platforms: iOS 26 and macOS 26 and later.
219
219
 
220
- 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")`.
221
221
  2. `import OneSlashDesign`.
222
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.
223
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`.
224
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.
225
225
  6. Spacing, radius and motion are constants for our own content views: `ODSSpacing`, `ODSRadius` and `ODSDuration` (in seconds).
226
- 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.
227
229
 
228
230
  Limits to know:
229
231
 
@@ -232,6 +234,36 @@ Limits to know:
232
234
  - Each scene needs its own `.odsTheme`, for example a macOS `Settings` scene as well as the main window.
233
235
  - For motion, prefer the platform's springs. Use `ODSDuration` only for our own content views.
234
236
 
237
+ ### The Android rules
238
+
239
+ On Android the Material components ship inside the app, not the OS. These rules are the counterpart of the OS-update rules.
240
+
241
+ 1. Stable, public API only. No experimental opt-ins in shared code, no reflection, no internal Compose API.
242
+ 2. Material components keep their standard form. Color them through the theme, not per-call color overrides.
243
+ 3. System bars are the system's. Edge to edge; take insets from `WindowInsets`; set no bar colors.
244
+ 4. Brand enters only through the theme: the Material color scheme and the ODS extended colors.
245
+ 5. No fixed system metrics. No hard-coded bar heights or inset numbers.
246
+ 6. System type. The Material type scale with the device font, in `sp`, so font scaling works.
247
+ 7. Material Symbols for icons.
248
+ 8. Colors come from the theme. No branching on dark mode in screens.
249
+ 9. Build with the current SDK and the current Compose release, and check both once a year.
250
+
251
+ ### Adopting the Compose library
252
+
253
+ Kotlin and Jetpack Compose with Material 3. The library is `io.github.oneslash-app:oneslash-design`, with the same version as the npm package. It is in `native/android` of the repository and is published to Maven Central once publishing is set up; check before depending on it by coordinates.
254
+
255
+ 1. Wrap the app's content once: `OneSlashTheme(theme = OdsTheme.Forest) { … }`. The themes are `OdsTheme.Default`, `Forest`, `Clay`, `Indigo` and `Wine`. It follows the system's dark mode, and takes the increased-contrast colors when the system's contrast setting is medium or high (Android 14 and later).
256
+ 2. Use Material 3 components as they are. `MaterialTheme.colorScheme` is filled from the theme: the surfaces are `background.default` and `background.accent100`, `onSurfaceVariant` is `text.secondary`, `error` is `error.text`. `primary` is `accent.main` with `accent.contrast` on it, except in the default and clay themes in light mode: Material draws `primary` as text as well as a fill, and those accents are about 1.6:1 as text, so there `primary` is the neutral strong color (`primary.dark`). The accent is a fill in every theme through `tertiaryContainer`, for example a floating action button's container color.
257
+ 3. Read the colors Material has no role for from `OneSlashTheme.colors`, for example `OneSlashTheme.colors.warningFill` or `backgroundAccent300`. The names are the color table's, in camel case.
258
+ 4. Shapes and type are Material's defaults. `OdsSpacing`, `OdsRadius` and `OdsDuration` are for our own content.
259
+ 5. Parts: `OdsBanner`, `OdsTag`, `OdsAvatar` and `OdsEmptyState`. `OdsAvatar` takes a `Painter`; load the picture with the app's own image library.
260
+ 6. Do not use dynamic color (Material You): the theme is the brand.
261
+
262
+ Limits to know:
263
+
264
+ - Material's surface containers stop at `background.accent100`. The lighter ODS surfaces are for our own content, where we choose the text on them: secondary text fails on them in dark mode.
265
+ - Outlined borders (`outline`) are the web's outlined border, which is below 3:1 on the page in light mode and reaches it under increased contrast.
266
+
235
267
  ### Type roles
236
268
 
237
269
  ODS type roles map to system text styles, so they keep Dynamic Type. No font files ship with the native packages.
@@ -253,14 +285,14 @@ ODS type roles map to system text styles, so they keep Dynamic Type. No font fil
253
285
 
254
286
  ### Component mapping
255
287
 
256
- 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.
288
+ For each web component, the table gives the native control to use. System controls keep their standard styles; ODS supplies only tokens. A name starting with `ODS` (Swift) or `Ods` (Compose) is a part ODS ships. "Not applicable: web page pattern" means the web component has no native counterpart; use the note.
257
289
 
258
290
  | ODS | SwiftUI | Compose | Note |
259
291
  | --- | --- | --- | --- |
260
- | alert | ODS part (planned) | ODS part (planned) | Until then: SwiftUI `.alert` for messages that need a decision; Compose `Snackbar` in a `SnackbarHost` for toasts. |
261
- | 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. |
292
+ | alert | `ODSBanner` for an inline message; `.alert` for one that needs a decision | `OdsBanner` for an inline message; `AlertDialog` for one that needs a decision | ODS has no native toast: on Android use `Snackbar` in a `SnackbarHost`. |
293
+ | 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`. |
262
294
  | checkBox | `Toggle` (switch on iOS, `.toggleStyle(.checkbox)` on macOS) | `Checkbox` | |
263
- | emptyBox | ODS part (planned) | ODS part (planned) | Until then: SwiftUI `ContentUnavailableView`; Compose a centered `Icon` and `Text` in a `Column`. |
295
+ | emptyBox | `ContentUnavailableView` | `OdsEmptyState` | The system has this control on Apple, so ODS adds no part there. Material has none, so ODS does. |
264
296
  | factsRow | Not applicable: web page pattern | Not applicable: web page pattern | In an app screen: `LabeledContent` rows in a `Form` / `ListItem` rows. |
265
297
  | 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. |
266
298
  | 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() }` | |
@@ -292,9 +324,44 @@ For each web component, the table gives the native control to use. System contro
292
324
  | tableHeaderCell | A `TableColumn` title | `Text` in the header `Row` | Material 3 has no table. |
293
325
  | tableRow | `TableRow` | `Row` | Material 3 has no table. |
294
326
  | tabsContainer | `TabView` or segmented `Picker` | `PrimaryTabRow` | `TabRow` is deprecated in Material 3. |
295
- | tag | ODS part (planned) | ODS part (planned) | Until then: SwiftUI `.badge` for counts, else a `Label`; Compose `AssistChip` or `FilterChip`. |
327
+ | tag | `ODSTag` | `OdsTag` | A count on a list row or tab stays `.badge` / `Badge`. A tag that acts: wrap `ODSTag` in a `Button` with the plain style; on Android use a Material `AssistChip` or `FilterChip`, which are made to be pressed. |
296
328
  | textarea | `TextField(_:text:axis: .vertical)` or `TextEditor` | `OutlinedTextField` with `minLines` | |
297
329
  | textField | `TextField` (`SecureField` for passwords) | `OutlinedTextField` or `TextField` | |
298
330
  | timeStamp | `Text(_:style:)` (`.relative`) or `Text(_:format:)` (`.dateTime`) | `Text` with `DateUtils.getRelativeTimeSpanString` or `DateTimeFormatter.ofLocalizedDateTime` | |
299
331
  | tooltip | `.help` | `TooltipBox` | `.help` shows on pointer hover only. `TooltipBox` needs `@OptIn(ExperimentalMaterial3Api::class)`. |
300
- | 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. |
332
+ | userImage | `ODSAvatar` | `OdsAvatar` | Load the picture yourself and pass it as an `Image` / a `Painter`. |
333
+
334
+ ### Parts
335
+
336
+ 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.
337
+
338
+ A style is named `<part>.<variant>.<color or state>`. Each piece of it takes one color token.
339
+
340
+ | Style | Fill | Label | Border | Dot |
341
+ | --- | --- | --- | --- | --- |
342
+ | `banner.default` | `secondary.main` | `secondary.contrast` | | |
343
+ | `tag.contained.plain` | `background.accent300` | `text.primary` | `misc.divider` | |
344
+ | `tag.contained.selected` | `accent.main` | `accent.contrast` | `misc.divider` | |
345
+ | `tag.contained.default` | `secondary.main` | `secondary.contrast` | `misc.divider` | |
346
+ | `tag.textOnly.plain` | | `text.primary` | | |
347
+ | `tag.textOnly.selected` | | `text.primary` | `accent.main` | |
348
+ | `tag.textOnly.default` | | `text.secondary` | | |
349
+ | `tag.dot.plain` | | `text.primary` | | `text.secondary` |
350
+ | `tag.dot.selected` | | `text.primary` | | `text.secondary` |
351
+ | `tag.dot.default` | | `text.primary` | | `text.secondary` |
352
+ | `banner.error` | `error.alertBg` | `text.primary` | | |
353
+ | `tag.contained.error` | `error.fill` | `error.onFill` | `error.fill` | |
354
+ | `tag.textOnly.error` | | `error.text` | `error.fill` | |
355
+ | `tag.dot.error` | | `text.primary` | | `error.main` |
356
+ | `banner.warning` | `warning.alertBg` | `text.primary` | | |
357
+ | `tag.contained.warning` | `warning.fill` | `warning.onFill` | `warning.fill` | |
358
+ | `tag.textOnly.warning` | | `warning.text` | `warning.fill` | |
359
+ | `tag.dot.warning` | | `text.primary` | | `warning.main` |
360
+ | `banner.info` | `info.alertBg` | `text.primary` | | |
361
+ | `tag.contained.info` | `info.fill` | `info.onFill` | `info.fill` | |
362
+ | `tag.textOnly.info` | | `info.text` | `info.fill` | |
363
+ | `tag.dot.info` | | `text.primary` | | `info.main` |
364
+ | `banner.success` | `success.alertBg` | `text.primary` | | |
365
+ | `tag.contained.success` | `success.fill` | `success.onFill` | `success.fill` | |
366
+ | `tag.textOnly.success` | | `success.text` | `success.fill` | |
367
+ | `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)",
6
- "compose": "ODS part (planned)",
7
- "note": "Until then: SwiftUI `.alert` for messages that need a decision; Compose `Snackbar` in a `SnackbarHost` for toasts."
5
+ "swiftui": "`ODSBanner` for an inline message; `.alert` for one that needs a decision",
6
+ "compose": "`OdsBanner` for an inline message; `AlertDialog` for one that needs a decision",
7
+ "note": "ODS has no native toast: on Android use `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)",
23
- "compose": "ODS part (planned)",
24
- "note": "Until then: SwiftUI `ContentUnavailableView`; Compose a centered `Icon` and `Text` in a `Column`."
22
+ "swiftui": "`ContentUnavailableView`",
23
+ "compose": "`OdsEmptyState`",
24
+ "note": "The system has this control on Apple, so ODS adds no part there. Material has none, so ODS does."
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)",
204
- "compose": "ODS part (planned)",
205
- "note": "Until then: SwiftUI `.badge` for counts, else a `Label`; Compose `AssistChip` or `FilterChip`."
203
+ "swiftui": "`ODSTag`",
204
+ "compose": "`OdsTag`",
205
+ "note": "A count on a list row or tab stays `.badge` / `Badge`. A tag that acts: wrap `ODSTag` in a `Button` with the plain style; on Android use a Material `AssistChip` or `FilterChip`, which are made to be pressed."
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)",
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."
230
+ "swiftui": "`ODSAvatar`",
231
+ "compose": "`OdsAvatar`",
232
+ "note": "Load the picture yourself and pass it as an `Image` / a `Painter`."
233
233
  }
234
234
  ],
235
235
  "typeRoles": {
@@ -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;
@@ -262,7 +262,6 @@
262
262
  :root {
263
263
  --os-color-text-secondary: 65 75 44;
264
264
  --os-color-secondary-main: 82 93 63;
265
- --os-color-secondary-dark: 82 93 63;
266
265
  --os-color-error-main: 182 0 21;
267
266
  --os-color-error-text: 128 0 10;
268
267
  --os-color-error-textHover: 148 1 14;
@@ -281,8 +280,9 @@
281
280
  .dark {
282
281
  --os-color-text-primary: 222 235 204;
283
282
  --os-color-text-secondary: 177 190 152;
284
- --os-color-secondary-main: 82 93 63;
285
- --os-color-secondary-dark: 82 93 63;
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
286
  --os-color-error-main: 253 96 94;
287
287
  --os-color-error-dark: 247 102 93;
288
288
  --os-color-error-fill: 253 96 94;
@@ -305,8 +305,9 @@
305
305
  :root:not(.light) {
306
306
  --os-color-text-primary: 222 235 204;
307
307
  --os-color-text-secondary: 177 190 152;
308
- --os-color-secondary-main: 82 93 63;
309
- --os-color-secondary-dark: 82 93 63;
308
+ --os-color-secondary-main: 162 175 141;
309
+ --os-color-secondary-dark: 161 175 140;
310
+ --os-color-secondary-contrast: 28 34 19;
310
311
  --os-color-error-main: 253 96 94;
311
312
  --os-color-error-dark: 247 102 93;
312
313
  --os-color-error-fill: 253 96 94;
@@ -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;
@@ -175,7 +175,6 @@
175
175
  :root {
176
176
  --os-color-text-secondary: 65 75 44;
177
177
  --os-color-secondary-main: 82 93 63;
178
- --os-color-secondary-dark: 82 93 63;
179
178
  --os-color-error-main: 182 0 21;
180
179
  --os-color-error-text: 128 0 10;
181
180
  --os-color-error-textHover: 148 1 14;
@@ -194,8 +193,9 @@
194
193
  .dark {
195
194
  --os-color-text-primary: 222 235 204;
196
195
  --os-color-text-secondary: 177 190 152;
197
- --os-color-secondary-main: 82 93 63;
198
- --os-color-secondary-dark: 82 93 63;
196
+ --os-color-secondary-main: 162 175 141;
197
+ --os-color-secondary-dark: 161 175 140;
198
+ --os-color-secondary-contrast: 28 34 19;
199
199
  --os-color-error-main: 253 96 94;
200
200
  --os-color-error-dark: 247 102 93;
201
201
  --os-color-error-fill: 253 96 94;
package/dist/tokens.json CHANGED
@@ -4209,11 +4209,11 @@
4209
4209
  "$value": {
4210
4210
  "colorSpace": "srgb",
4211
4211
  "components": [
4212
- 0.43137254901960786,
4213
- 0.47843137254901963,
4214
- 0.35294117647058826
4212
+ 0.36470588235294116,
4213
+ 0.40784313725490196,
4214
+ 0.28627450980392155
4215
4215
  ],
4216
- "hex": "#6e7a5a"
4216
+ "hex": "#5d6849"
4217
4217
  }
4218
4218
  },
4219
4219
  "dark": {
@@ -4221,11 +4221,11 @@
4221
4221
  "$value": {
4222
4222
  "colorSpace": "srgb",
4223
4223
  "components": [
4224
- 0.36470588235294116,
4225
- 0.40784313725490196,
4226
- 0.28627450980392155
4224
+ 0.23137254901960785,
4225
+ 0.27450980392156865,
4226
+ 0.1568627450980392
4227
4227
  ],
4228
- "hex": "#5d6849"
4228
+ "hex": "#3b4628"
4229
4229
  }
4230
4230
  },
4231
4231
  "light": {
@@ -4233,11 +4233,11 @@
4233
4233
  "$value": {
4234
4234
  "colorSpace": "srgb",
4235
4235
  "components": [
4236
- 0.5098039215686274,
4237
- 0.5529411764705883,
4238
- 0.4196078431372549
4236
+ 0.43137254901960786,
4237
+ 0.47843137254901963,
4238
+ 0.35294117647058826
4239
4239
  ],
4240
- "hex": "#828d6b"
4240
+ "hex": "#6e7a5a"
4241
4241
  }
4242
4242
  },
4243
4243
  "contrast": {
@@ -5221,11 +5221,11 @@
5221
5221
  "$value": {
5222
5222
  "colorSpace": "srgb",
5223
5223
  "components": [
5224
- 0.43137254901960786,
5225
- 0.47843137254901963,
5226
- 0.35294117647058826
5224
+ 0.36470588235294116,
5225
+ 0.40784313725490196,
5226
+ 0.28627450980392155
5227
5227
  ],
5228
- "hex": "#6e7a5a"
5228
+ "hex": "#5d6849"
5229
5229
  }
5230
5230
  },
5231
5231
  "dark": {
@@ -5233,11 +5233,11 @@
5233
5233
  "$value": {
5234
5234
  "colorSpace": "srgb",
5235
5235
  "components": [
5236
- 0.36470588235294116,
5237
- 0.40784313725490196,
5238
- 0.28627450980392155
5236
+ 0.23137254901960785,
5237
+ 0.27450980392156865,
5238
+ 0.1568627450980392
5239
5239
  ],
5240
- "hex": "#5d6849"
5240
+ "hex": "#3b4628"
5241
5241
  }
5242
5242
  },
5243
5243
  "light": {
@@ -5245,11 +5245,11 @@
5245
5245
  "$value": {
5246
5246
  "colorSpace": "srgb",
5247
5247
  "components": [
5248
- 0.5098039215686274,
5249
- 0.5529411764705883,
5250
- 0.4196078431372549
5248
+ 0.43137254901960786,
5249
+ 0.47843137254901963,
5250
+ 0.35294117647058826
5251
5251
  ],
5252
- "hex": "#828d6b"
5252
+ "hex": "#6e7a5a"
5253
5253
  }
5254
5254
  },
5255
5255
  "contrast": {
@@ -6245,11 +6245,11 @@
6245
6245
  "$value": {
6246
6246
  "colorSpace": "srgb",
6247
6247
  "components": [
6248
- 0.3215686274509804,
6249
- 0.36470588235294116,
6250
- 0.24705882352941178
6248
+ 0.23137254901960785,
6249
+ 0.27450980392156865,
6250
+ 0.1568627450980392
6251
6251
  ],
6252
- "hex": "#525d3f"
6252
+ "hex": "#3b4628"
6253
6253
  }
6254
6254
  },
6255
6255
  "light": {
@@ -6257,11 +6257,11 @@
6257
6257
  "$value": {
6258
6258
  "colorSpace": "srgb",
6259
6259
  "components": [
6260
- 0.5098039215686274,
6261
- 0.5529411764705883,
6262
- 0.4196078431372549
6260
+ 0.43137254901960786,
6261
+ 0.47843137254901963,
6262
+ 0.35294117647058826
6263
6263
  ],
6264
- "hex": "#828d6b"
6264
+ "hex": "#6e7a5a"
6265
6265
  }
6266
6266
  },
6267
6267
  "contrast": {
@@ -7245,11 +7245,11 @@
7245
7245
  "$value": {
7246
7246
  "colorSpace": "srgb",
7247
7247
  "components": [
7248
- 0.3215686274509804,
7249
- 0.36470588235294116,
7250
- 0.24705882352941178
7248
+ 0.6352941176470588,
7249
+ 0.6862745098039216,
7250
+ 0.5529411764705883
7251
7251
  ],
7252
- "hex": "#525d3f"
7252
+ "hex": "#a2af8d"
7253
7253
  }
7254
7254
  },
7255
7255
  "dark": {
@@ -7257,11 +7257,11 @@
7257
7257
  "$value": {
7258
7258
  "colorSpace": "srgb",
7259
7259
  "components": [
7260
- 0.3215686274509804,
7261
- 0.36470588235294116,
7262
- 0.24705882352941178
7260
+ 0.6313725490196078,
7261
+ 0.6862745098039216,
7262
+ 0.5490196078431373
7263
7263
  ],
7264
- "hex": "#525d3f"
7264
+ "hex": "#a1af8c"
7265
7265
  }
7266
7266
  },
7267
7267
  "light": {
@@ -7269,11 +7269,11 @@
7269
7269
  "$value": {
7270
7270
  "colorSpace": "srgb",
7271
7271
  "components": [
7272
- 0.5098039215686274,
7273
- 0.5529411764705883,
7274
- 0.4196078431372549
7272
+ 0.43137254901960786,
7273
+ 0.47843137254901963,
7274
+ 0.35294117647058826
7275
7275
  ],
7276
- "hex": "#828d6b"
7276
+ "hex": "#6e7a5a"
7277
7277
  }
7278
7278
  },
7279
7279
  "contrast": {
@@ -7281,11 +7281,11 @@
7281
7281
  "$value": {
7282
7282
  "colorSpace": "srgb",
7283
7283
  "components": [
7284
- 1,
7285
- 1,
7286
- 1
7284
+ 0.10980392156862745,
7285
+ 0.13333333333333333,
7286
+ 0.07450980392156863
7287
7287
  ],
7288
- "hex": "#ffffff"
7288
+ "hex": "#1c2213"
7289
7289
  }
7290
7290
  }
7291
7291
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oneslash-design-system",
3
3
  "description": "A design system for the Oneslash projects",
4
- "version": "2.11.0",
4
+ "version": "2.13.0",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "./dist/index.js",