@nexxtmove/ui 1.21.0 → 1.23.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.
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The CSS property the chosen colour is written to. It is the prefix of the
3
+ * Tailwind class the model carries, so it decides whether the colour becomes a
4
+ * background or a text colour. `border` is deliberately not offered: a border
5
+ * is colour plus width, and that pair gets a component of its own.
6
+ */
7
+ export type EditorColorProperty = 'bg' | 'text';
8
+ /**
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.
12
+ */
13
+ export type EditorColorValue = `${EditorColorProperty}-[#${string}]`;
14
+ /** Overridable copy of the picker. Every key is optional. */
15
+ export interface EditorColorMessages {
16
+ /** Text shown while no colour is set. Defaults to `'Kies kleur...'`. */
17
+ placeholder?: string;
18
+ }
19
+ export interface NexxtEditorColorProps {
20
+ /**
21
+ * Header text of the settings block. Defaults to the Dutch `'Kleur'`; the
22
+ * library has no i18n layer, so a consumer in another language passes its
23
+ * own copy in.
24
+ */
25
+ label?: string;
26
+ /**
27
+ * Render a switch next to the label that collapses and expands the picker.
28
+ * The switch state is the `enabled` model; the colour itself is kept while
29
+ * the block is collapsed.
30
+ */
31
+ switchable?: boolean;
32
+ /**
33
+ * The prefix of the class that is written: `'bg'` for a background colour,
34
+ * `'text'` for a text colour. Changing it rewrites the current value, so the
35
+ * model never disagrees with this prop.
36
+ */
37
+ property?: EditorColorProperty;
38
+ /**
39
+ * Copy of the picker. Merged per key, so overriding one key keeps the
40
+ * defaults of the others. Copy is never translated inside the component.
41
+ */
42
+ messages?: EditorColorMessages;
43
+ }
44
+ declare const _default: typeof __VLS_export;
45
+ export default _default;
46
+ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorColorProps & {
47
+ /**
48
+ * The chosen colour, as the Tailwind class to apply.
49
+ *
50
+ * Beware: Tailwind only generates an arbitrary class for text it finds in the
51
+ * source at build time. A value that arrives at runtime -- from a database,
52
+ * say -- therefore gets no CSS of its own; the consumer either translates it
53
+ * into an inline style or safelists the classes it can produce. The hex is
54
+ * always parseable out of the string, which is what makes that translation
55
+ * possible.
56
+ */
57
+ modelValue: EditorColorValue;
58
+ /** Open state of the block. Only has an effect when `switchable` is `true`. */
59
+ enabled?: boolean;
60
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
61
+ "update:modelValue": (value: `text-[#${string}]` | `bg-[#${string}]`) => any;
62
+ "update:enabled": (value: boolean) => any;
63
+ }, string, import('vue').PublicProps, Readonly<NexxtEditorColorProps & {
64
+ /**
65
+ * The chosen colour, as the Tailwind class to apply.
66
+ *
67
+ * Beware: Tailwind only generates an arbitrary class for text it finds in the
68
+ * source at build time. A value that arrives at runtime -- from a database,
69
+ * say -- therefore gets no CSS of its own; the consumer either translates it
70
+ * into an inline style or safelists the classes it can produce. The hex is
71
+ * always parseable out of the string, which is what makes that translation
72
+ * possible.
73
+ */
74
+ modelValue: EditorColorValue;
75
+ /** Open state of the block. Only has an effect when `switchable` is `true`. */
76
+ enabled?: boolean;
77
+ }> & Readonly<{
78
+ "onUpdate:modelValue"?: ((value: `text-[#${string}]` | `bg-[#${string}]`) => any) | undefined;
79
+ "onUpdate:enabled"?: ((value: boolean) => any) | undefined;
80
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * The heading levels the editor offers, in the order they are listed. The level
3
+ * is what the option shows -- its label and its `h1`..`h6` icon -- and the size
4
+ * is what the model carries. The sizes are Tailwind's default scale on purpose,
5
+ * not the theme's `heading-*` utilities: this value is data the editor stores
6
+ * and puts back on an element, so it has to be a class every consumer resolves.
7
+ */
8
+ declare const HEADING_LEVELS: readonly [{
9
+ readonly level: 1;
10
+ readonly size: "text-4xl";
11
+ }, {
12
+ readonly level: 2;
13
+ readonly size: "text-3xl";
14
+ }, {
15
+ readonly level: 3;
16
+ readonly size: "text-2xl";
17
+ }, {
18
+ readonly level: 4;
19
+ readonly size: "text-xl";
20
+ }, {
21
+ readonly level: 5;
22
+ readonly size: "text-lg";
23
+ }, {
24
+ readonly level: 6;
25
+ readonly size: "text-base";
26
+ }];
27
+ /**
28
+ * The heading as the editor needs it: the Tailwind font-size class itself, so
29
+ * the consumer can put the model value straight on the element it styles.
30
+ * Weight is deliberately not part of it -- that becomes a setting of its own.
31
+ */
32
+ export type EditorHeadingTypeValue = (typeof HEADING_LEVELS)[number]['size'];
33
+ /** Overridable copy for the six options. Every key is optional. */
34
+ export interface EditorHeadingTypeMessages {
35
+ /** Label of the `h1` option. Defaults to `'Heading 1'`. */
36
+ h1?: string;
37
+ /** Label of the `h2` option. Defaults to `'Heading 2'`. */
38
+ h2?: string;
39
+ /** Label of the `h3` option. Defaults to `'Heading 3'`. */
40
+ h3?: string;
41
+ /** Label of the `h4` option. Defaults to `'Heading 4'`. */
42
+ h4?: string;
43
+ /** Label of the `h5` option. Defaults to `'Heading 5'`. */
44
+ h5?: string;
45
+ /** Label of the `h6` option. Defaults to `'Heading 6'`. */
46
+ h6?: string;
47
+ }
48
+ export interface NexxtEditorHeadingTypeProps {
49
+ /**
50
+ * Header text of the settings block. Defaults to the Dutch `'Type'`; the
51
+ * library has no i18n layer, so a consumer in another language passes its
52
+ * own copy in.
53
+ */
54
+ label?: string;
55
+ /**
56
+ * Labels of the six options. The defaults use the English term "Heading",
57
+ * as the Dutch design in Figma does, and are merged per key, so overriding
58
+ * one label keeps the defaults of the others. Copy is never translated
59
+ * inside the component.
60
+ */
61
+ messages?: EditorHeadingTypeMessages;
62
+ }
63
+ declare const _default: typeof __VLS_export;
64
+ export default _default;
65
+ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorHeadingTypeProps & {
66
+ /** The selected heading, as the Tailwind font-size class to apply. */
67
+ modelValue: EditorHeadingTypeValue;
68
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
69
+ "update:modelValue": (value: "text-4xl" | "text-3xl" | "text-2xl" | "text-xl" | "text-lg" | "text-base") => any;
70
+ }, string, import('vue').PublicProps, Readonly<NexxtEditorHeadingTypeProps & {
71
+ /** The selected heading, as the Tailwind font-size class to apply. */
72
+ modelValue: EditorHeadingTypeValue;
73
+ }> & Readonly<{
74
+ "onUpdate:modelValue"?: ((value: "text-4xl" | "text-3xl" | "text-2xl" | "text-xl" | "text-lg" | "text-base") => any) | undefined;
75
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,7 +1,13 @@
1
- import { default as Icon } from '../../atoms/Icon/Icon.vue';
1
+ import { default as Icon, NexxtIconName } from '../../atoms/Icon/Icon.vue';
2
2
  export type SelectOption = {
3
3
  label: string;
4
4
  value: string | number;
5
+ /**
6
+ * Icon rendered before the option's label in the list, and in the field
7
+ * while the option is selected. Optional; an explicit `leftIcon` on the
8
+ * field wins over it.
9
+ */
10
+ icon?: NexxtIconName;
5
11
  } | string;
6
12
  interface NexxtSelectProps {
7
13
  /** Options to choose from; plain strings or `{ label, value }` objects. */
@@ -18,6 +24,13 @@ interface NexxtSelectProps {
18
24
  leftIcon?: InstanceType<typeof Icon>['name'];
19
25
  /** Mark the field as required (renders an asterisk next to the label). */
20
26
  required?: boolean;
27
+ /**
28
+ * Accessible name of the field, for when it is labelled by something outside
29
+ * the component and `label` would duplicate that copy on screen. Lands on the
30
+ * combobox itself, which a fallthrough attribute cannot reach: the component
31
+ * root is the wrapper around it.
32
+ */
33
+ ariaLabel?: string;
21
34
  }
22
35
  type __VLS_Props = NexxtSelectProps;
23
36
  type __VLS_ModelProps = {
@@ -20,11 +20,11 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
20
20
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
21
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
22
22
  }>, {
23
- placeholder: string;
24
- fullWidth: boolean;
25
23
  matchWidth: boolean;
24
+ placeholder: string;
26
25
  showAlpha: boolean;
27
26
  formats: ColorFormat[];
27
+ fullWidth: boolean;
28
28
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
29
  declare const _default: typeof __VLS_export;
30
30
  export default _default;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export type { NexxtTabItem } from './components/molecules/Tabs/Tabs.vue';
8
8
  export type { EditorAlignItemsMessages, EditorAlignItemsValue, } from './components/editor/molecules/EditorAlignItems/EditorAlignItems.vue';
9
9
  export type { EditorFlexDirectionMessages, EditorFlexDirectionValue, } from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue';
10
10
  export type { EditorGapMessages, EditorGapValue, } from './components/editor/molecules/EditorGap/EditorGap.vue';
11
+ export type { EditorColorMessages, EditorColorProperty, EditorColorValue, } from './components/editor/molecules/EditorColor/EditorColor.vue';
12
+ export type { EditorHeadingTypeMessages, EditorHeadingTypeValue, } from './components/editor/molecules/EditorHeadingType/EditorHeadingType.vue';
11
13
  export type { EditorRadiusMessages, EditorRadiusValue, } from './components/editor/molecules/EditorRadius/EditorRadius.vue';
12
14
  export type { EditorJustifyContentMessages, EditorJustifyContentValue, } from './components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue';
13
15
  export type { EditorPaddingMessages } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
@@ -30,11 +32,13 @@ export { default as NexxtDatePicker } from './components/organisms/DatePicker/Da
30
32
  export { default as NexxtDoughnutChart } from './components/molecules/DoughnutChart/DoughnutChart.vue';
31
33
  export { default as NexxtDropdownButton } from './components/organisms/DropdownButton/DropdownButton.vue';
32
34
  export { default as NexxtEditorAlignItems } from './components/editor/molecules/EditorAlignItems/EditorAlignItems.vue';
35
+ export { default as NexxtEditorColor } from './components/editor/molecules/EditorColor/EditorColor.vue';
33
36
  export { default as NexxtEditorFlexDirection } from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue';
34
37
  export { default as NexxtEditorGap } from './components/editor/molecules/EditorGap/EditorGap.vue';
38
+ export { default as NexxtEditorHeadingType } from './components/editor/molecules/EditorHeadingType/EditorHeadingType.vue';
35
39
  export { default as NexxtEditorJustifyContent } from './components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue';
36
- export { default as NexxtEditorRadius } from './components/editor/molecules/EditorRadius/EditorRadius.vue';
37
40
  export { default as NexxtEditorPadding } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
41
+ export { default as NexxtEditorRadius } from './components/editor/molecules/EditorRadius/EditorRadius.vue';
38
42
  export { default as NexxtEditorSettingsBlock } from './components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue';
39
43
  export { default as NexxtEnergyLabel } from './components/atoms/EnergyLabel/EnergyLabel.vue';
40
44
  export { default as NexxtFloatingPanel } from './components/atoms/FloatingPanel/FloatingPanel.vue';