@ptlm-azulejo/datepicker 0.1.0-alpha.67 → 0.1.0-alpha.70

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
@@ -6,30 +6,83 @@ To put a label, requirement text, help text or to apply a valid or invalid messa
6
6
 
7
7
  ## Installation
8
8
 
9
+ Install the datepicker, the theme package, and **the font package matching your
10
+ project's brand**:
11
+
12
+ **Leroy Merlin projects**
13
+
14
+ ```bash
15
+ npm install @ptlm-azulejo/datepicker @ptlm-azulejo/themes @ptlm-azulejo/fonts-leroy-merlin
16
+ # or
17
+ yarn add @ptlm-azulejo/datepicker @ptlm-azulejo/themes @ptlm-azulejo/fonts-leroy-merlin
18
+ ```
19
+
20
+ **Adeo projects**
21
+
9
22
  ```bash
10
- npm install @ptlm-azulejo/datepicker @ptlm-azulejo/themes
23
+ npm install @ptlm-azulejo/datepicker @ptlm-azulejo/themes @ptlm-azulejo/fonts-adeo
11
24
  # or
12
- yarn add @ptlm-azulejo/datepicker @ptlm-azulejo/themes
25
+ yarn add @ptlm-azulejo/datepicker @ptlm-azulejo/themes @ptlm-azulejo/fonts-adeo
13
26
  ```
14
27
 
15
28
  ## Styles & theming
16
29
 
17
- The component reads theme CSS variables, so it needs `@ptlm-azulejo/themes`. Import a
18
- brand preset (it bundles the base tokens) and the component styles, then set the
19
- brand class on the root element:
30
+ The component ships no colors or typeface of its own — it reads design tokens from
31
+ CSS variables at runtime. Those tokens come from `@ptlm-azulejo/themes`, and **the
32
+ brand is selected by a class on your app's `<html>` element**, so switching brand
33
+ never touches component code.
34
+
35
+ | Project | Preset stylesheet | Root class | Typeface | Font package |
36
+ | --- | --- | --- | --- | --- |
37
+ | Leroy Merlin | `@ptlm-azulejo/themes/presets/leroy-merlin.css` | `preset-lm` | LeroyMerlinSans | `@ptlm-azulejo/fonts-leroy-merlin` |
38
+ | Adeo | `@ptlm-azulejo/themes/presets/adeo.css` | `preset-adeo` | Roboto | `@ptlm-azulejo/fonts-adeo` |
39
+
40
+ **Leroy Merlin projects**
41
+
42
+ ```js
43
+ import '@ptlm-azulejo/themes/presets/leroy-merlin.css'
44
+ import '@ptlm-azulejo/fonts-leroy-merlin'
45
+ import '@ptlm-azulejo/datepicker/style.css'
46
+ ```
47
+
48
+ ```html
49
+ <html lang="pt" class="preset-lm">
50
+ ```
51
+
52
+ **Adeo projects**
20
53
 
21
54
  ```js
22
- import '@ptlm-azulejo/themes/presets/leroy-merlin.css' // or /presets/adeo.css
55
+ import '@ptlm-azulejo/themes/presets/adeo.css'
56
+ import '@ptlm-azulejo/fonts-adeo'
23
57
  import '@ptlm-azulejo/datepicker/style.css'
24
58
  ```
25
59
 
26
60
  ```html
27
- <html class="preset-lm" data-theme="dark">
61
+ <html lang="pt" class="preset-adeo">
62
+ ```
63
+
64
+ > The preset class is what resolves the brand at runtime. Without it — even with
65
+ > the stylesheets imported — the component renders uncolored and in a fallback
66
+ > typeface. See the [themes package](../themes/README.md) for brand switching,
67
+ > dark mode, and custom brands.
68
+
69
+ ### Light and dark mode
70
+
71
+ Add `data-theme` alongside the brand class to pin the color scheme. Leave it off
72
+ and the preset follows the OS `prefers-color-scheme`:
73
+
74
+ ```html
75
+ <html lang="pt" class="preset-lm" data-theme="dark">
28
76
  ```
29
77
 
30
- > Without a preset **and** the `.preset-*` class, the component renders uncolored.
31
- > See the [themes package](../themes/README.md) for brand switching, dark mode,
32
- > and custom brands.
78
+ ### Why the font package is separate
79
+
80
+ The preset only *names* its typeface in `--font-family` and ships no font files.
81
+ [Loading them is your app's job](../themes/README.md#fonts), as with upstream
82
+ Mozaic, so you keep control of hosting, subsetting and preload. Without the
83
+ matching font package, `font-sans` falls back to a generic sans-serif. A
84
+ multi-brand app can install both and switch by swapping the `.preset-*` class:
85
+ only the active brand's file is ever downloaded.
33
86
 
34
87
  ## Props
35
88
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.stories.d.ts","sourceRoot":"","sources":["../../src/index.stories.ts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,EAAE,KAKtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAOxB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAM/B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptlm-azulejo/datepicker",
3
- "version": "0.1.0-alpha.67",
3
+ "version": "0.1.0-alpha.70",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",