@filipgutica/ui 1.14.0 → 1.15.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 +7 -5
- package/dist/components/UiSegmentedControl.vue.d.ts +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +177 -177
- package/dist/site.js +179 -185
- package/dist/{use-active-section-DCS_wyYq.js → use-active-section-DMbpGE2f.js} +60 -8
- package/package.json +1 -1
- package/src/components.css +50 -2
- package/src/site.css +4 -39
package/README.md
CHANGED
|
@@ -121,8 +121,9 @@ Bind `aria-current="location"` to the link whose section matches the value.
|
|
|
121
121
|
## Project sites
|
|
122
122
|
|
|
123
123
|
The `site` entry gives the project sites one header, one appearance choice, and
|
|
124
|
-
shared page styles. Import `@filipgutica/ui/
|
|
125
|
-
|
|
124
|
+
shared page styles. Import `@filipgutica/ui/components.css`,
|
|
125
|
+
`@filipgutica/ui/site.css`, and the Graphite Indigo theme above, which supplies
|
|
126
|
+
the type and spacing roles `site.css` reads. Keep
|
|
126
127
|
document-wide link styles in `@layer base` so the header owns its navigation
|
|
127
128
|
appearance.
|
|
128
129
|
|
|
@@ -143,9 +144,10 @@ import { UiSiteHeader } from '@filipgutica/ui/site'
|
|
|
143
144
|
menu is a native disclosure that works without JavaScript; Escape closes it and
|
|
144
145
|
returns focus to its button. Inside `.fg-site-docs`, at 640px and below, the
|
|
145
146
|
header hides `links` so it fits one row, so repeat those destinations in the footer. Without a
|
|
146
|
-
default slot the header renders a System, Light, and Dark picker
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
default slot the header renders a System, Light, and Dark picker, built on
|
|
148
|
+
`UiSegmentedControl`. A page with its own appearance control passes it in the
|
|
149
|
+
default slot and uses `useSiteAppearance({ applyToRoot: false })` when it owns
|
|
150
|
+
the root element.
|
|
149
151
|
|
|
150
152
|
`useSiteAppearance()` returns `choice`, the resolved `appearance`, and
|
|
151
153
|
`chooseAppearance(value)`. The choice is stored under `tool-site-theme`, follows
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { UiControlSize } from '../control.js';
|
|
2
|
+
export interface UiSegmentedItem<T extends string = string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface UiSegmentedControlProps<T extends string = string> {
|
|
8
|
+
/** Names the group for assistive technology. */
|
|
9
|
+
label: string;
|
|
10
|
+
items: readonly UiSegmentedItem<T>[];
|
|
11
|
+
modelValue?: T;
|
|
12
|
+
/** Shows only the icon slot; each label becomes the button's accessible name and tooltip. */
|
|
13
|
+
iconOnly?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
size?: UiControlSize;
|
|
16
|
+
}
|
|
17
|
+
declare const __VLS_export: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
18
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<UiSegmentedControlProps<T> & {
|
|
19
|
+
"onUpdate:modelValue"?: (value: T) => any;
|
|
20
|
+
}> & (typeof globalThis extends {
|
|
21
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
22
|
+
} ? P : {});
|
|
23
|
+
expose: (exposed: {}) => void;
|
|
24
|
+
attrs: any;
|
|
25
|
+
slots: {
|
|
26
|
+
icon?(props: {
|
|
27
|
+
item: UiSegmentedItem<T>;
|
|
28
|
+
pressed: boolean;
|
|
29
|
+
}): unknown;
|
|
30
|
+
};
|
|
31
|
+
emit: (event: "update:modelValue", value: T) => void;
|
|
32
|
+
}>) => import("vue").VNode & {
|
|
33
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
34
|
+
};
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
38
|
+
[K in keyof T]: T[K];
|
|
39
|
+
} : {
|
|
40
|
+
[K in keyof T as K]: T[K];
|
|
41
|
+
}) & {};
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export { default as UiRadioCardGroup } from './components/UiRadioCardGroup.vue';
|
|
|
28
28
|
export type { UiRadioCardGroupProps } from './components/UiRadioCardGroup.vue';
|
|
29
29
|
export { default as UiScore } from './components/UiScore.vue';
|
|
30
30
|
export type { UiScoreProps } from './components/UiScore.vue';
|
|
31
|
+
export { default as UiSegmentedControl } from './components/UiSegmentedControl.vue';
|
|
32
|
+
export type { UiSegmentedControlProps, UiSegmentedItem } from './components/UiSegmentedControl.vue';
|
|
31
33
|
export { default as UiSelect } from './components/UiSelect.vue';
|
|
32
34
|
export type { UiSelectProps } from './components/UiSelect.vue';
|
|
33
35
|
export { default as UiSlider } from './components/UiSlider.vue';
|