@wirecore/wirelayer-native 0.3.1 → 0.5.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/dist/components/Alert/Alert.d.ts +3 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +9 -5
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Confirm/ConfirmDialog.d.ts +6 -1
- package/dist/components/Confirm/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/Confirm/ConfirmDialog.js +5 -5
- package/dist/components/Confirm/ConfirmDialog.js.map +1 -1
- package/dist/components/Confirm/confirm.d.ts +7 -0
- package/dist/components/Confirm/confirm.d.ts.map +1 -1
- package/dist/components/Confirm/confirm.js.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +6 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +14 -4
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +3 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +5 -3
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/Progress/Progress.d.ts +12 -1
- package/dist/components/Progress/Progress.d.ts.map +1 -1
- package/dist/components/Progress/Progress.js +11 -8
- package/dist/components/Progress/Progress.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +11 -8
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +9 -8
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/Slider/Slider.d.ts +3 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/Slider.js +3 -3
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +3 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +2 -1
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/TextField.d.ts +3 -1
- package/dist/utils/TextField.d.ts.map +1 -1
- package/dist/utils/TextField.js +2 -1
- package/dist/utils/TextField.js.map +1 -1
- package/llms-full.txt +190 -13
- package/llms.txt +4 -0
- package/package.json +3 -3
package/llms-full.txt
CHANGED
|
@@ -101,6 +101,7 @@ Message box with status icon and colour, title and text; announced when it appea
|
|
|
101
101
|
| dismissLabel? | `string` | Accessible name of the close button |
|
|
102
102
|
| onDismiss? | `() => void` | |
|
|
103
103
|
| duration? | `number` | Calls `onDismiss` after this many milliseconds |
|
|
104
|
+
| actions? | `ReactNode` | Buttons in the message, e.g. "Unlock" or "Reconnect" – below the text |
|
|
104
105
|
| children? | `ReactNode` | |
|
|
105
106
|
|
|
106
107
|
### AppShell (React Native)
|
|
@@ -657,9 +658,9 @@ Checkbox with label (also indeterminate): the whole row is the control; Space to
|
|
|
657
658
|
|
|
658
659
|
| Prop | Type | Description |
|
|
659
660
|
| --- | --- | --- |
|
|
660
|
-
| checked? | `
|
|
661
|
-
| defaultChecked? | `
|
|
662
|
-
| onCheckedChange? | `(checked:
|
|
661
|
+
| checked? | `C` | |
|
|
662
|
+
| defaultChecked? | `C` | |
|
|
663
|
+
| onCheckedChange? | `(checked: C) => void` | |
|
|
663
664
|
| invalid? | `boolean` | |
|
|
664
665
|
| value? | `string` | Value inside a CheckboxGroup – the group holds the state |
|
|
665
666
|
| className? | `string` | |
|
|
@@ -946,6 +947,8 @@ Place once at the root of the app; then `await confirm({ title })` and `await pr
|
|
|
946
947
|
| Prop | Type | Description |
|
|
947
948
|
| --- | --- | --- |
|
|
948
949
|
| closeLabel? | `string` | Accessible name of the close button |
|
|
950
|
+
| confirmButton? | `ConfirmButtonOptions` | Look of the confirm button in every request (default: size sm, `primary`, `danger` for status danger) |
|
|
951
|
+
| cancelButton? | `ConfirmButtonOptions` | Look of the cancel button in every request (default: size sm, `outline`) |
|
|
949
952
|
|
|
950
953
|
### Container (React Native)
|
|
951
954
|
|
|
@@ -1246,6 +1249,7 @@ Modal dialog on React Native's Modal: the system keeps focus inside, the Android
|
|
|
1246
1249
|
| description? | `string` | |
|
|
1247
1250
|
| icon? | `IconComponent` | Icon component in the coloured box at the top |
|
|
1248
1251
|
| status? | `DialogStatus` | |
|
|
1252
|
+
| titlePosition? | `'body' \| 'header'` | `body` (default): the title below the header row; `header`: in the row of the close button, after a smaller icon, the header separated by a line (as on the Drawer) |
|
|
1249
1253
|
| size? | `OverlaySize` | Width: sm 320, md 400 (default), lg 560, xl 800, full the width of the screen |
|
|
1250
1254
|
| position? | `'center' \| 'top' \| 'bottom'` | Centred (default), near the top or docked to the bottom edge |
|
|
1251
1255
|
| fullscreen? | `boolean` | Covers the whole screen (e.g. a form on a phone) |
|
|
@@ -1780,6 +1784,7 @@ Icon-only button with a required accessible name, colours and an optional counte
|
|
|
1780
1784
|
| color? | `ButtonColor` | Colour combined with the variant, like Button `color` (e.g. a danger text button) |
|
|
1781
1785
|
| size? | `Size` | |
|
|
1782
1786
|
| shape? | `ButtonShape` | Corner shape: `pill` (round, default), `rounded` or `square` |
|
|
1787
|
+
| loading? | `boolean` | Shows a spinner instead of the icon and ignores presses; stays focusable (aria-disabled + aria-busy) |
|
|
1783
1788
|
| badge? | `number \| boolean` | Counter (number > 0) or dot (true) in the top-right corner |
|
|
1784
1789
|
| badgeLabel? | `(count: string \| null) => string` | Appended to the accessible name while a badge is shown, e.g. "Notifications, 4 new" |
|
|
1785
1790
|
| className? | `string` | |
|
|
@@ -1850,6 +1855,7 @@ Text field: size, prefix/suffix, leading icon, clear button, spinner and success
|
|
|
1850
1855
|
| leadingIcon? | `IconComponent` | Icon component rendered inside the field, before the text |
|
|
1851
1856
|
| prefix? | `string` | Static text segment before the input, e.g. `https://` |
|
|
1852
1857
|
| suffix? | `string` | Static text segment after the input, e.g. `.de` |
|
|
1858
|
+
| mono? | `boolean` | Monospace font of the theme (JetBrains Mono) – for paths, tokens, codes, URLs and keys |
|
|
1853
1859
|
| ref? | `Ref<ComponentRef<typeof TextInput>>` | |
|
|
1854
1860
|
| clearable? | `boolean` | Shows a button that empties the field while it has a value (calls onChangeText with "") |
|
|
1855
1861
|
|
|
@@ -2088,6 +2094,7 @@ Text input with a fixed format (IBAN, phone, postcode …): separators are added
|
|
|
2088
2094
|
| leadingIcon? | `IconComponent` | Icon component rendered inside the field, before the text |
|
|
2089
2095
|
| prefix? | `string` | Static text segment before the input, e.g. `https://` |
|
|
2090
2096
|
| suffix? | `string` | Static text segment after the input, e.g. `.de` |
|
|
2097
|
+
| mono? | `boolean` | Monospace font of the theme (JetBrains Mono) – for paths, tokens, codes, URLs and keys |
|
|
2091
2098
|
| ref? | `Ref<ComponentRef<typeof TextInput>>` | |
|
|
2092
2099
|
| mask | `string` | 9 digit, a letter, * letter or digit – everything else is inserted by itself, \\ escapes a token, `?` starts an optional rest |
|
|
2093
2100
|
| value? | `string` | Masked value (or the raw one with `unmask`) |
|
|
@@ -2528,6 +2535,7 @@ Password field with a button that shows/hides the password ("Show/Hide password"
|
|
|
2528
2535
|
| loading? | `boolean` | Shows a spinner in the field and marks it busy (aria-busy), e.g. while checking the value |
|
|
2529
2536
|
| clearable? | `boolean` | Shows a button that empties the field while it has a value |
|
|
2530
2537
|
| clearLabel? | `string` | Accessible name of the clear button (default "Clear input") |
|
|
2538
|
+
| mono? | `boolean` | Monospace font of the theme (JetBrains Mono) – for paths, tokens, codes, URLs and keys |
|
|
2531
2539
|
| ref? | `Ref<ComponentRef<typeof TextInput>>` | |
|
|
2532
2540
|
| visible? | `boolean` | Whether the password is shown in plain text (controlled, with onVisibleChange) |
|
|
2533
2541
|
| defaultVisible? | `boolean` | Initially show the password in plain text |
|
|
@@ -2732,6 +2740,10 @@ Progress bar (role progressbar) named by its label, with the value as text – a
|
|
|
2732
2740
|
| striped? | `boolean` | Diagonal stripes |
|
|
2733
2741
|
| animated? | `boolean` | Moving stripes – only when motion is allowed |
|
|
2734
2742
|
| orientation? | `'horizontal' \| 'vertical'` | `vertical`: the bar fills from the bottom |
|
|
2743
|
+
| size? | `'xs' \| 'md'` | `xs`: a thin bar with small text, e.g. in a list or a status bar |
|
|
2744
|
+
| status? | `'info' \| 'success' \| 'warn' \| 'danger'` | Colour of the filled part by its state, e.g. `danger` for a failed transfer |
|
|
2745
|
+
| hideLabel? | `boolean` | The label only for screen readers – it still names the progress bar |
|
|
2746
|
+
| barText? | `string` | Short text in the bar, e.g. "42 %", "waiting" or "failed" (a taller bar; horizontal, without segments or steps) – screen readers get it after the value |
|
|
2735
2747
|
|
|
2736
2748
|
### ProgressCircle (React Native)
|
|
2737
2749
|
|
|
@@ -2843,9 +2855,9 @@ One choice out of several (role radiogroup) named by its label; RadioGroupItem o
|
|
|
2843
2855
|
|
|
2844
2856
|
| Prop | Type | Description |
|
|
2845
2857
|
| --- | --- | --- |
|
|
2846
|
-
| value? | `
|
|
2847
|
-
| defaultValue? | `
|
|
2848
|
-
| onValueChange? | `(value:
|
|
2858
|
+
| value? | `V \| null` | Selected value; numbers when the items have number values |
|
|
2859
|
+
| defaultValue? | `V \| null` | |
|
|
2860
|
+
| onValueChange? | `(value: V \| null) => void` | |
|
|
2849
2861
|
| label? | `string` | Visible label, also the group's accessible name |
|
|
2850
2862
|
| orientation? | `RadioGroupOrientation` | |
|
|
2851
2863
|
| columns? | `number` | Cards in a grid with this many columns – for RadioCard |
|
|
@@ -2864,7 +2876,7 @@ One option of a RadioGroup: a radio button with its label (Space chooses on the
|
|
|
2864
2876
|
|
|
2865
2877
|
| Prop | Type | Description |
|
|
2866
2878
|
| --- | --- | --- |
|
|
2867
|
-
| value | `string` |
|
|
2879
|
+
| value | `string \| number` | Value of the option – a number makes the group's value a number |
|
|
2868
2880
|
| disabled? | `boolean` | |
|
|
2869
2881
|
| className? | `string` | |
|
|
2870
2882
|
| children? | `ReactNode` | |
|
|
@@ -3061,10 +3073,10 @@ A few exclusive options side by side – a radio group
|
|
|
3061
3073
|
|
|
3062
3074
|
| Prop | Type | Description |
|
|
3063
3075
|
| --- | --- | --- |
|
|
3064
|
-
| items | `SegmentedControlItem[]` | |
|
|
3065
|
-
| value? | `
|
|
3066
|
-
| defaultValue? | `
|
|
3067
|
-
| onValueChange? | `(value:
|
|
3076
|
+
| items | `SegmentedControlItem<V>[]` | |
|
|
3077
|
+
| value? | `V` | |
|
|
3078
|
+
| defaultValue? | `V` | |
|
|
3079
|
+
| onValueChange? | `(value: V) => void` | |
|
|
3068
3080
|
| label | `string` | Name of the group, e.g. "View" |
|
|
3069
3081
|
| size? | `'sm' \| 'md'` | |
|
|
3070
3082
|
| block? | `boolean` | Full width: the segments share it |
|
|
@@ -3230,6 +3242,7 @@ Drag along the track or use the screen reader's adjust gestures (role slider, in
|
|
|
3230
3242
|
| step? | `number` | |
|
|
3231
3243
|
| label | `string` | Visible label, also the accessible name |
|
|
3232
3244
|
| showValue? | `boolean` | Value next to the label |
|
|
3245
|
+
| hideLabel? | `boolean` | The label is not shown – the thumbs keep it as their accessible name |
|
|
3233
3246
|
| formatValue? | `(value: number) => string` | |
|
|
3234
3247
|
| thumbLabels? | `[string, string]` | Names of the two thumbs of a range – default "Minimum" / "Maximum" |
|
|
3235
3248
|
| orientation? | `'horizontal' \| 'vertical'` | Vertical slider: give it a height via className (at least 160 pt) |
|
|
@@ -3591,6 +3604,7 @@ Multi-line text field: sizes, auto height between minRows and maxRows, counter w
|
|
|
3591
3604
|
| loading? | `boolean` | Shows a spinner in the corner and marks the field busy (aria-busy) |
|
|
3592
3605
|
| clearable? | `boolean` | Shows a button that empties the field while it has text (calls onChangeText with "") |
|
|
3593
3606
|
| clearLabel? | `string` | Accessible name of the clear button (default "Clear input") |
|
|
3607
|
+
| mono? | `boolean` | Monospace font of the theme (JetBrains Mono) – for keys, codes and logs |
|
|
3594
3608
|
| ref? | `Ref<ComponentRef<typeof TextInput>>` | |
|
|
3595
3609
|
|
|
3596
3610
|
### TimeGrid (React Native)
|
|
@@ -4124,6 +4138,29 @@ that render components, such as `confirm` or the DataTable feature `dateInput`,
|
|
|
4124
4138
|
components warn in the console when the classes of a recipe they render are missing. Recipes you call yourself
|
|
4125
4139
|
(`card()`) are not checked – add their files along with the import.
|
|
4126
4140
|
|
|
4141
|
+
**With Vite** (Vue, React, Nuxt, Astro) the plugin `@wirecore/wirelayer-recipes/vite` adds these files itself: it reads
|
|
4142
|
+
the imports from `@wirecore/wirelayer-*` in your source files and adds the files of the imported components and recipes
|
|
4143
|
+
to the CSS file that imports `theme.css` (or `styles-core.css`). Put it before Tailwind's plugin:
|
|
4144
|
+
|
|
4145
|
+
```ts
|
|
4146
|
+
// vite.config.ts (Nuxt: vite.plugins in nuxt.config.ts, Astro: vite.plugins in astro.config.mjs)
|
|
4147
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
4148
|
+
import { wirelayer } from '@wirecore/wirelayer-recipes/vite';
|
|
4149
|
+
|
|
4150
|
+
export default { plugins: [wirelayer(), tailwindcss()] };
|
|
4151
|
+
```
|
|
4152
|
+
|
|
4153
|
+
```css
|
|
4154
|
+
@import 'tailwindcss';
|
|
4155
|
+
@import '@wirecore/wirelayer-vue/theme.css'; /* the plugin adds the sources files here */
|
|
4156
|
+
@import '@wirecore/wirelayer-vue/fonts.css'; /* the WireLayer fonts – leave it out with a font of your own */
|
|
4157
|
+
```
|
|
4158
|
+
|
|
4159
|
+
`theme.css` is the theme without fonts and without component classes: an app with its own font
|
|
4160
|
+
(`@theme { --font-sans: … }`) does not bundle Schibsted Grotesk and JetBrains Mono. Components the plugin cannot see –
|
|
4161
|
+
registered globally (`app.component(…)`) or imported automatically – trigger the warning above; import their files by
|
|
4162
|
+
hand. Next.js does not use Vite: there, list the files or use `styles.css`.
|
|
4163
|
+
|
|
4127
4164
|
### Usage
|
|
4128
4165
|
|
|
4129
4166
|
```vue
|
|
@@ -4156,9 +4193,13 @@ import { ArrowRight } from 'lucide-react';
|
|
|
4156
4193
|
// nuxt.config.ts
|
|
4157
4194
|
import tailwindcss from '@tailwindcss/vite';
|
|
4158
4195
|
|
|
4196
|
+
import { wirelayer } from '@wirecore/wirelayer-recipes/vite';
|
|
4197
|
+
|
|
4159
4198
|
export default defineNuxtConfig({
|
|
4160
|
-
|
|
4161
|
-
|
|
4199
|
+
// main.css: @import 'tailwindcss'; @import '@wirecore/wirelayer-vue/theme.css';
|
|
4200
|
+
// @import '@wirecore/wirelayer-vue/fonts.css'; – or styles.css with all classes, without the plugin
|
|
4201
|
+
css: ['~/assets/main.css'],
|
|
4202
|
+
vite: { plugins: [wirelayer(), tailwindcss()] },
|
|
4162
4203
|
});
|
|
4163
4204
|
```
|
|
4164
4205
|
|
|
@@ -4241,6 +4282,31 @@ Every component consists of named parts of its recipe (`base`, `icon`, `row`, `t
|
|
|
4241
4282
|
The names are the exports of the recipes (`button`, `iconButton`, `dataTable` …) and are checked by TypeScript, as are
|
|
4242
4283
|
the variants and parts. Your own components use the same through `useRecipe('button', button)`.
|
|
4243
4284
|
|
|
4285
|
+
`variants` adds classes for single values of a variant, `compoundVariants` for combinations – instead of selectors on
|
|
4286
|
+
the recipe's own classes, which break when they change:
|
|
4287
|
+
|
|
4288
|
+
```ts
|
|
4289
|
+
const recipes: RecipeConfig = {
|
|
4290
|
+
// only the medium size: 42px high, 16px text
|
|
4291
|
+
button: {
|
|
4292
|
+
variants: { size: { md: { base: 'h-[2.625rem] text-base' } } },
|
|
4293
|
+
compoundVariants: [{ size: ['sm', 'md'], shape: 'rounded', classes: { base: 'rounded-md' } }],
|
|
4294
|
+
},
|
|
4295
|
+
input: { variants: { size: { md: { base: 'h-[2.625rem]' } }, invalid: { true: { base: 'border-2' } } } },
|
|
4296
|
+
};
|
|
4297
|
+
```
|
|
4298
|
+
|
|
4299
|
+
Per part the classes come in this order: `classes`, the matching `variants` and `compoundVariants`, the states of the
|
|
4300
|
+
recipe, the overrides of states (`invalid: { true: … }`), and last the class passed to the component. Inner providers
|
|
4301
|
+
extend outer ones (classes of the same value are joined, the inner ones win).
|
|
4302
|
+
|
|
4303
|
+
Classes from a provider or `classes` change the look, not the states: the classes of an active state variant
|
|
4304
|
+
(`invalid`, `success`, `disabled`, `readOnly`, `current`, `selected`, `checked`, `loading`) are added after them, so a
|
|
4305
|
+
field with `classes: { base: 'border-line-2' }` still turns red when it is invalid. States that the components mark as
|
|
4306
|
+
attributes (`data-invalid:`, `data-disabled:`, `data-[state=checked]:`) win through their selector anyway. Only the
|
|
4307
|
+
class passed to the component itself (`class`/`className`) comes after the states – the way out when a single field
|
|
4308
|
+
should look different in every state.
|
|
4309
|
+
|
|
4244
4310
|
### Hooks and composables
|
|
4245
4311
|
|
|
4246
4312
|
Around 40 hooks (React) and composables (Vue) with the same names and the same logic – for your own components and
|
|
@@ -4619,6 +4685,73 @@ WireLayer is licensed under the MIT license. The fonts shipped with `@wirecore/w
|
|
|
4619
4685
|
JetBrains Mono) are licensed under the SIL Open Font License 1.1 (`dist/fonts/OFL.txt`). Optional peer dependencies such
|
|
4620
4686
|
as `pdfjs-dist` (Apache-2.0), Chart.js, Tiptap and Shiki are installed by the app itself – with their own licenses.
|
|
4621
4687
|
|
|
4688
|
+
### Components and APIs side by side
|
|
4689
|
+
|
|
4690
|
+
| PrimeVue | WireLayer |
|
|
4691
|
+
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
4692
|
+
| `<Button label icon="pi pi-x">` | the label as slot text, `:leading-icon` with a Lucide component (`@lucide/vue`) |
|
|
4693
|
+
| `severity` / `text` / `outlined` | `color` – or `variant="text"` / `variant="outline"` |
|
|
4694
|
+
| Icon button + `v-tooltip` | `<Tooltip content><IconButton :icon label /></Tooltip>` – `label` is the accessible name (often the tooltip text) |
|
|
4695
|
+
| `Button :loading` | `loading` on `Button` and `IconButton` (stays focusable, ignores clicks) |
|
|
4696
|
+
| `Card` with `#title`/`#content` | `Card` with the default slot and an own heading |
|
|
4697
|
+
| `InputText`, `Password`, `InputNumber`, `InputChips`, `SelectButton`, `RadioButton` | `Input`, `PasswordInput`, `NumberInput`, `TagsInput`, `SegmentedControl`, `RadioGroup` + `RadioGroupItem` |
|
|
4698
|
+
| `IconField` + `InputIcon` | `Input :leading-icon` |
|
|
4699
|
+
| `Select :options optionLabel optionValue` | `Select :items item-label item-value` (object values: `value-key`) |
|
|
4700
|
+
| `Message severity` | `Alert status` (`error` → `danger`) |
|
|
4701
|
+
| `Tag` | `Badge` |
|
|
4702
|
+
| `Dialog v-model:visible header` | `Dialog v-model:open` + `DialogContent title size` (`hide-title` keeps the title for screen readers only) |
|
|
4703
|
+
| `Toolbar` as a container | a plain `div` – WireLayer's `Toolbar` is `role="toolbar"` (one tab stop, arrow keys) |
|
|
4704
|
+
| `useToast().add({ severity, summary, detail, life })` | `toast({ type, title, description, duration })`, `<Toaster />` once in the app |
|
|
4705
|
+
| `useConfirm().require({ … })` | `await confirm({ title, description, … })`, `<ConfirmDialog />` once in the app |
|
|
4706
|
+
| `DataTable` + `Column` | `DataTable :columns` (column objects), `#cell-<id>`, `#expansion`, `v-model:page-size` |
|
|
4707
|
+
| `expandedRows` with a row toggler on some rows | `#expansion` + `row-expandable` |
|
|
4708
|
+
| `paginatorTemplate` (first/last page) | `paginator-edges`, `paginator-align` |
|
|
4709
|
+
| `showGridlines` (with the outer border) | `gridlines` + `bordered` |
|
|
4710
|
+
| `FilterMatchMode`, `filters` | `v-model:global-filter`, column `filter`/`filterOptions`, `filter-display="row"` |
|
|
4711
|
+
| `@primevue/forms` + `zodResolver` | TanStack Form with Zod directly as a Standard Schema, `FormField` + `bindInput`/`bindValue` |
|
|
4712
|
+
| `pt` (pass-through) | `classes` per part, `RecipesProvider` for all components below it |
|
|
4713
|
+
| Theme preset (`definePreset`) | `--wc-*` tokens, `defineTheme`, the component variables (_Foundations › Themes_) |
|
|
4714
|
+
| `darkModeSelector` (a class) | `data-mode` on `<html>` |
|
|
4715
|
+
| `tailwindcss-primeui` (`bg-surface-*`, `text-muted-color`) | semantic tokens: `bg-card`, `bg-bg-2`, `text-muted`, `border-line` … |
|
|
4716
|
+
|
|
4717
|
+
### Pitfalls
|
|
4718
|
+
|
|
4719
|
+
- **An empty choice is `null`, not `''`.** For PrimeVue's Select `''` means "nothing chosen"; WireLayer's Select treats
|
|
4720
|
+
`''` as a value (it warns in development that it is not among the items). Use `null`.
|
|
4721
|
+
- **TanStack fields start with `''`.** A required text in Zod therefore needs `.min(1)` – `z.string()` alone accepts
|
|
4722
|
+
the empty field.
|
|
4723
|
+
- **Fonts:** set your own with `@theme { --font-sans: … }`. Import `theme.css` instead of `styles.css` (with the
|
|
4724
|
+
sources files, or the Vite plugin `@wirecore/wirelayer-recipes/vite`) so the WireLayer fonts are not bundled
|
|
4725
|
+
(_Getting started › Welcome › Smaller CSS_).
|
|
4726
|
+
- **Card spacing:** `Card` puts a `gap` between its direct children – wrap content that should sit tight in one
|
|
4727
|
+
element.
|
|
4728
|
+
- **Overrides go per part and per variant.** `classes: { base: 'rounded-md' }` reaches every size; only the medium size
|
|
4729
|
+
with `variants: { size: { md: { base: '…' } } }` – no selectors on the recipe's own classes. States such as `invalid`
|
|
4730
|
+
stay visible over such classes; only `class` on the component itself replaces them.
|
|
4731
|
+
- **Sizes and corners in one place:** the height, text and corners of buttons and fields per size, the corners of
|
|
4732
|
+
rounded buttons, the padding of cards and the backdrop of dialogs are CSS variables (`--wc-control-h-md` …).
|
|
4733
|
+
- **Labels:** wrap a control in `Field` (it links label, description and error). A native `<label for>` works with the
|
|
4734
|
+
control's own `id`; date fields, sliders and groups need `Field` or `aria-label`.
|
|
4735
|
+
- **Brand colours:** `checkTheme` lists the pairs below WCAG AA, `suggestThemeFixes` the nearest colours (and `on-*`
|
|
4736
|
+
colours) that meet them – an orange `primary` with white text, common in PrimeVue themes, does not.
|
|
4737
|
+
|
|
4738
|
+
### Desktop apps (dense UI, many dialogs)
|
|
4739
|
+
|
|
4740
|
+
- **Focus from code:** the text fields expose `focus()`, `select()`, `setSelectionRange()` and the native input
|
|
4741
|
+
(`element`) through a template ref – no `$el.querySelector('input')`. In a dialog, mark the first field with
|
|
4742
|
+
`data-autofocus`: a `focus()` in `onMounted` is overridden by the dialog's focus trap.
|
|
4743
|
+
- **Window shortcuts in dialogs:** Enter/Escape listeners on `window` also get the keys of an open list. `Select` and
|
|
4744
|
+
`Combobox` take `stop-key-propagation` and report `v-model:open`; `ContextMenu` reports `v-model:open` and the
|
|
4745
|
+
right-clicked element (`@before-open`).
|
|
4746
|
+
- **Menus at a point:** `close-on-scroll`, `close-on-resize`, `close-on-blur`, and `highlight-first` so Enter takes the
|
|
4747
|
+
first item.
|
|
4748
|
+
- **Closable tabs** are built in: `TabsTrigger closable @close` – the close button is not nested in the tab, Delete
|
|
4749
|
+
closes the focused tab and the focus moves to its neighbour.
|
|
4750
|
+
- **Typed values:** `RadioGroup`, `SegmentedControl` and `NativeSelect` keep the type of the bound value (unions,
|
|
4751
|
+
numbers); `Checkbox` with a boolean model gives booleans.
|
|
4752
|
+
- **Compact parts:** `Progress size="xs"` with `hide-label`, `bar-text` and `status`; `Alert #actions`; `mono` on text
|
|
4753
|
+
fields; `DialogContent title-position="header"` puts the title next to the close button.
|
|
4754
|
+
|
|
4622
4755
|
### Custom theme
|
|
4623
4756
|
|
|
4624
4757
|
A theme overrides any colors per mode. `themeToCss` generates the CSS for it,
|
|
@@ -4644,3 +4777,47 @@ writeFileSync('brand.css', themeToCss(brand));
|
|
|
4644
4777
|
```
|
|
4645
4778
|
|
|
4646
4779
|
All bundled themes pass this check in both modes.
|
|
4780
|
+
|
|
4781
|
+
When a pair misses its contrast, `suggestThemeFixes` says how to fix it: per pair the nearest variant of a colour that
|
|
4782
|
+
meets it – its lightness moved in OKLCH, the hue kept – and, where text sits on the colour, a light or dark `on-*`
|
|
4783
|
+
colour. A suggestion never breaks a pair that passed:
|
|
4784
|
+
|
|
4785
|
+
```ts
|
|
4786
|
+
import { suggestThemeFixes } from '@wirecore/wirelayer-tokens';
|
|
4787
|
+
|
|
4788
|
+
suggestThemeFixes(brand);
|
|
4789
|
+
// [{ name: 'primary: text-on-primary on bg-primary', mode: 'light', ratio: 2.6, min: 4.5,
|
|
4790
|
+
// color: { token: 'primary', value: '#a35c00', ratio: 4.5 },
|
|
4791
|
+
// on: { token: 'on-primary', value: '#050505', ratio: 8.1 } }, …]
|
|
4792
|
+
```
|
|
4793
|
+
|
|
4794
|
+
### Component sizes and shapes
|
|
4795
|
+
|
|
4796
|
+
Besides the colors, a few measures that a brand usually changes are CSS variables. Without them every component looks as
|
|
4797
|
+
before – their defaults are the values of the recipes. Set them on `:root` (all pages), on a `[data-theme]` or on any
|
|
4798
|
+
element (that part of the page):
|
|
4799
|
+
|
|
4800
|
+
```css
|
|
4801
|
+
:root {
|
|
4802
|
+
--wc-control-h-md: 2.625rem; /* buttons and fields of the medium size: 42px */
|
|
4803
|
+
--wc-control-text-md: 1rem;
|
|
4804
|
+
--wc-control-radius-md: 0.375rem;
|
|
4805
|
+
--wc-button-radius: 0.375rem;
|
|
4806
|
+
--wc-card-p: 1.25rem;
|
|
4807
|
+
--wc-backdrop: rgb(0 0 0 / 0.4);
|
|
4808
|
+
}
|
|
4809
|
+
```
|
|
4810
|
+
|
|
4811
|
+
| Variable | Default | Applies to |
|
|
4812
|
+
| ----------------------------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
4813
|
+
| `--wc-control-h-sm` / `-md` / `-lg` | `2rem` / `2.5rem` / `3rem` | Height of the sizes sm, md, lg: Button, IconButton, Input, NativeSelect, Select, MultiSelect, Combobox, NumberInput, PasswordInput, the date and time fields, ColorPicker, TagsInput (minimum) |
|
|
4814
|
+
| `--wc-control-radius-sm` / `-md` / `-lg` | `6px` / `8px` / `10px` | Corners of the fields above and of Textarea (not of buttons) |
|
|
4815
|
+
| `--wc-control-text-sm` / `-md` / `-lg` | `13px` / `15px` / `16px` | Text in the fields above and in Textarea |
|
|
4816
|
+
| `--wc-button-radius` | `8px` | Corners of Button and IconButton with `shape="rounded"` (`pill` and `square` stay) |
|
|
4817
|
+
| `--wc-card-p` | `1.5rem` | Padding of Card |
|
|
4818
|
+
| `--wc-backdrop` | `rgb(0 0 0 / 0.6)` | Dimming behind Dialog, Drawer and ConfirmDialog |
|
|
4819
|
+
| `--radius-card` / `--radius-panel` / `--radius-popup` | `20px` / `28px` / `12px` | Corners of cards, panels and popups (menus, lists, popovers) |
|
|
4820
|
+
| `--wc-dialog-w` | by `size` | Width of a DialogContent |
|
|
4821
|
+
|
|
4822
|
+
The rest – the padding of a dialog or of table cells, the size of a single variant – is set per part with `classes` or
|
|
4823
|
+
`RecipesProvider` (_Getting started › Welcome › Customizing_). The React Native components keep their fixed sizes.
|
package/llms.txt
CHANGED
|
@@ -233,4 +233,8 @@ Full API (props, events, slots, examples) in llms-full.txt next to this file. MC
|
|
|
233
233
|
- React Native (Expo)
|
|
234
234
|
- HTML and server templates
|
|
235
235
|
- License
|
|
236
|
+
- Components and APIs side by side
|
|
237
|
+
- Pitfalls
|
|
238
|
+
- Desktop apps (dense UI, many dialogs)
|
|
236
239
|
- Custom theme
|
|
240
|
+
- Component sizes and shapes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecore/wirelayer-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "WireLayer components for React Native (Expo) with Uniwind",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"dependencies": {
|
|
119
119
|
"@expo-google-fonts/jetbrains-mono": "^0.4.1",
|
|
120
120
|
"@expo-google-fonts/schibsted-grotesk": "^0.4.2",
|
|
121
|
-
"@wirecore/wirelayer-recipes": "^0.
|
|
122
|
-
"@wirecore/wirelayer-tokens": "^0.
|
|
121
|
+
"@wirecore/wirelayer-recipes": "^0.7.0",
|
|
122
|
+
"@wirecore/wirelayer-tokens": "^0.4.0",
|
|
123
123
|
"uqr": "^0.1.3"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|