@meistrari/tela-build 1.36.0 → 1.38.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,5 +1,6 @@
1
1
  <script setup lang="ts">
2
- import type { TelaCustomIconName } from '../../../types'
2
+ import type { TelaCustomIconName } from '@meistrari/tela-build/types'
3
+
3
4
  import { Motion } from 'motion-v'
4
5
 
5
6
  const props = withDefaults(defineProps<{
@@ -14,6 +15,10 @@ const props = withDefaults(defineProps<{
14
15
  })
15
16
 
16
17
  const colorValue = computed(() => {
18
+ if (props.color.startsWith('#')) {
19
+ return props.color
20
+ }
21
+
17
22
  const [colorName, shade] = props.color.split('-')
18
23
  const colors = DT.colors as Record<string, any>
19
24
 
@@ -360,5 +365,10 @@ const colorValue = computed(() => {
360
365
  <path d="M0.805054 0.805054L3.34137 3.34137C4.54019 4.54019 4.60421 6.46316 3.4878 7.73906L0.805054 10.8051" stroke="currentColor" stroke-width="1.61015" stroke-linecap="round" />
361
366
  </g>
362
367
  </template>
368
+
369
+ <template v-if="name === 'quarter-slice'">
370
+ <path d="M12 6C12 9.31371 9.31371 12 6 12C2.68629 12 0 9.31371 0 6C0 2.68629 2.68629 0 6 0C9.31371 0 12 2.68629 12 6ZM1.2 6C1.2 8.65097 3.34903 10.8 6 10.8C8.65097 10.8 10.8 8.65097 10.8 6C10.8 3.34903 8.65097 1.2 6 1.2C3.34903 1.2 1.2 3.34903 1.2 6Z" fill="currentColor" />
371
+ <path d="M2.5 6C2.5 6.69223 2.70527 7.36892 3.08986 7.9445C3.47444 8.52007 4.02107 8.96867 4.66061 9.23358C5.30015 9.49848 6.00388 9.5678 6.68282 9.43275C7.36175 9.2977 7.98539 8.96436 8.47487 8.47487C8.96436 7.98539 9.2977 7.36175 9.43275 6.68282C9.5678 6.00388 9.49849 5.30015 9.23358 4.66061C8.96867 4.02107 8.52007 3.47444 7.9445 3.08986C7.36892 2.70527 6.69224 2.5 6 2.5L6 6L2.5 6Z" fill="currentColor" />
372
+ </template>
363
373
  </svg>
364
374
  </template>
@@ -9,8 +9,9 @@ A status component that displays different workflow and task statuses with appro
9
9
 
10
10
  ## Rules
11
11
 
12
- - **Always** use `<TelaStatus />` for any status indicator (workflow status, event status, health state, etc.). Never build a custom status with icons + color classes.
13
12
  - `text-success` and `text-error` are reserved for `<TelaStatus />` — never apply them to regular text content.
13
+ - **Always** use `<TelaStatus />` for any status indicator (workflow status, event status, health state, etc.). Never build a custom status with icons + color classes.
14
+ - **NEVER** use the `config` prop. It exists as an escape hatch for domain-specific variants in consuming apps (hex colors, localized labels, etc.). Always prefer an existing `variant` — if none fits, extend the built-in variant list instead of passing `config`. One-off `config` objects defeat the design system.
14
15
 
15
16
  ## Examples
16
17
 
@@ -13,6 +13,7 @@ type StatusConfig = {
13
13
 
14
14
  const props = withDefaults(defineProps<{
15
15
  variant?: TelaStatusVariant
16
+ config?: StatusConfig
16
17
  label?: string
17
18
  isIconAnimated?: boolean
18
19
  isIconHidden?: boolean
@@ -293,6 +294,9 @@ const variantConfig: Record<TelaStatusVariant, StatusConfig> = {
293
294
  }
294
295
 
295
296
  const currentStatus = computed<StatusConfig>(() => {
297
+ if (props.config)
298
+ return props.config
299
+
296
300
  const variant = props.variant ?? 'running'
297
301
 
298
302
  return variantConfig[variant] ?? variantConfig.running
@@ -334,7 +338,7 @@ function measureContentWidth() {
334
338
  }
335
339
 
336
340
  watch(
337
- () => [props.variant, statusLabel.value, props.isIconHidden],
341
+ () => [props.variant, props.config, statusLabel.value, props.isIconHidden],
338
342
  measureContentWidth,
339
343
  { immediate: true },
340
344
  )
@@ -358,7 +362,7 @@ const shineClass = computed(() => {
358
362
  ]
359
363
  })
360
364
 
361
- const isShineVisible = computed(() => ['running', 'executing', 'processing', 'verifying', 'initializing', 'reviewing'].includes(props.variant))
365
+ const isShineVisible = computed(() => !props.config && ['running', 'executing', 'processing', 'verifying', 'initializing', 'reviewing'].includes(props.variant))
362
366
 
363
367
  function iconVariants() {
364
368
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.36.0",
3
+ "version": "1.38.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",
@@ -1 +1 @@
1
- export type TelaCustomIconName = 'circle' | 'pause' | 'queued' | 'close' | 'circle-notch' | 'circle-minus' | 'stop' | 'circle-dashed' | 'warning' | 'check' | 'check-dashed' | 'semi-circle' | 'arrow-down' | 'reported' | 'circle-warning' | 'slice' | 'half-slice' | 'knot' | 'timeline-dot' | 'timeline-start' | 'level-right'
1
+ export type TelaCustomIconName = 'circle' | 'pause' | 'queued' | 'close' | 'circle-notch' | 'circle-minus' | 'stop' | 'circle-dashed' | 'warning' | 'check' | 'check-dashed' | 'semi-circle' | 'arrow-down' | 'reported' | 'circle-warning' | 'slice' | 'half-slice' | 'knot' | 'timeline-dot' | 'timeline-start' | 'level-right' | 'quarter-slice'