@wpic/ui 0.4.0 → 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/CHANGELOG.md +11 -0
- package/COMPONENTS.md +46 -1
- package/dist/components/WDatePicker.vue.d.ts +3 -1
- package/dist/components/WDateRangePicker.vue.d.ts +4 -0
- package/dist/components/WMonthPicker.vue.d.ts +1 -1
- package/dist/components/WPageHeader.vue.d.ts +23 -0
- package/dist/components/WThemeProvider.vue.d.ts +21 -0
- package/dist/components/WToggle.vue.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/theme/index.d.ts +40 -0
- package/dist/wpic-ui.cjs +62 -62
- package/dist/wpic-ui.css +84 -1
- package/dist/wpic-ui.js +3462 -3261
- package/package.json +1 -1
- package/src/style.css +82 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 — 2026-09-08
|
|
4
|
+
|
|
5
|
+
- Add opt-in `WThemeProvider`, UI5 light/dark tokens, typed color overrides, `themeVariables`, and chart palettes. Existing consumers keep their default appearance.
|
|
6
|
+
- Add `WPageHeader` with actions, metadata and unframed filters.
|
|
7
|
+
- Apply the validated controls, monochrome primary/neutral secondary buttons, subtle cards and white-thumb switches inside the provider.
|
|
8
|
+
- Carry themes into all shared popovers, including calendars, date ranges and editable tags. Add nested Escape handling and safe outside-listener cleanup.
|
|
9
|
+
- Make date clear actions keyboard accessible; preserve date bounds, emitted values and legacy props. Fix local date serialization in date-range calendars.
|
|
10
|
+
- Ensure packaged CSS always includes the public token declarations, even when compiled utilities already reference their names.
|
|
11
|
+
- Add packaged-browser regression coverage for light/dark scopes, customization, nested panels, switches, dates and backwards-compatible semantic components.
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
## 0.4.0 — 2026-09-08
|
|
4
15
|
|
|
5
16
|
### Banners, tags and badges
|
package/COMPONENTS.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# COMPONENTS.md — wpic-ui component reference
|
|
2
|
-
Use this as reference when writing Vue components. Updated for 0.
|
|
2
|
+
Use this as reference when writing Vue components. Updated for 0.5.0.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Theme provider and customization (0.5)
|
|
6
|
+
|
|
7
|
+
The UI5 preset is **opt-in**. Existing consumers without `WThemeProvider` keep their current styling and existing component props/events. Import the packaged stylesheet; no host Tailwind scanning is required.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import { WThemeProvider, WButton, type WThemeOverrides } from '@wpic/ui'
|
|
12
|
+
import '@wpic/ui/style.css'
|
|
13
|
+
const colors: WThemeOverrides = {
|
|
14
|
+
light: { accent: '#85C531', primary: '#171717', onPrimary: '#FFFFFF' },
|
|
15
|
+
dark: { surface: '#151515', popover: '#1F201D', raised: '#2A2A28', primary: '#FFFFFF', onPrimary: '#171717' },
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
<template>
|
|
19
|
+
<WThemeProvider mode="auto" :colors="colors">
|
|
20
|
+
<WButton>Save</WButton>
|
|
21
|
+
</WThemeProvider>
|
|
22
|
+
</template>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`mode` accepts `auto` (inherits a parent provider or the document `.dark` class), `light`, or `dark`. `preset` currently accepts `ui5`. `colors` is a partial map per mode; unspecified entries use the preset. A nested provider can preview another theme without changing the document or saved application preference.
|
|
26
|
+
|
|
27
|
+
Color keys (`WThemeColors`): `canvas`, `surface`, `input`, `raised`, `popover`, `border`, `borderHover`, `text`, `muted`, `dim`, `accent`, `onAccent`, `primary`, `primaryHover`, `onPrimary`, `secondary`, `secondaryHover`, `onSecondary`, `secondaryShadow`, `switchOn`, `switchOff`, `switchDisabled`, `switchThumb`, `focusRing`, `positive`, `negative`. Secondary and switch backgrounds accept CSS gradients. `focusRing` defaults to the accent at 18% opacity. Change both foreground and background when customizing contrast.
|
|
28
|
+
|
|
29
|
+
The provider supplies prefixed CSS variables and the existing surface/text aliases. `--wpic-primary` remains an accent alias for legacy components; monochrome action buttons use `--wpic-button-primary`. `themeVariables(mode, overrides)` exposes the same mapping for document-level integration. Use the provider's **colors prop** for scoped overrides that must follow teleports. Direct DOM CSS overrides are not copied to teleported panels.
|
|
30
|
+
|
|
31
|
+
`WPopover`, date calendars, ranges, month pickers, selects and editable-tag option panels receive the provider context directly. Panels inherit the selected palette even outside the provider's DOM subtree. Nested popovers keep their parent open when selecting a child option; Escape closes the innermost visible panel and returns focus to its anchor.
|
|
32
|
+
|
|
33
|
+
UI5 uses 36px default controls (explicit small/large sizes and plain selects retain their sizing), standard button radii, subtle card contours, uniform input fills, and a 1px accent focus border plus a 3px translucent ring. Disabled and validation states remain distinct. `WTable` structure and behavior are unchanged.
|
|
34
|
+
|
|
35
|
+
### WPageHeader
|
|
36
|
+
|
|
37
|
+
Props: `title: string`, `description?: string`, `headingLevel?: 1 | 2` (default 1). Slots: `actions`, `metadata`, `filters`. Titles wrap, actions can move to the next line, filters have no border or internal padding. The consumer supplies outer page spacing. Existing application headers can forward their slots through this component.
|
|
38
|
+
|
|
39
|
+
### Chart palettes
|
|
40
|
+
|
|
41
|
+
`chartPalettes.light` and `.dark` contain six stable series colors: blue, teal, violet, amber, rose, slate. WPIC green is reserved for UI accents. Choose by theme and keep series-to-color assignments stable; retain labels/legends when displaying multiple series. Consumers can supply their own palette arrays.
|
|
42
|
+
|
|
43
|
+
### Date and switch additions
|
|
44
|
+
|
|
45
|
+
- `WDatePicker`: a selected, clearable date shows one trailing clear button instead of a chevron. `clearLabel` localizes its accessible name (default `Clear date`). Clear emits the existing empty-string model/change values and closes the panel. Date bounds and output format remain unchanged.
|
|
46
|
+
- `WDateRangePicker`: retains `DateRange | null`, presets and custom ranges; adds `disabled`, `ariaLabel`, and `clearLabel` (default `Clear date range`). Clear emits `null`. Calendar dates use local year/month/day, avoiding UTC day shifts in positive time zones.
|
|
47
|
+
- `WToggle`: retains boolean v-model, default label slot and `disabled`; adds `ariaLabel`. The actual button has `role="switch"` and `aria-checked`. The UI5 disabled track is dark in dark mode, with a white thumb.
|
|
3
48
|
|
|
4
49
|
## Banners, tags and badges: usage
|
|
5
50
|
|
|
@@ -11,6 +11,7 @@ type __VLS_Props = {
|
|
|
11
11
|
ariaLabel?: string;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
clearable?: boolean;
|
|
14
|
+
clearLabel?: string;
|
|
14
15
|
};
|
|
15
16
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
17
|
"update:modelValue": (value: string) => any;
|
|
@@ -24,8 +25,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
24
25
|
modelValue: string | null;
|
|
25
26
|
placeholder: string;
|
|
26
27
|
clearable: boolean;
|
|
28
|
+
clearLabel: string;
|
|
29
|
+
ariaLabel: string;
|
|
27
30
|
locale: string;
|
|
28
31
|
weekStartsOn: 0 | 1;
|
|
29
|
-
ariaLabel: string;
|
|
30
32
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
33
|
export default _default;
|
|
@@ -13,6 +13,9 @@ type __VLS_Props = {
|
|
|
13
13
|
presets?: Preset[];
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
clearable?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
ariaLabel?: string;
|
|
18
|
+
clearLabel?: string;
|
|
16
19
|
size?: 'sm' | 'md' | 'lg';
|
|
17
20
|
};
|
|
18
21
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
@@ -22,6 +25,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
22
25
|
}>, {
|
|
23
26
|
placeholder: string;
|
|
24
27
|
clearable: boolean;
|
|
28
|
+
clearLabel: string;
|
|
25
29
|
presets: Preset[];
|
|
26
30
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
31
|
export default _default;
|
|
@@ -17,7 +17,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
17
17
|
disabled: boolean;
|
|
18
18
|
modelValue: string | null;
|
|
19
19
|
placeholder: string;
|
|
20
|
-
locale: string;
|
|
21
20
|
ariaLabel: string;
|
|
21
|
+
locale: string;
|
|
22
22
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
headingLevel?: 1 | 2;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_5: {}, __VLS_7: {}, __VLS_9: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
metadata?: (props: typeof __VLS_5) => any;
|
|
9
|
+
} & {
|
|
10
|
+
actions?: (props: typeof __VLS_7) => any;
|
|
11
|
+
} & {
|
|
12
|
+
filters?: (props: typeof __VLS_9) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
|
+
headingLevel: 1 | 2;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WThemeMode, WThemeOverrides } from '../theme';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
mode?: WThemeMode | 'auto';
|
|
4
|
+
preset?: 'ui5';
|
|
5
|
+
colors?: WThemeOverrides;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
mode: WThemeMode | "auto";
|
|
13
|
+
preset: "ui5";
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -81,3 +81,7 @@ export type { WSegmentedControlOption } from './components/WSegmentedControl.vue
|
|
|
81
81
|
export { default as MarketplaceIcon } from './components/icons/MarketplaceIcon.vue';
|
|
82
82
|
export { default as ProviderLogo } from './components/icons/ProviderLogo.vue';
|
|
83
83
|
export type { WTheme, WSemanticVariant } from './components/semantic/styles';
|
|
84
|
+
export { default as WThemeProvider } from './components/WThemeProvider.vue';
|
|
85
|
+
export { default as WPageHeader } from './components/WPageHeader.vue';
|
|
86
|
+
export { ui5Theme, themeVariables, chartPalettes, useWTheme } from './theme';
|
|
87
|
+
export type { WThemeMode, WThemeColors, WThemeOverrides } from './theme';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
export type WThemeMode = 'light' | 'dark';
|
|
3
|
+
export interface WThemeColors {
|
|
4
|
+
canvas: string;
|
|
5
|
+
surface: string;
|
|
6
|
+
input: string;
|
|
7
|
+
raised: string;
|
|
8
|
+
popover: string;
|
|
9
|
+
border: string;
|
|
10
|
+
borderHover: string;
|
|
11
|
+
text: string;
|
|
12
|
+
muted: string;
|
|
13
|
+
dim: string;
|
|
14
|
+
accent: string;
|
|
15
|
+
onAccent: string;
|
|
16
|
+
primary: string;
|
|
17
|
+
primaryHover: string;
|
|
18
|
+
onPrimary: string;
|
|
19
|
+
secondary: string;
|
|
20
|
+
secondaryHover: string;
|
|
21
|
+
onSecondary: string;
|
|
22
|
+
secondaryShadow: string;
|
|
23
|
+
switchOn: string;
|
|
24
|
+
switchOff: string;
|
|
25
|
+
switchDisabled: string;
|
|
26
|
+
switchThumb: string;
|
|
27
|
+
focusRing: string;
|
|
28
|
+
positive: string;
|
|
29
|
+
negative: string;
|
|
30
|
+
}
|
|
31
|
+
export type WThemeOverrides = Partial<Record<WThemeMode, Partial<WThemeColors>>>;
|
|
32
|
+
export declare const ui5Theme: Record<WThemeMode, WThemeColors>;
|
|
33
|
+
export declare const chartPalettes: Record<WThemeMode, readonly string[]>;
|
|
34
|
+
export declare function themeVariables(mode: WThemeMode, overrides?: Partial<WThemeColors>): Record<string, string>;
|
|
35
|
+
export interface WThemeContext {
|
|
36
|
+
mode: WThemeMode;
|
|
37
|
+
variables: Record<string, string>;
|
|
38
|
+
}
|
|
39
|
+
export declare const themeKey: InjectionKey<ComputedRef<WThemeContext | null>>;
|
|
40
|
+
export declare function useWTheme(): ComputedRef<WThemeContext | null>;
|