@flitsmeister/design-system 2.2.33 → 2.2.34

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
@@ -28,15 +28,19 @@ Design tokens are exported as platform-specific files in `tokens/schema_exports/
28
28
 
29
29
  ### 2. Using Vue Components
30
30
 
31
- You can import individual Vue components directly from the package:
31
+ Import the components you need:
32
32
 
33
33
  ```js
34
34
  import { fmxButton, fmxInput, fmxDropdown } from "@flitsmeister/design-system";
35
35
  ```
36
36
 
37
- These are standard Vue 3 single-file components. Register and use them in your app as you would any other Vue component.
37
+ Register and use them as standard Vue 3 single-file components. Overview of each:
38
38
 
39
- **fmxDropdown** is a v-model select component. Pass `options` as an array of `{ value, label }`, and bind `v-model` to the selected value. Use the `option` slot to customize option rendering. Set `fullScreen` to true for a mobile-friendly modal overlay.
39
+ - **fmxButton** Button with multiple visual variants. Props: `role` (e.g. primary, secondary, success, warning, danger, info, strong, weak), `buttontype` (filled, text, outline, squared), `size` (sm, md, lg, xl), `icon` (symbol id for your SVG sprite), `iconPosition` (prepend, append), `disabled`, `customClasses`. Use `href` and `target` for link-style buttons. If you use `icon`, the consuming app must provide an SVG sprite that includes the referenced symbol ids.
40
+
41
+ - **fmxInput** — v-model text-style input with optional validation and floating placeholder. Props: `placeholder`, `rules` (array of validator functions), `customClass` (wrapper spacing/layout), `inputClass` (on the input element). To show a visible default border, set on a parent: `--fmx-input-border-default: var(--color-surface-neutral-default);` (focus and error states stay correct). To validate from a parent (e.g. on submit), use a ref and call `validate()`.
42
+
43
+ - **fmxDropdown** — v-model select. Pass `options` as an array of `{ value, label }` and bind `v-model` to the selected value. Use the `option` slot to customize option rendering. Set `fullScreen` to true for a mobile-friendly modal overlay.
40
44
 
41
45
  ### 3. Using Icons
42
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flitsmeister/design-system",
3
- "version": "2.2.33",
3
+ "version": "2.2.34",
4
4
  "description": "Flitsmeister design system and demo site",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -120,12 +120,12 @@
120
120
  }
121
121
 
122
122
  /*
123
- SIZES
124
- sm: 'text-base h-10 px-2 font-medium',
125
- md: 'text-lg h-12 px-4 font-bold',
126
- lg: 'text-2xl h-[60px] py-3 px-6 font-bold',
127
- xl: 'text-3xl h-20 py-md px-8 font-extrabold'
128
- */
123
+ SIZES
124
+ sm: 'text-base h-10 px-2 font-medium',
125
+ md: 'text-lg h-12 px-4 font-bold',
126
+ lg: 'text-2xl h-[60px] py-3 px-6 font-bold',
127
+ xl: 'text-3xl h-20 py-md px-8 font-extrabold'
128
+ */
129
129
  &[data-size="sm"] {
130
130
  @apply text-base h-10 px-3 font-medium;
131
131
  }
@@ -168,17 +168,17 @@
168
168
  }
169
169
 
170
170
  /*
171
- ROLES
172
- primary: 'bg-surface-brand text-content-label',
173
- secondary: 'bg-surface-brandalt text-content-brand',
174
- success: 'bg-surface-success text-content-label',
175
- warning: 'bg-surface-warning text-content-label',
176
- danger: 'bg-surface-danger text-content-label',
177
- dangeralt: 'bg-surface-dangeralt text-content-danger',
178
- info: 'bg-surface-info text-content-label',
179
- strong: 'bg-black text-white',
180
- weak: 'bg-white text-content-brand'
181
- */
171
+ ROLES
172
+ primary: 'bg-surface-brand text-content-label',
173
+ secondary: 'bg-surface-brandalt text-content-brand',
174
+ success: 'bg-surface-success text-content-label',
175
+ warning: 'bg-surface-warning text-content-label',
176
+ danger: 'bg-surface-danger text-content-label',
177
+ dangeralt: 'bg-surface-dangeralt text-content-danger',
178
+ info: 'bg-surface-info text-content-label',
179
+ strong: 'bg-black text-white',
180
+ weak: 'bg-white text-content-brand'
181
+ */
182
182
 
183
183
  /* color schemes per variant */
184
184
  &[data-buttontype="filled"],
@@ -247,11 +247,7 @@
247
247
  }
248
248
  }
249
249
 
250
- /*
251
- TODO: where did active/hover states go?
252
- */
253
-
254
- body &[class][disabled] {
250
+ body &[class][disabled][data-buttontype][data-role] {
255
251
  @apply cursor-not-allowed;
256
252
  @apply bg-surface-default text-content-weak;
257
253
 
@@ -3,6 +3,7 @@
3
3
  class="inputgroup w-full mb-6"
4
4
  :class="[customClass]"
5
5
  :data-inputgroup-type="type"
6
+ :data-size="size"
6
7
  >
7
8
  <div class="relative">
8
9
  <input
@@ -15,7 +16,7 @@
15
16
  :readonly="readonly"
16
17
  :maxlength="maxLength"
17
18
  :autocomplete="autocomplete"
18
- class="peer w-full bg-surface-defaulthighest text-content-default border-2 transition duration-300 ease focus:outline-none focus:border-out autofill:bg-surface-defaulthighest autofill:text-content-default"
19
+ class="peer fmx-input-border w-full bg-surface-defaulthighest text-content-default border-2 transition duration-300 ease focus:outline-none focus:border-out fmx-input-autofill"
19
20
  :class="[
20
21
  inputStateClass,
21
22
  sizeConfig.input,
@@ -59,36 +60,35 @@
59
60
 
60
61
  const SIZE_CONFIG = {
61
62
  sm: {
62
- input: "h-10 text-base rounded-2xl px-3 autofill:pt-5 autofill:pb-1",
63
+ input: "h-10 text-base rounded-2xl px-3",
63
64
  inputWithPlaceholder: "pt-5 pb-1",
64
65
  inputWithoutPlaceholder: "py-2 flex items-center justify-center",
65
66
  label: "top-2.5",
66
67
  labelText: "text-base",
67
68
  labelFocused:
68
- "peer-focus:top-[4px] peer-focus:left-2.5 peer-focus:text-xs peer-focus:font-bold peer-autofill:top-[4px] peer-autofill:left-2.5 peer-autofill:text-xs peer-autofill:font-bold",
69
+ "peer-focus:top-[4px] peer-focus:left-2.5 peer-focus:text-xs peer-focus:font-bold",
69
70
  labelFilled: "top-[4px] left-2.5 text-xs font-bold",
70
71
  icon: "right-2 top-2.5 text-xl leading-none",
71
72
  },
72
73
  md: {
73
- input:
74
- "h-[60px] text-lg leading-snug rounded-2xl px-3 autofill:pt-6 autofill:pb-1",
74
+ input: "h-[60px] text-lg leading-snug rounded-2xl px-3",
75
75
  inputWithPlaceholder: "pt-6 pb-1",
76
76
  inputWithoutPlaceholder: "py-3 flex items-center justify-center",
77
77
  label: "top-3.5",
78
78
  labelText: "text-lg",
79
79
  labelFocused:
80
- "peer-focus:top-[6px] peer-focus:left-2.5 peer-focus:text-sm peer-focus:font-bold peer-autofill:top-[6px] peer-autofill:left-2.5 peer-autofill:text-sm peer-autofill:font-bold",
80
+ "peer-focus:top-[6px] peer-focus:left-2.5 peer-focus:text-sm peer-focus:font-bold",
81
81
  labelFilled: "top-[6px] left-2.5 text-sm font-bold",
82
82
  icon: "right-2 top-4 text-2xl leading-none",
83
83
  },
84
84
  lg: {
85
- input: "h-14 text-lg rounded-2xl px-4 autofill:pt-7 autofill:pb-1",
85
+ input: "h-14 text-lg rounded-2xl px-4",
86
86
  inputWithPlaceholder: "pt-7 pb-1",
87
87
  inputWithoutPlaceholder: "py-4 flex items-center justify-center",
88
88
  label: "top-4",
89
89
  labelText: "text-lg",
90
90
  labelFocused:
91
- "peer-focus:top-[8px] peer-focus:left-2.5 peer-focus:text-sm peer-focus:font-bold peer-autofill:top-[8px] peer-autofill:left-2.5 peer-autofill:text-sm peer-autofill:font-bold",
91
+ "peer-focus:top-[8px] peer-focus:left-2.5 peer-focus:text-sm peer-focus:font-bold",
92
92
  labelFilled: "top-[8px] left-2.5 text-sm font-bold",
93
93
  icon: "right-3 top-5 text-2xl leading-none",
94
94
  },
@@ -180,9 +180,6 @@
180
180
  inputStateClass() {
181
181
  return {
182
182
  "border-outline-danger": this.errorMessage && !this.isFocused,
183
- "border-outline-brand": this.isFocused,
184
- "border-transparent focus:border-outline-brand hover:border-outline-brand":
185
- !this.errorMessage,
186
183
  };
187
184
  },
188
185
  labelFilledClass() {
@@ -233,6 +230,67 @@
233
230
  min-width: 100px;
234
231
  }
235
232
 
233
+ .inputgroup .fmx-input-border {
234
+ border-color: var(--fmx-input-border-default, transparent);
235
+ }
236
+ .inputgroup .fmx-input-border:focus {
237
+ border-color: var(--color-outline-brand);
238
+ }
239
+ .inputgroup .fmx-input-border:hover:not(:focus) {
240
+ border-color: var(--color-outline-brand);
241
+ }
242
+ .inputgroup .fmx-input-border.border-outline-danger {
243
+ border-color: var(--color-outline-danger);
244
+ }
245
+
246
+ /* Autofill: we only override what applies to the host input (padding, label). Chrome
247
+ * renders the autofill value in Shadow DOM (-internal-input-suggested); we don’t
248
+ * style that, as it’s browser-specific and not reliably styleable. */
249
+ .inputgroup .fmx-input-autofill:-webkit-autofill,
250
+ .inputgroup .fmx-input-autofill:autofill {
251
+ color: var(--color-content-default) !important;
252
+ -webkit-text-fill-color: var(--color-content-default) !important;
253
+ }
254
+ .inputgroup[data-size="sm"] .fmx-input-autofill:-webkit-autofill,
255
+ .inputgroup[data-size="sm"] .fmx-input-autofill:autofill {
256
+ padding-top: 1.25rem;
257
+ padding-bottom: 0.25rem;
258
+ font-size: 16px;
259
+ }
260
+ .inputgroup[data-size="sm"] .fmx-input-autofill:-webkit-autofill ~ label,
261
+ .inputgroup[data-size="sm"] .fmx-input-autofill:autofill ~ label {
262
+ top: 4px;
263
+ left: 0.625rem;
264
+ font-size: 0.75rem;
265
+ font-weight: 700;
266
+ }
267
+ .inputgroup[data-size="md"] .fmx-input-autofill:-webkit-autofill,
268
+ .inputgroup[data-size="md"] .fmx-input-autofill:autofill {
269
+ padding-top: 1.5rem;
270
+ padding-bottom: 0.25rem;
271
+ font-size: 18px;
272
+ }
273
+ .inputgroup[data-size="md"] .fmx-input-autofill:-webkit-autofill ~ label,
274
+ .inputgroup[data-size="md"] .fmx-input-autofill:autofill ~ label {
275
+ top: 6px;
276
+ left: 0.625rem;
277
+ font-size: 0.875rem;
278
+ font-weight: 700;
279
+ }
280
+ .inputgroup[data-size="lg"] .fmx-input-autofill:-webkit-autofill,
281
+ .inputgroup[data-size="lg"] .fmx-input-autofill:autofill {
282
+ padding-top: 1.75rem;
283
+ padding-bottom: 0.25rem;
284
+ font-size: 18px;
285
+ }
286
+ .inputgroup[data-size="lg"] .fmx-input-autofill:-webkit-autofill ~ label,
287
+ .inputgroup[data-size="lg"] .fmx-input-autofill:autofill ~ label {
288
+ top: 8px;
289
+ left: 0.625rem;
290
+ font-size: 0.875rem;
291
+ font-weight: 700;
292
+ }
293
+
236
294
  .icon-scale-enter-active,
237
295
  .icon-scale-leave-active {
238
296
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);