@filipgutica/ui 1.14.1 → 1.16.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
@@ -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/site.css` and the Graphite Indigo
125
- theme above, which supplies the type and spacing roles `site.css` reads. Keep
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. A page with its own appearance control passes it
147
- in the default slot and uses `useSiteAppearance({ applyToRoot: false })` when it
148
- owns the root element.
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,42 @@
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
+ /** The pressed option. Undefined leaves every option unpressed. */
12
+ modelValue?: T | undefined;
13
+ /** Shows only the icon slot; each label becomes the button's accessible name and tooltip. */
14
+ iconOnly?: boolean;
15
+ disabled?: boolean;
16
+ size?: UiControlSize;
17
+ }
18
+ 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<{
19
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<UiSegmentedControlProps<T> & {
20
+ "onUpdate:modelValue"?: (value: T) => any;
21
+ }> & (typeof globalThis extends {
22
+ __VLS_PROPS_FALLBACK: infer P;
23
+ } ? P : {});
24
+ expose: (exposed: {}) => void;
25
+ attrs: any;
26
+ slots: {
27
+ icon?(props: {
28
+ item: UiSegmentedItem<T>;
29
+ pressed: boolean;
30
+ }): unknown;
31
+ };
32
+ emit: (event: "update:modelValue", value: T) => void;
33
+ }>) => import("vue").VNode & {
34
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
35
+ };
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
38
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
39
+ [K in keyof T]: T[K];
40
+ } : {
41
+ [K in keyof T as K]: T[K];
42
+ }) & {};
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';