@nexxtmove/ui 1.35.0 → 1.37.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.
@@ -1,4 +1,4 @@
1
1
  export declare const customIcons: {
2
- funda: string;
2
+ funda: import('vue').DefineComponent<object, object, unknown>;
3
3
  };
4
4
  export type CustomIconName = keyof typeof customIcons;
@@ -5,17 +5,41 @@
5
5
  * is colour plus width, and that pair gets a component of its own.
6
6
  */
7
7
  export type EditorColorProperty = 'bg' | 'text';
8
+ declare const ROLES: readonly ["main", "accent", "background", "heading", "text"];
8
9
  /**
9
- * The colour as the editor needs it: a Tailwind arbitrary-value class such as
10
- * `'bg-[#1777EA]'`, so the consumer can put the model value straight on the
11
- * element it styles.
10
+ * A role of the customer's theme. A colour bound to a role follows the theme,
11
+ * where a literal colour stays what it was picked as.
12
12
  */
13
- export type EditorColorValue = `${EditorColorProperty}-[#${string}]`;
13
+ export type EditorColorRole = (typeof ROLES)[number];
14
+ /** A literal colour: a Tailwind arbitrary-value class such as `'bg-[#1777EA]'`. */
15
+ export type EditorColorLiteralValue = `${EditorColorProperty}-[#${string}]`;
16
+ /** A colour bound to a theme role: a token class such as `'bg-theme-main'`. */
17
+ export type EditorColorRoleValue = `${EditorColorProperty}-theme-${EditorColorRole}`;
18
+ /**
19
+ * The colour as the editor needs it: the class to apply, so the consumer can
20
+ * put the model value straight on the element it styles. Either a literal
21
+ * colour or a theme role.
22
+ */
23
+ export type EditorColorValue = EditorColorLiteralValue | EditorColorRoleValue;
24
+ export interface EditorColorThemeRole {
25
+ /** The role the class is written for: `'main'` becomes `bg-theme-main`. */
26
+ role: EditorColorRole;
27
+ /** Name of the role as the user reads it, in the swatch's tooltip and in the trigger. */
28
+ label: string;
29
+ /**
30
+ * The role's current colour as a 6- or 8-digit hex. Only used to paint the
31
+ * swatch: the library ships no CSS for the role classes, and the hex never
32
+ * reaches the model.
33
+ */
34
+ hex: string;
35
+ }
14
36
  export interface EditorColorMessages {
15
37
  /** Text shown while no colour is set. Defaults to `'Kies kleur...'`. */
16
38
  placeholder?: string;
17
39
  /** Label shown above reusable colours. */
18
40
  suggestionsLabel?: string;
41
+ /** Label shown above the theme roles. Defaults to `'Huisstijl'`. */
42
+ themeLabel?: string;
19
43
  }
20
44
  export interface NexxtEditorColorProps {
21
45
  /**
@@ -43,6 +67,13 @@ export interface NexxtEditorColorProps {
43
67
  messages?: EditorColorMessages;
44
68
  /** Hex colours available inside the picker panel as one-click suggestions. */
45
69
  suggestions?: string[];
70
+ /**
71
+ * Theme roles offered above the suggestions. Picking one writes the role
72
+ * class for the current `property` instead of a literal colour. Which roles
73
+ * are offered is up to the consumer; an entry whose `hex` is not a 6- or
74
+ * 8-digit hex is left out. Without roles the section is not rendered.
75
+ */
76
+ themeRoles?: EditorColorThemeRole[];
46
77
  }
47
78
  declare const _default: typeof __VLS_export;
48
79
  export default _default;
@@ -51,33 +82,39 @@ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorColorProps
51
82
  * The chosen colour, as the Tailwind class to apply.
52
83
  *
53
84
  * Beware: Tailwind only generates an arbitrary class for text it finds in the
54
- * source at build time. A value that arrives at runtime -- from a database,
55
- * say -- therefore gets no CSS of its own; the consumer either translates it
56
- * into an inline style or safelists the classes it can produce. The hex is
57
- * always parseable out of the string, which is what makes that translation
58
- * possible.
85
+ * source at build time. A literal value that arrives at runtime -- from a
86
+ * database, say -- therefore gets no CSS of its own; the consumer either
87
+ * translates it into an inline style or safelists the classes it can produce.
88
+ * The hex is always parseable out of a literal value, which is what makes that
89
+ * translation possible.
90
+ *
91
+ * A role class is a finite list, so it is static CSS -- but the consumer's:
92
+ * this library defines no `theme-*` colours.
59
93
  */
60
94
  modelValue: EditorColorValue;
61
95
  /** Open state of the block. Only has an effect when `switchable` is `true`. */
62
96
  enabled?: boolean;
63
97
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
64
- "update:modelValue": (value: `text-[#${string}]` | `bg-[#${string}]`) => any;
98
+ "update:modelValue": (value: EditorColorValue) => any;
65
99
  "update:enabled": (value: boolean) => any;
66
100
  }, string, import('vue').PublicProps, Readonly<NexxtEditorColorProps & {
67
101
  /**
68
102
  * The chosen colour, as the Tailwind class to apply.
69
103
  *
70
104
  * Beware: Tailwind only generates an arbitrary class for text it finds in the
71
- * source at build time. A value that arrives at runtime -- from a database,
72
- * say -- therefore gets no CSS of its own; the consumer either translates it
73
- * into an inline style or safelists the classes it can produce. The hex is
74
- * always parseable out of the string, which is what makes that translation
75
- * possible.
105
+ * source at build time. A literal value that arrives at runtime -- from a
106
+ * database, say -- therefore gets no CSS of its own; the consumer either
107
+ * translates it into an inline style or safelists the classes it can produce.
108
+ * The hex is always parseable out of a literal value, which is what makes that
109
+ * translation possible.
110
+ *
111
+ * A role class is a finite list, so it is static CSS -- but the consumer's:
112
+ * this library defines no `theme-*` colours.
76
113
  */
77
114
  modelValue: EditorColorValue;
78
115
  /** Open state of the block. Only has an effect when `switchable` is `true`. */
79
116
  enabled?: boolean;
80
117
  }> & Readonly<{
81
- "onUpdate:modelValue"?: ((value: `text-[#${string}]` | `bg-[#${string}]`) => any) | undefined;
118
+ "onUpdate:modelValue"?: ((value: EditorColorValue) => any) | undefined;
82
119
  "onUpdate:enabled"?: ((value: boolean) => any) | undefined;
83
120
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * The steps the slider can land on, as the class they are stored as and the
3
+ * pixels that class is. Not a scale Tailwind has names for -- `tracking-wide`
4
+ * is an em and moves with the font size, and the editor shows every size in
5
+ * px -- so every step is an arbitrary-value class.
6
+ *
7
+ * The middle step is no class at all: zero is what the text already does, and
8
+ * storing nothing for it keeps the "no class means default" every other
9
+ * setting has. The negative side is there on purpose: tightening a large
10
+ * heading is a real need.
11
+ *
12
+ * The consumer stores these classes and lists them in an `@source inline` rule,
13
+ * so adding or renaming a token is a breaking change even though the component
14
+ * API stays the same.
15
+ */
16
+ export declare const EDITOR_LETTER_SPACING_STEPS: readonly [{
17
+ readonly token: "tracking-[-1px]";
18
+ readonly px: -1;
19
+ }, {
20
+ readonly token: "tracking-[-0.5px]";
21
+ readonly px: -0.5;
22
+ }, {
23
+ readonly token: "tracking-[-0.25px]";
24
+ readonly px: -0.25;
25
+ }, {
26
+ readonly token: null;
27
+ readonly px: 0;
28
+ }, {
29
+ readonly token: "tracking-[0.25px]";
30
+ readonly px: 0.25;
31
+ }, {
32
+ readonly token: "tracking-[0.5px]";
33
+ readonly px: 0.5;
34
+ }, {
35
+ readonly token: "tracking-[1px]";
36
+ readonly px: 1;
37
+ }, {
38
+ readonly token: "tracking-[1.5px]";
39
+ readonly px: 1.5;
40
+ }, {
41
+ readonly token: "tracking-[2px]";
42
+ readonly px: 2;
43
+ }];
44
+ /**
45
+ * The letter spacing as the editor needs it: the Tailwind class itself, so the
46
+ * consumer can put the model value straight on the element it styles. The
47
+ * default step is `null` on the model, not a member of this type.
48
+ */
49
+ export type EditorLetterSpacingValue = NonNullable<(typeof EDITOR_LETTER_SPACING_STEPS)[number]['token']>;
50
+ /** Overridable copy of the value readout. Every key is optional. */
51
+ export interface EditorLetterSpacingMessages {
52
+ /** Unit shown behind the value. Defaults to `'px'`. */
53
+ unit?: string;
54
+ /** Decimal separator of the readout. Defaults to the Dutch `','`. */
55
+ decimalSeparator?: string;
56
+ }
57
+ export interface NexxtEditorLetterSpacingProps {
58
+ /**
59
+ * Header text of the settings block. Defaults to the Dutch
60
+ * `'Letterafstand'`; the library has no i18n layer, so a consumer in another
61
+ * language passes its own copy in.
62
+ */
63
+ label?: string;
64
+ /**
65
+ * Copy of the value readout. Merged per key, so overriding one key keeps the
66
+ * defaults of the others. Copy is never translated inside the component.
67
+ */
68
+ messages?: EditorLetterSpacingMessages;
69
+ }
70
+ declare const _default: typeof __VLS_export;
71
+ export default _default;
72
+ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorLetterSpacingProps & {
73
+ /**
74
+ * The selected letter spacing, as the Tailwind class to apply. `null` -- also
75
+ * what an unset model is -- is the default step: no class at all, zero.
76
+ */
77
+ modelValue?: EditorLetterSpacingValue | null;
78
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
79
+ "update:modelValue": (value: EditorLetterSpacingValue | null) => any;
80
+ pointerup: (event: PointerEvent) => any;
81
+ }, string, import('vue').PublicProps, Readonly<NexxtEditorLetterSpacingProps & {
82
+ /**
83
+ * The selected letter spacing, as the Tailwind class to apply. `null` -- also
84
+ * what an unset model is -- is the default step: no class at all, zero.
85
+ */
86
+ modelValue?: EditorLetterSpacingValue | null;
87
+ }> & Readonly<{
88
+ "onUpdate:modelValue"?: ((value: EditorLetterSpacingValue | null) => any) | undefined;
89
+ onPointerup?: ((event: PointerEvent) => any) | undefined;
90
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,104 @@
1
+ /**
2
+ * The steps the slider can land on, as the class they are stored as and the
3
+ * pixels that class is. The `leading-*` classes are Tailwind's spacing scale
4
+ * (calc of `--spacing`, 4px a step), so `leading-6` really is 24px -- and a
5
+ * line height set here does not scale with the font size; that is the deal the
6
+ * fixed steps make, and nothing here tries to compensate for it.
7
+ *
8
+ * The first step is no class at all: the element keeps its own line height.
9
+ * It has no px of its own, so the readout names it instead of measuring it.
10
+ *
11
+ * The consumer stores these classes and lists them in an `@source inline` rule,
12
+ * so adding or renaming a token is a breaking change even though the component
13
+ * API stays the same.
14
+ */
15
+ export declare const EDITOR_LINE_HEIGHT_STEPS: readonly [{
16
+ readonly token: null;
17
+ readonly px: null;
18
+ }, {
19
+ readonly token: "leading-3";
20
+ readonly px: 12;
21
+ }, {
22
+ readonly token: "leading-4";
23
+ readonly px: 16;
24
+ }, {
25
+ readonly token: "leading-5";
26
+ readonly px: 20;
27
+ }, {
28
+ readonly token: "leading-6";
29
+ readonly px: 24;
30
+ }, {
31
+ readonly token: "leading-7";
32
+ readonly px: 28;
33
+ }, {
34
+ readonly token: "leading-8";
35
+ readonly px: 32;
36
+ }, {
37
+ readonly token: "leading-9";
38
+ readonly px: 36;
39
+ }, {
40
+ readonly token: "leading-10";
41
+ readonly px: 40;
42
+ }, {
43
+ readonly token: "leading-11";
44
+ readonly px: 44;
45
+ }, {
46
+ readonly token: "leading-12";
47
+ readonly px: 48;
48
+ }, {
49
+ readonly token: "leading-14";
50
+ readonly px: 56;
51
+ }, {
52
+ readonly token: "leading-16";
53
+ readonly px: 64;
54
+ }];
55
+ /**
56
+ * The line height as the editor needs it: the Tailwind class itself, so the
57
+ * consumer can put the model value straight on the element it styles. The
58
+ * default step is `null` on the model, not a member of this type.
59
+ */
60
+ export type EditorLineHeightValue = NonNullable<(typeof EDITOR_LINE_HEIGHT_STEPS)[number]['token']>;
61
+ /** Overridable copy of the value readout. Every key is optional. */
62
+ export interface EditorLineHeightMessages {
63
+ /** Unit shown behind the value. Defaults to `'px'`. */
64
+ unit?: string;
65
+ /**
66
+ * Readout of the first step, no class, which has no px size. Defaults to
67
+ * the Dutch `'Standaard'`.
68
+ */
69
+ default?: string;
70
+ }
71
+ export interface NexxtEditorLineHeightProps {
72
+ /**
73
+ * Header text of the settings block. Defaults to the Dutch
74
+ * `'Regelafstand'`; the library has no i18n layer, so a consumer in another
75
+ * language passes its own copy in.
76
+ */
77
+ label?: string;
78
+ /**
79
+ * Copy of the value readout. Merged per key, so overriding one key keeps the
80
+ * defaults of the others. Copy is never translated inside the component.
81
+ */
82
+ messages?: EditorLineHeightMessages;
83
+ }
84
+ declare const _default: typeof __VLS_export;
85
+ export default _default;
86
+ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorLineHeightProps & {
87
+ /**
88
+ * The selected line height, as the Tailwind class to apply. `null` -- also
89
+ * what an unset model is -- is the default step: no class at all.
90
+ */
91
+ modelValue?: EditorLineHeightValue | null;
92
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
93
+ "update:modelValue": (value: EditorLineHeightValue | null) => any;
94
+ pointerup: (event: PointerEvent) => any;
95
+ }, string, import('vue').PublicProps, Readonly<NexxtEditorLineHeightProps & {
96
+ /**
97
+ * The selected line height, as the Tailwind class to apply. `null` -- also
98
+ * what an unset model is -- is the default step: no class at all.
99
+ */
100
+ modelValue?: EditorLineHeightValue | null;
101
+ }> & Readonly<{
102
+ "onUpdate:modelValue"?: ((value: EditorLineHeightValue | null) => any) | undefined;
103
+ onPointerup?: ((event: PointerEvent) => any) | undefined;
104
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -14,13 +14,22 @@ export interface NexxtColorPickerProps {
14
14
  suggestions?: ColorSuggestions;
15
15
  /** Accessible and visible label for the suggestions. */
16
16
  suggestionsLabel?: string;
17
+ /**
18
+ * Text shown in the trigger in place of the formatted colour, for a value that has a name of
19
+ * its own, such as a theme role. Only shown while a colour is set.
20
+ */
21
+ valueLabel?: string;
17
22
  }
23
+ type __VLS_Slots = {
24
+ /** Named colours a wrapper offers next to the free picker; rendered above the suggestions. */
25
+ presets?(): unknown;
26
+ };
18
27
  type __VLS_Props = NexxtColorPickerProps;
19
28
  type __VLS_ModelProps = {
20
29
  modelValue?: string;
21
30
  };
22
31
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
23
- declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
32
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
24
33
  "update:modelValue": (value: string) => any;
25
34
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
26
35
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
@@ -33,5 +42,11 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
33
42
  suggestions: ColorSuggestions;
34
43
  suggestionsLabel: string;
35
44
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
45
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
36
46
  declare const _default: typeof __VLS_export;
37
47
  export default _default;
48
+ type __VLS_WithSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export type { EditorAlignItemsMessages, EditorAlignItemsValue, } from './compone
14
14
  export type { EditorBackgroundSizeMessages, EditorBackgroundSizeValue, } from './components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.vue';
15
15
  export type { EditorFlexDirectionMessages, EditorFlexDirectionValue, } from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue';
16
16
  export type { EditorGapMessages, EditorGapValue, } from './components/editor/molecules/EditorGap/EditorGap.vue';
17
- export type { EditorColorMessages, EditorColorProperty, EditorColorValue, } from './components/editor/molecules/EditorColor/EditorColor.vue';
17
+ export type { EditorColorLiteralValue, EditorColorMessages, EditorColorProperty, EditorColorRole, EditorColorRoleValue, EditorColorThemeRole, EditorColorValue, } from './components/editor/molecules/EditorColor/EditorColor.vue';
18
18
  export type { EditorBorderMessages, EditorBorderWidth, } from './components/editor/molecules/EditorBorder/EditorBorder.vue';
19
19
  export type { EditorHeadingTypeMessages, EditorHeadingTypeValue, } from './components/editor/molecules/EditorHeadingType/EditorHeadingType.vue';
20
20
  export { EDITOR_RADIUS_STEPS } from './components/editor/molecules/EditorRadius/EditorRadius.vue';
@@ -23,6 +23,10 @@ export type { EditorTextAlignMessages, EditorTextAlignValue, } from './component
23
23
  export type { EditorJustifyContentMessages, EditorJustifyContentValue, } from './components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue';
24
24
  export { EDITOR_MAX_WIDTH_STEPS } from './components/editor/molecules/EditorMaxWidth/EditorMaxWidth.vue';
25
25
  export type { EditorMaxWidthMessages, EditorMaxWidthValue, } from './components/editor/molecules/EditorMaxWidth/EditorMaxWidth.vue';
26
+ export { EDITOR_LINE_HEIGHT_STEPS } from './components/editor/molecules/EditorLineHeight/EditorLineHeight.vue';
27
+ export type { EditorLineHeightMessages, EditorLineHeightValue, } from './components/editor/molecules/EditorLineHeight/EditorLineHeight.vue';
28
+ export { EDITOR_LETTER_SPACING_STEPS } from './components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.vue';
29
+ export type { EditorLetterSpacingMessages, EditorLetterSpacingValue, } from './components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.vue';
26
30
  export type { EditorPaddingMessages } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
27
31
  export type { NexxtTemplateCardContentFeature, NexxtTemplateCardProps, NexxtTemplateCardSlots, } from './components/molecules/TemplateCard/TemplateCard.vue';
28
32
  export { default as NexxtAnimatedNumber } from './components/atoms/AnimatedNumber/AnimatedNumber.vue';
@@ -50,6 +54,8 @@ export { default as NexxtEditorFlexDirection } from './components/editor/molecul
50
54
  export { default as NexxtEditorGap } from './components/editor/molecules/EditorGap/EditorGap.vue';
51
55
  export { default as NexxtEditorHeadingType } from './components/editor/molecules/EditorHeadingType/EditorHeadingType.vue';
52
56
  export { default as NexxtEditorJustifyContent } from './components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue';
57
+ export { default as NexxtEditorLetterSpacing } from './components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.vue';
58
+ export { default as NexxtEditorLineHeight } from './components/editor/molecules/EditorLineHeight/EditorLineHeight.vue';
53
59
  export { default as NexxtEditorMaxWidth } from './components/editor/molecules/EditorMaxWidth/EditorMaxWidth.vue';
54
60
  export { default as NexxtEditorPadding } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
55
61
  export { default as NexxtEditorRadius } from './components/editor/molecules/EditorRadius/EditorRadius.vue';