@lilydesignsystem/solid-picker-bar 0.1.0 → 0.2.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
@@ -61,9 +61,12 @@ if you add `shareProps={{ copyLabel: "Copy link" }}`.
61
61
  ## Defaults
62
62
 
63
63
  - **`themes`** defaults to `DEFAULT_THEMES` — all 63 Lily reference
64
- theme slugs, alphabetical, with the 8 United Kingdom / United States
65
- government themes moved to their own alphabetical group at the
66
- bottom. Pass your own `themes` array to override.
64
+ theme slugs: the 36 generic themes alphabetically, then the 27 company
65
+ and public-sector themes alphabetically by label.
66
+ `DEFAULT_THEME_LABELS` gives the names title-casing gets wrong ("IBM
67
+ Carbon", "GitHub Primer", "NHS England (patients)"); your own
68
+ `themeProps.themeLabels` win. Pass your own `themes` array to
69
+ override.
67
70
  - **`sizes`** defaults to `DEFAULT_SIZES` — the seven-step scale
68
71
  `largest`, `larger`, `large`, `normal`, `small`, `smaller`,
69
72
  `smallest` — and the text-size picker starts on `normal`. Pass your
package/dist/index.js CHANGED
@@ -22,26 +22,20 @@ function withDefaults(defaults, props) {
22
22
  // PickerBar.tsx
23
23
  var _tmpl$ = /* @__PURE__ */ template(`<div><!><!><!><!><!><!><!>`);
24
24
  /**
25
- * All 63 Lily reference theme slugs (see `themes/` at the repo root),
26
- * sorted alphabetically except the United Kingdom and United States
27
- * government/public-sector themes, which sort last as one alphabetical
28
- * group of their own. Mirrors `theme-picker`'s own title-casing of each
29
- * slug, so no `themeLabels` override is needed for these to read well.
25
+ * All 63 Lily reference theme slugs (see `themes/` at the repo root): the 36
26
+ * generic themes alphabetically, then the 27 themes that follow a company's
27
+ * or a public body's design system, alphabetically by their label
28
+ * (`DEFAULT_THEME_LABELS`, else the title-cased slug), so "NHS England
29
+ * (patients)" sorts under N.
30
30
  */
31
31
  var DEFAULT_THEMES = [
32
32
  "abyss",
33
33
  "acid",
34
- "adobe-spectrum",
35
- "ant-design",
36
34
  "aqua",
37
- "atlassian",
38
- "australia-agriculture-design-system",
39
35
  "autumn",
40
36
  "black",
41
- "brazil-padrao-digital-de-governo",
42
37
  "bumblebee",
43
38
  "business",
44
- "canada-government-of-canada-design-system",
45
39
  "cappuccino",
46
40
  "caramellatte",
47
41
  "cmyk",
@@ -53,47 +47,76 @@ var DEFAULT_THEMES = [
53
47
  "dim",
54
48
  "dracula",
55
49
  "emerald",
56
- "european-union-europa-component-library",
57
- "excel",
58
50
  "fantasy",
59
- "fluent",
60
51
  "forest",
61
52
  "garden",
62
- "github-primer",
63
53
  "halloween",
64
- "ibm-carbon",
65
- "japan-digital-agency-design-system",
66
54
  "lemonade",
67
55
  "light",
68
- "linear",
69
56
  "lofi",
70
57
  "luxury",
71
- "mozilla-protocol",
72
58
  "night",
73
59
  "nord",
74
- "notion",
75
60
  "pastel",
76
61
  "retro",
77
- "salesforce",
78
- "sap-fiori",
79
62
  "silk",
80
- "singapore-government-design-system",
81
63
  "sunset",
82
64
  "synthwave",
83
65
  "valentine",
84
- "vercel",
85
66
  "winter",
86
67
  "wireframe",
68
+ "adobe-spectrum",
69
+ "ant-design",
70
+ "atlassian",
71
+ "australia-agriculture-design-system",
72
+ "brazil-padrao-digital-de-governo",
73
+ "canada-government-of-canada-design-system",
74
+ "european-union-europa-component-library",
75
+ "excel",
76
+ "fluent",
77
+ "github-primer",
87
78
  "united-kingdom-government-digital-service",
79
+ "ibm-carbon",
80
+ "japan-digital-agency-design-system",
81
+ "linear",
82
+ "mozilla-protocol",
88
83
  "united-kingdom-national-health-service-england-for-patients",
89
84
  "united-kingdom-national-health-service-england-for-practitioners",
90
85
  "united-kingdom-national-health-service-scotland-for-patients",
91
86
  "united-kingdom-national-health-service-scotland-for-practitioners",
92
87
  "united-kingdom-national-health-service-wales-for-patients",
93
88
  "united-kingdom-national-health-service-wales-for-practitioners",
94
- "united-states-web-design-system"
89
+ "notion",
90
+ "salesforce",
91
+ "sap-fiori",
92
+ "singapore-government-design-system",
93
+ "united-states-web-design-system",
94
+ "vercel"
95
95
  ];
96
96
  /**
97
+ * Labels for the default themes whose title-cased slug reads wrongly: an
98
+ * abbreviation ("IBM Carbon", not "Ibm Carbon"), an accent or a small word,
99
+ * or a public body's own short name ("NHS England (patients)"). They are
100
+ * proper names, not prose to translate. A consumer's own theme labels win
101
+ * over each one.
102
+ */
103
+ var DEFAULT_THEME_LABELS = {
104
+ cmyk: "CMYK",
105
+ "brazil-padrao-digital-de-governo": "Brazil Padrão Digital de Governo",
106
+ "canada-government-of-canada-design-system": "Canada Government of Canada Design System",
107
+ "github-primer": "GitHub Primer",
108
+ "ibm-carbon": "IBM Carbon",
109
+ "sap-fiori": "SAP Fiori",
110
+ "united-kingdom-government-digital-service": "GOV.UK Design System",
111
+ "united-kingdom-national-health-service-england-for-patients": "NHS England (patients)",
112
+ "united-kingdom-national-health-service-england-for-practitioners": "NHS England (practitioners)",
113
+ "united-kingdom-national-health-service-scotland-for-patients": "NHS Scotland (patients)",
114
+ "united-kingdom-national-health-service-scotland-for-practitioners": "NHS Scotland (practitioners)",
115
+ "united-kingdom-national-health-service-wales-for-patients": "NHS Wales (patients)",
116
+ "united-kingdom-national-health-service-wales-for-practitioners": "NHS Wales (practitioners)",
117
+ "united-states-web-design-system": "U.S. Web Design System"
118
+ };
119
+ /**
97
120
  * The seven-step text-size scale. Each slug title-cases to exactly the
98
121
  * requested label ("largest" → "Largest", …) via `text-size-picker`'s
99
122
  * own default `labelFor`, so no `sizeLabels` override is needed either.
@@ -183,7 +206,12 @@ function PickerBar(props) {
183
206
  }
184
207
  }, () => {
185
208
  return p.themeProps;
186
- })), _el$4);
209
+ }, { get themeLabels() {
210
+ return {
211
+ ...DEFAULT_THEME_LABELS,
212
+ ...p.themeProps?.themeLabels ?? {}
213
+ };
214
+ } })), _el$4);
187
215
  insert(_el$, createComponent(LocalePicker, mergeProps({
188
216
  get label() {
189
217
  return p.labels.locale;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["<LinkPicker\n label={p.labels.link}\n links={p.links}\n {...p.linkProps}\n />","<div\n class={`picker-bar ${p.class}`.trim()}\n {...restProps}\n >\n {p.links.length > 0 && p.labels.link ? (\n <LinkPicker\n label={p.labels.link}\n links={p.links}\n {...p.linkProps}\n />\n ) : null}\n {p.labels.search ? (\n <SearchPicker\n label={p.labels.search}\n inputLabel={p.labels.searchInput ?? \"\"}\n submitLabel={p.labels.searchSubmit ?? \"\"}\n {...p.searchProps}\n />\n ) : null}\n <ThemePicker\n label={p.labels.theme}\n themesUrl={p.themesUrl}\n themes={p.themes}\n {...p.themeProps}\n />\n <LocalePicker\n label={p.labels.locale}\n locales={p.locales}\n {...p.localeProps}\n />\n {p.labels.timeZone && p.timeZoneProps.locale ? (\n <TimeZonePicker\n {...(p.timeZoneProps as TimeZonePickerProps)}\n label={p.labels.timeZone}\n />\n ) : null}\n <TextSizePicker\n label={p.labels.textSize}\n sizes={p.sizes}\n defaultValue=\"normal\"\n {...p.textSizeProps}\n />\n <SharePicker\n label={p.labels.share}\n targets={p.shareTargets}\n {...p.shareProps}\n />\n </div>","<SearchPicker\n label={p.labels.search}\n inputLabel={p.labels.searchInput ?? \"\"}\n submitLabel={p.labels.searchSubmit ?? \"\"}\n {...p.searchProps}\n />","<ThemePicker\n label={p.labels.theme}\n themesUrl={p.themesUrl}\n themes={p.themes}\n {...p.themeProps}\n />","<LocalePicker\n label={p.labels.locale}\n locales={p.locales}\n {...p.localeProps}\n />","<TimeZonePicker\n {...(p.timeZoneProps as TimeZonePickerProps)}\n label={p.labels.timeZone}\n />","<TextSizePicker\n label={p.labels.textSize}\n sizes={p.sizes}\n defaultValue=\"normal\"\n {...p.textSizeProps}\n />","defaultValue=\"normal\"","<SharePicker\n label={p.labels.share}\n targets={p.shareTargets}\n {...p.shareProps}\n />"],"sources":["../defaults.ts","../PickerBar.tsx"],"sourcesContent":["// withDefaults — Solid's merge(), with the default applying when a prop is undefined, as in the other catalogs.\n//\n// Solid 2's merge(defaults, props) lets an explicit `undefined` win: <Button type={maybeType} /> with maybeType\n// undefined would render no type at all, and a button with no type in a form submits it. React's destructuring\n// defaults, Svelte's and Vue's default props all treat undefined as \"not given\", and so does this. Each default key\n// becomes a getter that reads the prop and falls back to the default; every other prop reads through unchanged, so\n// the result stays reactive and works with omit().\nimport { merge, type Merge } from \"solid-js\";\n\nexport function withDefaults<D extends object, P extends object>(\n defaults: D,\n props: P,\n): Merge<[D, P]> {\n const view = {};\n for (const key of Object.keys(defaults)) {\n Object.defineProperty(view, key, {\n enumerable: true,\n get() {\n const value = (props as Record<string, unknown>)[key];\n return value === undefined ? (defaults as Record<string, unknown>)[key] : value;\n },\n });\n }\n return merge(props, view) as unknown as Merge<[D, P]>;\n}\n","import type { JSX } from \"@solidjs/web\";\nimport { omit } from \"solid-js\";\nimport { withDefaults } from \"./defaults\";\nimport ThemePicker, { type Props as ThemePickerProps } from \"@lilydesignsystem/solid-theme-picker\";\nimport LocalePicker, {\n type Props as LocalePickerProps,\n} from \"@lilydesignsystem/solid-locale-picker\";\nimport TextSizePicker, {\n type Props as TextSizePickerProps,\n} from \"@lilydesignsystem/solid-text-size-picker\";\nimport TimeZonePicker, {\n type Props as TimeZonePickerProps,\n} from \"@lilydesignsystem/solid-time-zone-picker\";\nimport SharePicker, {\n type Props as SharePickerProps,\n type ShareTarget,\n} from \"@lilydesignsystem/solid-share-picker\";\nimport LinkPicker, {\n type Props as LinkPickerProps,\n type LinkItem,\n} from \"@lilydesignsystem/solid-link-picker\";\nimport SearchPicker, {\n type Props as SearchPickerProps,\n} from \"@lilydesignsystem/solid-search-picker\";\n\n/**\n * All 63 Lily reference theme slugs (see `themes/` at the repo root),\n * sorted alphabetically except the United Kingdom and United States\n * government/public-sector themes, which sort last as one alphabetical\n * group of their own. Mirrors `theme-picker`'s own title-casing of each\n * slug, so no `themeLabels` override is needed for these to read well.\n */\nexport const DEFAULT_THEMES: string[] = [\n \"abyss\",\n \"acid\",\n \"adobe-spectrum\",\n \"ant-design\",\n \"aqua\",\n \"atlassian\",\n \"australia-agriculture-design-system\",\n \"autumn\",\n \"black\",\n \"brazil-padrao-digital-de-governo\",\n \"bumblebee\",\n \"business\",\n \"canada-government-of-canada-design-system\",\n \"cappuccino\",\n \"caramellatte\",\n \"cmyk\",\n \"coffee\",\n \"corporate\",\n \"cupcake\",\n \"cyberpunk\",\n \"dark\",\n \"dim\",\n \"dracula\",\n \"emerald\",\n \"european-union-europa-component-library\",\n \"excel\",\n \"fantasy\",\n \"fluent\",\n \"forest\",\n \"garden\",\n \"github-primer\",\n \"halloween\",\n \"ibm-carbon\",\n \"japan-digital-agency-design-system\",\n \"lemonade\",\n \"light\",\n \"linear\",\n \"lofi\",\n \"luxury\",\n \"mozilla-protocol\",\n \"night\",\n \"nord\",\n \"notion\",\n \"pastel\",\n \"retro\",\n \"salesforce\",\n \"sap-fiori\",\n \"silk\",\n \"singapore-government-design-system\",\n \"sunset\",\n \"synthwave\",\n \"valentine\",\n \"vercel\",\n \"winter\",\n \"wireframe\",\n \"united-kingdom-government-digital-service\",\n \"united-kingdom-national-health-service-england-for-patients\",\n \"united-kingdom-national-health-service-england-for-practitioners\",\n \"united-kingdom-national-health-service-scotland-for-patients\",\n \"united-kingdom-national-health-service-scotland-for-practitioners\",\n \"united-kingdom-national-health-service-wales-for-patients\",\n \"united-kingdom-national-health-service-wales-for-practitioners\",\n \"united-states-web-design-system\",\n];\n\n/**\n * The seven-step text-size scale. Each slug title-cases to exactly the\n * requested label (\"largest\" → \"Largest\", …) via `text-size-picker`'s\n * own default `labelFor`, so no `sizeLabels` override is needed either.\n */\nexport const DEFAULT_SIZES: string[] = [\n \"largest\",\n \"larger\",\n \"large\",\n \"normal\",\n \"small\",\n \"smaller\",\n \"smallest\",\n];\n\n/** Accessible names for the five pickers. Required — no English default. */\nexport type PickerBarLabels = {\n /**\n * Accessible name for the link picker's button and list. Needed only when `links` is\n * supplied; the link picker renders only when both are present.\n */\n link?: string;\n /**\n * Accessible name for the search picker's button and search landmark. Optional: omitted or empty, the bar has no search\n * picker (a client-side app whose search would navigate away from its state can leave it out). When given, `searchInput`\n * and `searchSubmit` are needed too.\n */\n search?: string;\n /** Accessible name for the search picker's text field. */\n searchInput?: string;\n /** Accessible name for the search picker's ⏎ submit button. */\n searchSubmit?: string;\n /** Accessible name for the theme picker's button and listbox. */\n theme: string;\n /** Accessible name for the locale picker's button and listbox. */\n locale: string;\n /** Accessible name for the text-size picker's button and listbox. */\n textSize: string;\n /**\n * Accessible name for the time-zone picker's button and listbox. Needed only when\n * `timeZoneProps.locale` is supplied; the time-zone picker renders only when both are present.\n */\n timeZone?: string;\n /** Accessible name for the share picker's button and list. */\n share: string;\n};\n\n/** Public props for PickerBar. See `spec/index.md` §4 for the contract. */\nexport type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, \"children\"> & {\n /** Accessible names for each picker. */\n labels: PickerBarLabels;\n\n /** Page links for the link picker (a home icon), which renders FIRST — leftmost. Omitted or empty: no link picker. */\n links?: LinkItem[];\n /** Extra LinkPicker props (e.g. `navigate`, `onNavigate`), spread after this bar's own. */\n linkProps?: Partial<Omit<LinkPickerProps, \"label\" | \"links\">>;\n\n /** Extra SearchPicker props (e.g. `action`, `navigate`, `placeholder`), spread after this bar's own. */\n searchProps?: Partial<Omit<SearchPickerProps, \"label\" | \"inputLabel\" | \"submitLabel\">>;\n\n /** Base URL of the themes directory, forwarded to ThemePicker. */\n themesUrl: string;\n /** Available theme slugs. Defaults to {@link DEFAULT_THEMES}. */\n themes?: string[];\n /** Extra ThemePicker props, spread after this bar's own. */\n themeProps?: Partial<Omit<ThemePickerProps, \"themesUrl\" | \"themes\">>;\n\n /** Available locale codes. No catalog default exists — supply the set you support. */\n locales: string[];\n /** Extra LocalePicker props, spread after this bar's own. */\n localeProps?: Partial<Omit<LocalePickerProps, \"locales\">>;\n\n /**\n * Extra TimeZonePicker props, spread after this bar's own. `locale` (the language that names and sorts\n * the zones) is required for the time-zone picker to render, which sits after the locale picker.\n */\n timeZoneProps?: Partial<Omit<TimeZonePickerProps, \"label\">>;\n\n /** Available size slugs. Defaults to {@link DEFAULT_SIZES}. */\n sizes?: string[];\n /** Extra TextSizePicker props, spread after this bar's own. */\n textSizeProps?: Partial<Omit<TextSizePickerProps, \"sizes\">>;\n\n /** Destinations offered by the share picker. Empty is valid if `shareProps.copyLabel` is set. */\n shareTargets?: ShareTarget[];\n /** Extra SharePicker props, spread after this bar's own. */\n shareProps?: Partial<Omit<SharePickerProps, \"targets\">>;\n\n /** Extra CSS class on the root. */\n class?: string;\n};\n\nexport function PickerBar(props: Props): JSX.Element {\n const p = withDefaults(\n {\n links: [] as NonNullable<Props[\"links\"]>,\n linkProps: {} as NonNullable<Props[\"linkProps\"]>,\n searchProps: {} as NonNullable<Props[\"searchProps\"]>,\n themes: DEFAULT_THEMES,\n themeProps: {} as NonNullable<Props[\"themeProps\"]>,\n localeProps: {} as NonNullable<Props[\"localeProps\"]>,\n timeZoneProps: {} as NonNullable<Props[\"timeZoneProps\"]>,\n sizes: DEFAULT_SIZES,\n textSizeProps: {} as NonNullable<Props[\"textSizeProps\"]>,\n shareTargets: [] as NonNullable<Props[\"shareTargets\"]>,\n shareProps: {} as NonNullable<Props[\"shareProps\"]>,\n class: \"\" as const,\n },\n props,\n );\n const restProps = omit(\n p,\n \"labels\",\n \"links\",\n \"linkProps\",\n \"searchProps\",\n \"themesUrl\",\n \"themes\",\n \"themeProps\",\n \"locales\",\n \"localeProps\",\n \"timeZoneProps\",\n \"sizes\",\n \"textSizeProps\",\n \"shareTargets\",\n \"shareProps\",\n \"class\",\n );\n return (\n <div\n class={`picker-bar ${p.class}`.trim()}\n {...restProps}\n >\n {p.links.length > 0 && p.labels.link ? (\n <LinkPicker\n label={p.labels.link}\n links={p.links}\n {...p.linkProps}\n />\n ) : null}\n {p.labels.search ? (\n <SearchPicker\n label={p.labels.search}\n inputLabel={p.labels.searchInput ?? \"\"}\n submitLabel={p.labels.searchSubmit ?? \"\"}\n {...p.searchProps}\n />\n ) : null}\n <ThemePicker\n label={p.labels.theme}\n themesUrl={p.themesUrl}\n themes={p.themes}\n {...p.themeProps}\n />\n <LocalePicker\n label={p.labels.locale}\n locales={p.locales}\n {...p.localeProps}\n />\n {p.labels.timeZone && p.timeZoneProps.locale ? (\n <TimeZonePicker\n {...(p.timeZoneProps as TimeZonePickerProps)}\n label={p.labels.timeZone}\n />\n ) : null}\n <TextSizePicker\n label={p.labels.textSize}\n sizes={p.sizes}\n defaultValue=\"normal\"\n {...p.textSizeProps}\n />\n <SharePicker\n label={p.labels.share}\n targets={p.shareTargets}\n {...p.shareProps}\n />\n </div>\n );\n}\n\nexport default PickerBar;\n"],"mappings":";;;;;;;;;;AASA,SAAgB,aACZ,UACA,OACa;CACb,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GAClC,OAAO,eAAe,MAAM,KAAK;EAC7B,YAAY;EACZ,MAAM;GACF,MAAM,QAAS,MAAkC;GACjD,OAAO,UAAU,KAAA,IAAa,SAAqC,OAAO;EAC9E;CACJ,CAAC;CAEL,OAAO,MAAM,OAAO,IAAI;AAC5B;;;;;;;;;;ACQA,IAAa,iBAA2B;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;;;;;AAOA,IAAa,gBAA0B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AA+EA,SAAgB,UAAU,OAA2B;CACjD,MAAM,IAAI,aACN;EACI,OAAO,CAAC;EACR,WAAW,CAAC;EACZ,aAAa,CAAC;EACd,QAAQ;EACR,YAAY,CAAC;EACb,aAAa,CAAC;EACd,eAAe,CAAC;EAChB,OAAO;EACP,eAAe,CAAC;EAChB,cAAc,CAAC;EACf,YAAY,CAAC;EACb,OAAO;CACX,GACA,KACJ;CACA,MAAM,YAAY,KACd,GACA,UACA,SACA,aACA,eACA,aACA,UACA,cACA,WACA,eACA,iBACA,SACA,iBACA,gBACA,cACA,OACJ;CAEI,IAAA,OAAA,OA+CK;CA/CL,IAAA,QAAA,KAAA;;;;;;;CAEI,OAAA,MAAA,CAAA,EADA,IAAA,UAAA;EAAO,OAAA,cAAc,EAAE,QAAQ,KAAK;CAAC,EACxB,GAAT,SAAA,GAAA,IAAA;CAFR,OAAA,aAII;;GAAC,OAAA,CAAA,EAAA,EAAE,MAAM,SAAS,KAAK,EAAE,OAAO;EAMxB,CAAA;EANR,aAAA;GAMQ,OAAA,IAAA,IALJA,gBAAAA,YAAAA,WAAAA;IACI,IAAA,QAAA;KAAO,OAAA,EAAE,OAAO;IAAI;IACpB,IAAA,QAAA;KAAO,OAAA,EAAE;IAAK;GAEjB,SADG;IAAI,OAAA,EAAE;GAAS,CAClB,CAAA,IACD;EAAI;CAAC,EAAA,CAAD,GAVZC,KA+CK;CA/CL,OAAA,aAWI;;GAAC,OAAA,CAAA,CAAA,EAAE,OAAO;EAOF,CAAA;EAPR,aAAA;GAOQ,OAAA,KAAA,IANJC,gBAAAA,cAAAA,WAAAA;IACI,IAAA,QAAA;KAAO,OAAA,EAAE,OAAO;IAAM;IACtB,IAAA,aAAA;KAAY,OAAA,EAAE,OAAO,eAAe;IAAE;IACtC,IAAA,cAAA;KAAa,OAAA,EAAE,OAAO,gBAAgB;IAAE;GAE3C,SADG;IAAI,OAAA,EAAE;GAAW,CACpB,CAAA,IACD;EAAI;CAAC,EAAA,CAAD,GAlBZD,KA+CK;CA/CL,OAAA,MAmBIE,gBAAAA,aAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAK;EACrB,IAAA,YAAA;GAAW,OAAA,EAAE;EAAS;EACtB,IAAA,SAAA;GAAQ,OAAA,EAAE;EAAM;CAEnB,SADG;EAAI,OAAA,EAAE;CAAU,CACnB,CAAA,GAxBLF,KA+CK;CA/CL,OAAA,MAyBIG,gBAAAA,cAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAM;EACtB,IAAA,UAAA;GAAS,OAAA,EAAE;EAAO;CAErB,SADG;EAAI,OAAA,EAAE;CAAW,CACpB,CAAA,GA7BLH,KA+CK;CA/CL,OAAA,aA8BI;;GAAC,OAAA,CAAA,EAAA,EAAE,OAAO,YAAY,EAAE,cAAc;EAK9B,CAAA;EALR,aAAA;GAKQ,OAAA,KAAA,IAJJI,gBAAAA,gBAAAA,iBACI;IAAK,OAAA,EAAE;GAAqC,GADhD,EAEI,IAAA,QAAA;IAAO,OAAA,EAAE,OAAO;GAAQ,EAC3B,CAAA,CAAA,IACD;EAAI;CAAC,EAAA,CAAD,GAnCZJ,KA+CK;CA/CL,OAAA,MAoCIK,gBAAAA,gBAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAQ;EACxB,IAAA,QAAA;GAAO,OAAA,EAAE;EAAK;EACdC,cAAa;CAEhB,SADG;EAAI,OAAA,EAAE;CAAa,CACtB,CAAA,GAzCLN,KA+CK;CA/CL,OAAA,MA0CIO,gBAAAA,aAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAK;EACrB,IAAA,UAAA;GAAS,OAAA,EAAE;EAAY;CAE1B,SADG;EAAI,OAAA,EAAE;CAAU,CACnB,CAAA,GA9CLP,KA+CK;CAhDT,OACIA;AAiDR"}
1
+ {"version":3,"file":"index.js","names":["<LinkPicker\n label={p.labels.link}\n links={p.links}\n {...p.linkProps}\n />","<div\n class={`picker-bar ${p.class}`.trim()}\n {...restProps}\n >\n {p.links.length > 0 && p.labels.link ? (\n <LinkPicker\n label={p.labels.link}\n links={p.links}\n {...p.linkProps}\n />\n ) : null}\n {p.labels.search ? (\n <SearchPicker\n label={p.labels.search}\n inputLabel={p.labels.searchInput ?? \"\"}\n submitLabel={p.labels.searchSubmit ?? \"\"}\n {...p.searchProps}\n />\n ) : null}\n <ThemePicker\n label={p.labels.theme}\n themesUrl={p.themesUrl}\n themes={p.themes}\n {...p.themeProps}\n themeLabels={{ ...DEFAULT_THEME_LABELS, ...(p.themeProps?.themeLabels ?? {}) }}\n />\n <LocalePicker\n label={p.labels.locale}\n locales={p.locales}\n {...p.localeProps}\n />\n {p.labels.timeZone && p.timeZoneProps.locale ? (\n <TimeZonePicker\n {...(p.timeZoneProps as TimeZonePickerProps)}\n label={p.labels.timeZone}\n />\n ) : null}\n <TextSizePicker\n label={p.labels.textSize}\n sizes={p.sizes}\n defaultValue=\"normal\"\n {...p.textSizeProps}\n />\n <SharePicker\n label={p.labels.share}\n targets={p.shareTargets}\n {...p.shareProps}\n />\n </div>","<SearchPicker\n label={p.labels.search}\n inputLabel={p.labels.searchInput ?? \"\"}\n submitLabel={p.labels.searchSubmit ?? \"\"}\n {...p.searchProps}\n />","<ThemePicker\n label={p.labels.theme}\n themesUrl={p.themesUrl}\n themes={p.themes}\n {...p.themeProps}\n themeLabels={{ ...DEFAULT_THEME_LABELS, ...(p.themeProps?.themeLabels ?? {}) }}\n />","<LocalePicker\n label={p.labels.locale}\n locales={p.locales}\n {...p.localeProps}\n />","<TimeZonePicker\n {...(p.timeZoneProps as TimeZonePickerProps)}\n label={p.labels.timeZone}\n />","<TextSizePicker\n label={p.labels.textSize}\n sizes={p.sizes}\n defaultValue=\"normal\"\n {...p.textSizeProps}\n />","defaultValue=\"normal\"","<SharePicker\n label={p.labels.share}\n targets={p.shareTargets}\n {...p.shareProps}\n />"],"sources":["../defaults.ts","../PickerBar.tsx"],"sourcesContent":["// withDefaults — Solid's merge(), with the default applying when a prop is undefined, as in the other catalogs.\n//\n// Solid 2's merge(defaults, props) lets an explicit `undefined` win: <Button type={maybeType} /> with maybeType\n// undefined would render no type at all, and a button with no type in a form submits it. React's destructuring\n// defaults, Svelte's and Vue's default props all treat undefined as \"not given\", and so does this. Each default key\n// becomes a getter that reads the prop and falls back to the default; every other prop reads through unchanged, so\n// the result stays reactive and works with omit().\nimport { merge, type Merge } from \"solid-js\";\n\nexport function withDefaults<D extends object, P extends object>(\n defaults: D,\n props: P,\n): Merge<[D, P]> {\n const view = {};\n for (const key of Object.keys(defaults)) {\n Object.defineProperty(view, key, {\n enumerable: true,\n get() {\n const value = (props as Record<string, unknown>)[key];\n return value === undefined ? (defaults as Record<string, unknown>)[key] : value;\n },\n });\n }\n return merge(props, view) as unknown as Merge<[D, P]>;\n}\n","import type { JSX } from \"@solidjs/web\";\nimport { omit } from \"solid-js\";\nimport { withDefaults } from \"./defaults\";\nimport ThemePicker, { type Props as ThemePickerProps } from \"@lilydesignsystem/solid-theme-picker\";\nimport LocalePicker, {\n type Props as LocalePickerProps,\n} from \"@lilydesignsystem/solid-locale-picker\";\nimport TextSizePicker, {\n type Props as TextSizePickerProps,\n} from \"@lilydesignsystem/solid-text-size-picker\";\nimport TimeZonePicker, {\n type Props as TimeZonePickerProps,\n} from \"@lilydesignsystem/solid-time-zone-picker\";\nimport SharePicker, {\n type Props as SharePickerProps,\n type ShareTarget,\n} from \"@lilydesignsystem/solid-share-picker\";\nimport LinkPicker, {\n type Props as LinkPickerProps,\n type LinkItem,\n} from \"@lilydesignsystem/solid-link-picker\";\nimport SearchPicker, {\n type Props as SearchPickerProps,\n} from \"@lilydesignsystem/solid-search-picker\";\n\n/**\n * All 63 Lily reference theme slugs (see `themes/` at the repo root): the 36\n * generic themes alphabetically, then the 27 themes that follow a company's\n * or a public body's design system, alphabetically by their label\n * (`DEFAULT_THEME_LABELS`, else the title-cased slug), so \"NHS England\n * (patients)\" sorts under N.\n */\nexport const DEFAULT_THEMES: string[] = [\n \"abyss\",\n \"acid\",\n \"aqua\",\n \"autumn\",\n \"black\",\n \"bumblebee\",\n \"business\",\n \"cappuccino\",\n \"caramellatte\",\n \"cmyk\",\n \"coffee\",\n \"corporate\",\n \"cupcake\",\n \"cyberpunk\",\n \"dark\",\n \"dim\",\n \"dracula\",\n \"emerald\",\n \"fantasy\",\n \"forest\",\n \"garden\",\n \"halloween\",\n \"lemonade\",\n \"light\",\n \"lofi\",\n \"luxury\",\n \"night\",\n \"nord\",\n \"pastel\",\n \"retro\",\n \"silk\",\n \"sunset\",\n \"synthwave\",\n \"valentine\",\n \"winter\",\n \"wireframe\",\n \"adobe-spectrum\",\n \"ant-design\",\n \"atlassian\",\n \"australia-agriculture-design-system\",\n \"brazil-padrao-digital-de-governo\",\n \"canada-government-of-canada-design-system\",\n \"european-union-europa-component-library\",\n \"excel\",\n \"fluent\",\n \"github-primer\",\n \"united-kingdom-government-digital-service\",\n \"ibm-carbon\",\n \"japan-digital-agency-design-system\",\n \"linear\",\n \"mozilla-protocol\",\n \"united-kingdom-national-health-service-england-for-patients\",\n \"united-kingdom-national-health-service-england-for-practitioners\",\n \"united-kingdom-national-health-service-scotland-for-patients\",\n \"united-kingdom-national-health-service-scotland-for-practitioners\",\n \"united-kingdom-national-health-service-wales-for-patients\",\n \"united-kingdom-national-health-service-wales-for-practitioners\",\n \"notion\",\n \"salesforce\",\n \"sap-fiori\",\n \"singapore-government-design-system\",\n \"united-states-web-design-system\",\n \"vercel\",\n];\n\n/**\n * Labels for the default themes whose title-cased slug reads wrongly: an\n * abbreviation (\"IBM Carbon\", not \"Ibm Carbon\"), an accent or a small word,\n * or a public body's own short name (\"NHS England (patients)\"). They are\n * proper names, not prose to translate. A consumer's own theme labels win\n * over each one.\n */\nexport const DEFAULT_THEME_LABELS: Record<string, string> = {\n cmyk: \"CMYK\",\n \"brazil-padrao-digital-de-governo\": \"Brazil Padrão Digital de Governo\",\n \"canada-government-of-canada-design-system\": \"Canada Government of Canada Design System\",\n \"github-primer\": \"GitHub Primer\",\n \"ibm-carbon\": \"IBM Carbon\",\n \"sap-fiori\": \"SAP Fiori\",\n \"united-kingdom-government-digital-service\": \"GOV.UK Design System\",\n \"united-kingdom-national-health-service-england-for-patients\": \"NHS England (patients)\",\n \"united-kingdom-national-health-service-england-for-practitioners\":\n \"NHS England (practitioners)\",\n \"united-kingdom-national-health-service-scotland-for-patients\": \"NHS Scotland (patients)\",\n \"united-kingdom-national-health-service-scotland-for-practitioners\":\n \"NHS Scotland (practitioners)\",\n \"united-kingdom-national-health-service-wales-for-patients\": \"NHS Wales (patients)\",\n \"united-kingdom-national-health-service-wales-for-practitioners\": \"NHS Wales (practitioners)\",\n \"united-states-web-design-system\": \"U.S. Web Design System\",\n};\n\n/**\n * The seven-step text-size scale. Each slug title-cases to exactly the\n * requested label (\"largest\" → \"Largest\", …) via `text-size-picker`'s\n * own default `labelFor`, so no `sizeLabels` override is needed either.\n */\nexport const DEFAULT_SIZES: string[] = [\n \"largest\",\n \"larger\",\n \"large\",\n \"normal\",\n \"small\",\n \"smaller\",\n \"smallest\",\n];\n\n/** Accessible names for the five pickers. Required — no English default. */\nexport type PickerBarLabels = {\n /**\n * Accessible name for the link picker's button and list. Needed only when `links` is\n * supplied; the link picker renders only when both are present.\n */\n link?: string;\n /**\n * Accessible name for the search picker's button and search landmark. Optional: omitted or empty, the bar has no search\n * picker (a client-side app whose search would navigate away from its state can leave it out). When given, `searchInput`\n * and `searchSubmit` are needed too.\n */\n search?: string;\n /** Accessible name for the search picker's text field. */\n searchInput?: string;\n /** Accessible name for the search picker's ⏎ submit button. */\n searchSubmit?: string;\n /** Accessible name for the theme picker's button and listbox. */\n theme: string;\n /** Accessible name for the locale picker's button and listbox. */\n locale: string;\n /** Accessible name for the text-size picker's button and listbox. */\n textSize: string;\n /**\n * Accessible name for the time-zone picker's button and listbox. Needed only when\n * `timeZoneProps.locale` is supplied; the time-zone picker renders only when both are present.\n */\n timeZone?: string;\n /** Accessible name for the share picker's button and list. */\n share: string;\n};\n\n/** Public props for PickerBar. See `spec/index.md` §4 for the contract. */\nexport type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, \"children\"> & {\n /** Accessible names for each picker. */\n labels: PickerBarLabels;\n\n /** Page links for the link picker (a home icon), which renders FIRST — leftmost. Omitted or empty: no link picker. */\n links?: LinkItem[];\n /** Extra LinkPicker props (e.g. `navigate`, `onNavigate`), spread after this bar's own. */\n linkProps?: Partial<Omit<LinkPickerProps, \"label\" | \"links\">>;\n\n /** Extra SearchPicker props (e.g. `action`, `navigate`, `placeholder`), spread after this bar's own. */\n searchProps?: Partial<Omit<SearchPickerProps, \"label\" | \"inputLabel\" | \"submitLabel\">>;\n\n /** Base URL of the themes directory, forwarded to ThemePicker. */\n themesUrl: string;\n /** Available theme slugs. Defaults to {@link DEFAULT_THEMES}. */\n themes?: string[];\n /** Extra ThemePicker props, spread after this bar's own. */\n themeProps?: Partial<Omit<ThemePickerProps, \"themesUrl\" | \"themes\">>;\n\n /** Available locale codes. No catalog default exists — supply the set you support. */\n locales: string[];\n /** Extra LocalePicker props, spread after this bar's own. */\n localeProps?: Partial<Omit<LocalePickerProps, \"locales\">>;\n\n /**\n * Extra TimeZonePicker props, spread after this bar's own. `locale` (the language that names and sorts\n * the zones) is required for the time-zone picker to render, which sits after the locale picker.\n */\n timeZoneProps?: Partial<Omit<TimeZonePickerProps, \"label\">>;\n\n /** Available size slugs. Defaults to {@link DEFAULT_SIZES}. */\n sizes?: string[];\n /** Extra TextSizePicker props, spread after this bar's own. */\n textSizeProps?: Partial<Omit<TextSizePickerProps, \"sizes\">>;\n\n /** Destinations offered by the share picker. Empty is valid if `shareProps.copyLabel` is set. */\n shareTargets?: ShareTarget[];\n /** Extra SharePicker props, spread after this bar's own. */\n shareProps?: Partial<Omit<SharePickerProps, \"targets\">>;\n\n /** Extra CSS class on the root. */\n class?: string;\n};\n\nexport function PickerBar(props: Props): JSX.Element {\n const p = withDefaults(\n {\n links: [] as NonNullable<Props[\"links\"]>,\n linkProps: {} as NonNullable<Props[\"linkProps\"]>,\n searchProps: {} as NonNullable<Props[\"searchProps\"]>,\n themes: DEFAULT_THEMES,\n themeProps: {} as NonNullable<Props[\"themeProps\"]>,\n localeProps: {} as NonNullable<Props[\"localeProps\"]>,\n timeZoneProps: {} as NonNullable<Props[\"timeZoneProps\"]>,\n sizes: DEFAULT_SIZES,\n textSizeProps: {} as NonNullable<Props[\"textSizeProps\"]>,\n shareTargets: [] as NonNullable<Props[\"shareTargets\"]>,\n shareProps: {} as NonNullable<Props[\"shareProps\"]>,\n class: \"\" as const,\n },\n props,\n );\n const restProps = omit(\n p,\n \"labels\",\n \"links\",\n \"linkProps\",\n \"searchProps\",\n \"themesUrl\",\n \"themes\",\n \"themeProps\",\n \"locales\",\n \"localeProps\",\n \"timeZoneProps\",\n \"sizes\",\n \"textSizeProps\",\n \"shareTargets\",\n \"shareProps\",\n \"class\",\n );\n return (\n <div\n class={`picker-bar ${p.class}`.trim()}\n {...restProps}\n >\n {p.links.length > 0 && p.labels.link ? (\n <LinkPicker\n label={p.labels.link}\n links={p.links}\n {...p.linkProps}\n />\n ) : null}\n {p.labels.search ? (\n <SearchPicker\n label={p.labels.search}\n inputLabel={p.labels.searchInput ?? \"\"}\n submitLabel={p.labels.searchSubmit ?? \"\"}\n {...p.searchProps}\n />\n ) : null}\n <ThemePicker\n label={p.labels.theme}\n themesUrl={p.themesUrl}\n themes={p.themes}\n {...p.themeProps}\n themeLabels={{ ...DEFAULT_THEME_LABELS, ...(p.themeProps?.themeLabels ?? {}) }}\n />\n <LocalePicker\n label={p.labels.locale}\n locales={p.locales}\n {...p.localeProps}\n />\n {p.labels.timeZone && p.timeZoneProps.locale ? (\n <TimeZonePicker\n {...(p.timeZoneProps as TimeZonePickerProps)}\n label={p.labels.timeZone}\n />\n ) : null}\n <TextSizePicker\n label={p.labels.textSize}\n sizes={p.sizes}\n defaultValue=\"normal\"\n {...p.textSizeProps}\n />\n <SharePicker\n label={p.labels.share}\n targets={p.shareTargets}\n {...p.shareProps}\n />\n </div>\n );\n}\n\nexport default PickerBar;\n"],"mappings":";;;;;;;;;;AASA,SAAgB,aACZ,UACA,OACa;CACb,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GAClC,OAAO,eAAe,MAAM,KAAK;EAC7B,YAAY;EACZ,MAAM;GACF,MAAM,QAAS,MAAkC;GACjD,OAAO,UAAU,KAAA,IAAa,SAAqC,OAAO;EAC9E;CACJ,CAAC;CAEL,OAAO,MAAM,OAAO,IAAI;AAC5B;;;;;;;;;;ACQA,IAAa,iBAA2B;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;;;;;;;AASA,IAAa,uBAA+C;CACxD,MAAM;CACN,oCAAoC;CACpC,6CAA6C;CAC7C,iBAAiB;CACjB,cAAc;CACd,aAAa;CACb,6CAA6C;CAC7C,+DAA+D;CAC/D,oEACI;CACJ,gEAAgE;CAChE,qEACI;CACJ,6DAA6D;CAC7D,kEAAkE;CAClE,mCAAmC;AACvC;;;;;;AAOA,IAAa,gBAA0B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AA+EA,SAAgB,UAAU,OAA2B;CACjD,MAAM,IAAI,aACN;EACI,OAAO,CAAC;EACR,WAAW,CAAC;EACZ,aAAa,CAAC;EACd,QAAQ;EACR,YAAY,CAAC;EACb,aAAa,CAAC;EACd,eAAe,CAAC;EAChB,OAAO;EACP,eAAe,CAAC;EAChB,cAAc,CAAC;EACf,YAAY,CAAC;EACb,OAAO;CACX,GACA,KACJ;CACA,MAAM,YAAY,KACd,GACA,UACA,SACA,aACA,eACA,aACA,UACA,cACA,WACA,eACA,iBACA,SACA,iBACA,gBACA,cACA,OACJ;CAEI,IAAA,OAAA,OAgDK;CAhDL,IAAA,QAAA,KAAA;;;;;;;CAEI,OAAA,MAAA,CAAA,EADA,IAAA,UAAA;EAAO,OAAA,cAAc,EAAE,QAAQ,KAAK;CAAC,EACxB,GAAT,SAAA,GAAA,IAAA;CAFR,OAAA,aAII;;GAAC,OAAA,CAAA,EAAA,EAAE,MAAM,SAAS,KAAK,EAAE,OAAO;EAMxB,CAAA;EANR,aAAA;GAMQ,OAAA,IAAA,IALJA,gBAAAA,YAAAA,WAAAA;IACI,IAAA,QAAA;KAAO,OAAA,EAAE,OAAO;IAAI;IACpB,IAAA,QAAA;KAAO,OAAA,EAAE;IAAK;GAEjB,SADG;IAAI,OAAA,EAAE;GAAS,CAClB,CAAA,IACD;EAAI;CAAC,EAAA,CAAD,GAVZC,KAgDK;CAhDL,OAAA,aAWI;;GAAC,OAAA,CAAA,CAAA,EAAE,OAAO;EAOF,CAAA;EAPR,aAAA;GAOQ,OAAA,KAAA,IANJC,gBAAAA,cAAAA,WAAAA;IACI,IAAA,QAAA;KAAO,OAAA,EAAE,OAAO;IAAM;IACtB,IAAA,aAAA;KAAY,OAAA,EAAE,OAAO,eAAe;IAAE;IACtC,IAAA,cAAA;KAAa,OAAA,EAAE,OAAO,gBAAgB;IAAE;GAE3C,SADG;IAAI,OAAA,EAAE;GAAW,CACpB,CAAA,IACD;EAAI;CAAC,EAAA,CAAD,GAlBZD,KAgDK;CAhDL,OAAA,MAmBIE,gBAAAA,aAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAK;EACrB,IAAA,YAAA;GAAW,OAAA,EAAE;EAAS;EACtB,IAAA,SAAA;GAAQ,OAAA,EAAE;EAAM;CAGnB,SAFG;EAAI,OAAA,EAAE;CAAU,GAJpB,EAKI,IAAA,cAAA;EAAa,OAAA;GAAE,GAAG;GAAsB,GAAI,EAAE,YAAY,eAAe,CAAC;EAAG;CAAC,EACjF,CAAA,CAAA,GAzBLF,KAgDK;CAhDL,OAAA,MA0BIG,gBAAAA,cAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAM;EACtB,IAAA,UAAA;GAAS,OAAA,EAAE;EAAO;CAErB,SADG;EAAI,OAAA,EAAE;CAAW,CACpB,CAAA,GA9BLH,KAgDK;CAhDL,OAAA,aA+BI;;GAAC,OAAA,CAAA,EAAA,EAAE,OAAO,YAAY,EAAE,cAAc;EAK9B,CAAA;EALR,aAAA;GAKQ,OAAA,KAAA,IAJJI,gBAAAA,gBAAAA,iBACI;IAAK,OAAA,EAAE;GAAqC,GADhD,EAEI,IAAA,QAAA;IAAO,OAAA,EAAE,OAAO;GAAQ,EAC3B,CAAA,CAAA,IACD;EAAI;CAAC,EAAA,CAAD,GApCZJ,KAgDK;CAhDL,OAAA,MAqCIK,gBAAAA,gBAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAQ;EACxB,IAAA,QAAA;GAAO,OAAA,EAAE;EAAK;EACdC,cAAa;CAEhB,SADG;EAAI,OAAA,EAAE;CAAa,CACtB,CAAA,GA1CLN,KAgDK;CAhDL,OAAA,MA2CIO,gBAAAA,aAAAA,WAAAA;EACI,IAAA,QAAA;GAAO,OAAA,EAAE,OAAO;EAAK;EACrB,IAAA,UAAA;GAAS,OAAA,EAAE;EAAY;CAE1B,SADG;EAAI,OAAA,EAAE;CAAU,CACnB,CAAA,GA/CLP,KAgDK;CAjDT,OACIA;AAkDR"}
@@ -7,13 +7,21 @@ import { type Props as SharePickerProps, type ShareTarget } from "@lilydesignsys
7
7
  import { type Props as LinkPickerProps, type LinkItem } from "@lilydesignsystem/solid-link-picker";
8
8
  import { type Props as SearchPickerProps } from "@lilydesignsystem/solid-search-picker";
9
9
  /**
10
- * All 63 Lily reference theme slugs (see `themes/` at the repo root),
11
- * sorted alphabetically except the United Kingdom and United States
12
- * government/public-sector themes, which sort last as one alphabetical
13
- * group of their own. Mirrors `theme-picker`'s own title-casing of each
14
- * slug, so no `themeLabels` override is needed for these to read well.
10
+ * All 63 Lily reference theme slugs (see `themes/` at the repo root): the 36
11
+ * generic themes alphabetically, then the 27 themes that follow a company's
12
+ * or a public body's design system, alphabetically by their label
13
+ * (`DEFAULT_THEME_LABELS`, else the title-cased slug), so "NHS England
14
+ * (patients)" sorts under N.
15
15
  */
16
16
  export declare const DEFAULT_THEMES: string[];
17
+ /**
18
+ * Labels for the default themes whose title-cased slug reads wrongly: an
19
+ * abbreviation ("IBM Carbon", not "Ibm Carbon"), an accent or a small word,
20
+ * or a public body's own short name ("NHS England (patients)"). They are
21
+ * proper names, not prose to translate. A consumer's own theme labels win
22
+ * over each one.
23
+ */
24
+ export declare const DEFAULT_THEME_LABELS: Record<string, string>;
17
25
  /**
18
26
  * The seven-step text-size scale. Each slug title-cases to exactly the
19
27
  * requested label ("largest" → "Largest", …) via `text-size-picker`'s
@@ -8,26 +8,20 @@ import SharePicker from "@lilydesignsystem/solid-share-picker";
8
8
  import LinkPicker from "@lilydesignsystem/solid-link-picker";
9
9
  import SearchPicker from "@lilydesignsystem/solid-search-picker";
10
10
  /**
11
- * All 63 Lily reference theme slugs (see `themes/` at the repo root),
12
- * sorted alphabetically except the United Kingdom and United States
13
- * government/public-sector themes, which sort last as one alphabetical
14
- * group of their own. Mirrors `theme-picker`'s own title-casing of each
15
- * slug, so no `themeLabels` override is needed for these to read well.
11
+ * All 63 Lily reference theme slugs (see `themes/` at the repo root): the 36
12
+ * generic themes alphabetically, then the 27 themes that follow a company's
13
+ * or a public body's design system, alphabetically by their label
14
+ * (`DEFAULT_THEME_LABELS`, else the title-cased slug), so "NHS England
15
+ * (patients)" sorts under N.
16
16
  */
17
17
  export const DEFAULT_THEMES = [
18
18
  "abyss",
19
19
  "acid",
20
- "adobe-spectrum",
21
- "ant-design",
22
20
  "aqua",
23
- "atlassian",
24
- "australia-agriculture-design-system",
25
21
  "autumn",
26
22
  "black",
27
- "brazil-padrao-digital-de-governo",
28
23
  "bumblebee",
29
24
  "business",
30
- "canada-government-of-canada-design-system",
31
25
  "cappuccino",
32
26
  "caramellatte",
33
27
  "cmyk",
@@ -39,46 +33,75 @@ export const DEFAULT_THEMES = [
39
33
  "dim",
40
34
  "dracula",
41
35
  "emerald",
42
- "european-union-europa-component-library",
43
- "excel",
44
36
  "fantasy",
45
- "fluent",
46
37
  "forest",
47
38
  "garden",
48
- "github-primer",
49
39
  "halloween",
50
- "ibm-carbon",
51
- "japan-digital-agency-design-system",
52
40
  "lemonade",
53
41
  "light",
54
- "linear",
55
42
  "lofi",
56
43
  "luxury",
57
- "mozilla-protocol",
58
44
  "night",
59
45
  "nord",
60
- "notion",
61
46
  "pastel",
62
47
  "retro",
63
- "salesforce",
64
- "sap-fiori",
65
48
  "silk",
66
- "singapore-government-design-system",
67
49
  "sunset",
68
50
  "synthwave",
69
51
  "valentine",
70
- "vercel",
71
52
  "winter",
72
53
  "wireframe",
54
+ "adobe-spectrum",
55
+ "ant-design",
56
+ "atlassian",
57
+ "australia-agriculture-design-system",
58
+ "brazil-padrao-digital-de-governo",
59
+ "canada-government-of-canada-design-system",
60
+ "european-union-europa-component-library",
61
+ "excel",
62
+ "fluent",
63
+ "github-primer",
73
64
  "united-kingdom-government-digital-service",
65
+ "ibm-carbon",
66
+ "japan-digital-agency-design-system",
67
+ "linear",
68
+ "mozilla-protocol",
74
69
  "united-kingdom-national-health-service-england-for-patients",
75
70
  "united-kingdom-national-health-service-england-for-practitioners",
76
71
  "united-kingdom-national-health-service-scotland-for-patients",
77
72
  "united-kingdom-national-health-service-scotland-for-practitioners",
78
73
  "united-kingdom-national-health-service-wales-for-patients",
79
74
  "united-kingdom-national-health-service-wales-for-practitioners",
75
+ "notion",
76
+ "salesforce",
77
+ "sap-fiori",
78
+ "singapore-government-design-system",
80
79
  "united-states-web-design-system",
80
+ "vercel",
81
81
  ];
82
+ /**
83
+ * Labels for the default themes whose title-cased slug reads wrongly: an
84
+ * abbreviation ("IBM Carbon", not "Ibm Carbon"), an accent or a small word,
85
+ * or a public body's own short name ("NHS England (patients)"). They are
86
+ * proper names, not prose to translate. A consumer's own theme labels win
87
+ * over each one.
88
+ */
89
+ export const DEFAULT_THEME_LABELS = {
90
+ cmyk: "CMYK",
91
+ "brazil-padrao-digital-de-governo": "Brazil Padrão Digital de Governo",
92
+ "canada-government-of-canada-design-system": "Canada Government of Canada Design System",
93
+ "github-primer": "GitHub Primer",
94
+ "ibm-carbon": "IBM Carbon",
95
+ "sap-fiori": "SAP Fiori",
96
+ "united-kingdom-government-digital-service": "GOV.UK Design System",
97
+ "united-kingdom-national-health-service-england-for-patients": "NHS England (patients)",
98
+ "united-kingdom-national-health-service-england-for-practitioners": "NHS England (practitioners)",
99
+ "united-kingdom-national-health-service-scotland-for-patients": "NHS Scotland (patients)",
100
+ "united-kingdom-national-health-service-scotland-for-practitioners": "NHS Scotland (practitioners)",
101
+ "united-kingdom-national-health-service-wales-for-patients": "NHS Wales (patients)",
102
+ "united-kingdom-national-health-service-wales-for-practitioners": "NHS Wales (practitioners)",
103
+ "united-states-web-design-system": "U.S. Web Design System",
104
+ };
82
105
  /**
83
106
  * The seven-step text-size scale. Each slug title-cases to exactly the
84
107
  * requested label ("largest" → "Largest", …) via `text-size-picker`'s
@@ -112,7 +135,7 @@ export function PickerBar(props) {
112
135
  return (<div class={`picker-bar ${p.class}`.trim()} {...restProps}>
113
136
  {p.links.length > 0 && p.labels.link ? (<LinkPicker label={p.labels.link} links={p.links} {...p.linkProps}/>) : null}
114
137
  {p.labels.search ? (<SearchPicker label={p.labels.search} inputLabel={p.labels.searchInput ?? ""} submitLabel={p.labels.searchSubmit ?? ""} {...p.searchProps}/>) : null}
115
- <ThemePicker label={p.labels.theme} themesUrl={p.themesUrl} themes={p.themes} {...p.themeProps}/>
138
+ <ThemePicker label={p.labels.theme} themesUrl={p.themesUrl} themes={p.themes} {...p.themeProps} themeLabels={{ ...DEFAULT_THEME_LABELS, ...(p.themeProps?.themeLabels ?? {}) }}/>
116
139
  <LocalePicker label={p.labels.locale} locales={p.locales} {...p.localeProps}/>
117
140
  {p.labels.timeZone && p.timeZoneProps.locale ? (<TimeZonePicker {...p.timeZoneProps} label={p.labels.timeZone}/>) : null}
118
141
  <TextSizePicker label={p.labels.textSize} sizes={p.sizes} defaultValue="normal" {...p.textSizeProps}/>
package/index.md CHANGED
@@ -61,9 +61,12 @@ if you add `shareProps={{ copyLabel: "Copy link" }}`.
61
61
  ## Defaults
62
62
 
63
63
  - **`themes`** defaults to `DEFAULT_THEMES` — all 63 Lily reference
64
- theme slugs, alphabetical, with the 8 United Kingdom / United States
65
- government themes moved to their own alphabetical group at the
66
- bottom. Pass your own `themes` array to override.
64
+ theme slugs: the 36 generic themes alphabetically, then the 27 company
65
+ and public-sector themes alphabetically by label.
66
+ `DEFAULT_THEME_LABELS` gives the names title-casing gets wrong ("IBM
67
+ Carbon", "GitHub Primer", "NHS England (patients)"); your own
68
+ `themeProps.themeLabels` win. Pass your own `themes` array to
69
+ override.
67
70
  - **`sizes`** defaults to `DEFAULT_SIZES` — the seven-step scale
68
71
  `largest`, `larger`, `large`, `normal`, `small`, `smaller`,
69
72
  `smallest` — and the text-size picker starts on `normal`. Pass your
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lilydesignsystem/solid-picker-bar",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "engines": {
5
5
  "node": ">=26"
6
6
  },