@birdycom/omniaui-vue 0.12.2 → 0.12.3

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/manifest.json CHANGED
@@ -324,6 +324,18 @@
324
324
  "file": "src/components/OcFormField.vue",
325
325
  "snippet": "@birdycom/omniaui/snippets/form-field.html"
326
326
  },
327
+ {
328
+ "name": "OcGlass",
329
+ "kind": "component",
330
+ "file": "src/components/OcGlass.vue",
331
+ "snippet": "@birdycom/omniaui/snippets/glass.html"
332
+ },
333
+ {
334
+ "name": "OcGlassPanel",
335
+ "kind": "component",
336
+ "file": "src/components/OcGlassPanel.vue",
337
+ "snippet": "@birdycom/omniaui/snippets/glass.html"
338
+ },
327
339
  {
328
340
  "name": "OcGreeting",
329
341
  "kind": "component",
@@ -714,6 +726,18 @@
714
726
  "file": "src/components/OcStatCard.vue",
715
727
  "snippet": "@birdycom/omniaui/snippets/stat-card.html"
716
728
  },
729
+ {
730
+ "name": "OcStatus",
731
+ "kind": "component",
732
+ "file": "src/components/OcStatus.vue",
733
+ "snippet": "@birdycom/omniaui/snippets/status-dot.html"
734
+ },
735
+ {
736
+ "name": "OcStatusDot",
737
+ "kind": "component",
738
+ "file": "src/components/OcStatusDot.vue",
739
+ "snippet": "@birdycom/omniaui/snippets/status-dot.html"
740
+ },
717
741
  {
718
742
  "name": "OcStepper",
719
743
  "kind": "component",
@@ -786,6 +810,30 @@
786
810
  "file": "src/components/OcTimeline.vue",
787
811
  "snippet": "@birdycom/omniaui/snippets/timeline.html"
788
812
  },
813
+ {
814
+ "name": "OcTitlebar",
815
+ "kind": "component",
816
+ "file": "src/components/OcTitlebar.vue",
817
+ "snippet": "@birdycom/omniaui/snippets/titlebar.html"
818
+ },
819
+ {
820
+ "name": "OcTitlebarBody",
821
+ "kind": "component",
822
+ "file": "src/components/OcTitlebarBody.vue",
823
+ "snippet": "@birdycom/omniaui/snippets/titlebar.html"
824
+ },
825
+ {
826
+ "name": "OcTitlebarButton",
827
+ "kind": "component",
828
+ "file": "src/components/OcTitlebarButton.vue",
829
+ "snippet": "@birdycom/omniaui/snippets/titlebar.html"
830
+ },
831
+ {
832
+ "name": "OcTitlebarWindow",
833
+ "kind": "component",
834
+ "file": "src/components/OcTitlebarWindow.vue",
835
+ "snippet": "@birdycom/omniaui/snippets/titlebar.html"
836
+ },
789
837
  {
790
838
  "name": "OcToast",
791
839
  "kind": "component",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@birdycom/omniaui-vue",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "OmniaUI for Vue 3: one single-file component per OmniaUI component and block, rendering the exact markup of the CSS packages.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,16 +1,17 @@
1
1
  <script setup lang="ts">
2
- /** Alert. Classes: .oc-alert--info/success/warning/danger. Default slot = description. */
2
+ /** Alert. Classes: .oc-alert--info/success/warning/danger, --inline (compact, under a field). Default slot = description. */
3
3
  withDefaults(
4
4
  defineProps<{
5
5
  variant?: 'info' | 'success' | 'warning' | 'danger'
6
6
  title?: string
7
+ inline?: boolean
7
8
  }>(),
8
9
  { variant: 'info' },
9
10
  )
10
11
  </script>
11
12
 
12
13
  <template>
13
- <div :class="['oc-alert', `oc-alert--${variant}`]" role="status">
14
+ <div :class="['oc-alert', `oc-alert--${variant}`, inline && 'oc-alert--inline']" :role="variant === 'danger' && inline ? 'alert' : 'status'">
14
15
  <h4 v-if="title || $slots.title" class="oc-alert-title"><slot name="title">{{ title }}</slot></h4>
15
16
  <p v-if="$slots.default" class="oc-alert-description"><slot /></p>
16
17
  </div>
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Button. Renders <a> when `href` is set, otherwise <button>.
4
4
  * Classes: .oc-btn + --secondary/--outline/--ghost/--link/--destructive/--success/--gradient/--glass,
5
- * --xs/--sm/--lg, --icon, --pill
5
+ * --xs/--sm/--lg, --icon, --pill, --inline (link button inside running text)
6
6
  */
7
7
  withDefaults(
8
8
  defineProps<{
@@ -10,6 +10,7 @@ withDefaults(
10
10
  size?: 'xs' | 'sm' | 'md' | 'lg'
11
11
  icon?: boolean
12
12
  pill?: boolean
13
+ inline?: boolean
13
14
  href?: string
14
15
  type?: 'button' | 'submit' | 'reset'
15
16
  }>(),
@@ -27,6 +28,7 @@ withDefaults(
27
28
  size !== 'md' && `oc-btn--${size}`,
28
29
  icon && 'oc-btn--icon',
29
30
  pill && 'oc-btn--pill',
31
+ inline && 'oc-btn--inline',
30
32
  ]"
31
33
  >
32
34
  <slot />
@@ -40,6 +42,7 @@ withDefaults(
40
42
  size !== 'md' && `oc-btn--${size}`,
41
43
  icon && 'oc-btn--icon',
42
44
  pill && 'oc-btn--pill',
45
+ inline && 'oc-btn--inline',
43
46
  ]"
44
47
  >
45
48
  <slot />
@@ -0,0 +1,10 @@
1
+ <!-- File: packages/vue/src/components/OcGlass.vue | Map: props (strong, flat, as) -> .oc-glass sheet -> default slot -->
2
+ <script setup lang="ts">
3
+ /** See-through glass sheet with a light top edge; .oc-card inside becomes a glass panel.
4
+ * Classes: .oc-glass + --strong, --flat (desktop window where the OS draws the blur) */
5
+ withDefaults(defineProps<{ strong?: boolean; flat?: boolean; as?: 'div' | 'section' | 'aside' | 'article' | 'main' }>(), { as: 'div' })
6
+ </script>
7
+
8
+ <template>
9
+ <component :is="as" :class="['oc-glass', strong && 'oc-glass--strong', flat && 'oc-glass--flat']"><slot /></component>
10
+ </template>
@@ -0,0 +1,9 @@
1
+ <!-- File: packages/vue/src/components/OcGlassPanel.vue | Map: props (strong) -> div.oc-glass-panel -> default slot -->
2
+ <script setup lang="ts">
3
+ /** A lighter layer inside a glass sheet. Classes: .oc-glass-panel(--strong) */
4
+ defineProps<{ strong?: boolean }>()
5
+ </script>
6
+
7
+ <template>
8
+ <div :class="['oc-glass-panel', strong && 'oc-glass-panel--strong']"><slot /></div>
9
+ </template>
@@ -1,5 +1,7 @@
1
1
  <script setup lang="ts">
2
- /** Progress bar. `value` of `max` (default 100). Classes: .oc-progress-bar--success/warning/danger */
2
+ /** Progress bar. `value` of `max` (default 100). Classes: .oc-progress(--sm/--xs/--glow), .oc-progress-bar--success/warning/danger,
3
+ * .oc-progress-marker. `levels`: warning from 70 %, danger from 90 % (or [warning, danger]); an explicit variant wins.
4
+ * `marker`: a target point in the unit of `value`. */
3
5
  import { computed } from 'vue'
4
6
 
5
7
  const props = withDefaults(
@@ -7,15 +9,33 @@ const props = withDefaults(
7
9
  value: number
8
10
  max?: number
9
11
  variant?: 'default' | 'success' | 'warning' | 'danger'
12
+ size?: 'xs' | 'sm' | 'md'
13
+ glow?: boolean
14
+ levels?: boolean | [number, number]
15
+ marker?: number
10
16
  label?: string
11
17
  }>(),
12
- { max: 100, variant: 'default' },
18
+ { max: 100, variant: 'default', size: 'md', levels: false },
13
19
  )
14
- const percent = computed(() => Math.min(100, Math.max(0, Math.round((props.value / props.max) * 100))))
20
+ const pct = (v: number) => (props.max > 0 ? Math.min(100, Math.max(0, (v / props.max) * 100)) : 0)
21
+ const percent = computed(() => Math.round(pct(props.value)))
22
+ const tone = computed(() => {
23
+ if (props.variant !== 'default' || !props.levels) return props.variant
24
+ const [warn, danger] = props.levels === true ? [70, 90] : props.levels
25
+ return percent.value >= danger ? 'danger' : percent.value >= warn ? 'warning' : 'default'
26
+ })
15
27
  </script>
16
28
 
17
29
  <template>
18
- <div class="oc-progress" role="progressbar" :aria-valuenow="value" aria-valuemin="0" :aria-valuemax="max" :aria-label="label">
19
- <div :class="['oc-progress-bar', variant !== 'default' && `oc-progress-bar--${variant}`]" :style="{ width: `${percent}%` }"></div>
30
+ <div
31
+ :class="['oc-progress', size !== 'md' && `oc-progress--${size}`, glow && 'oc-progress--glow']"
32
+ role="progressbar"
33
+ :aria-valuenow="value"
34
+ aria-valuemin="0"
35
+ :aria-valuemax="max"
36
+ :aria-label="label"
37
+ >
38
+ <div :class="['oc-progress-bar', tone !== 'default' && `oc-progress-bar--${tone}`]" :style="{ width: `${percent}%` }"></div>
39
+ <span v-if="marker != null" class="oc-progress-marker" :style="{ left: `${pct(marker)}%` }"></span>
20
40
  </div>
21
41
  </template>
@@ -2,10 +2,10 @@
2
2
  <script setup lang="ts">
3
3
  /**
4
4
  * Typography for long-form text written without classes (same markup as snippets/prose.html). Slot default = the text
5
- * (put .oc-prose-lead on the intro paragraph); the snippet's demo article when empty. size: sm | md | lg, full = no max width.
6
- * Classes: .oc-prose(--sm/--lg/--full), .oc-prose-lead
5
+ * (put .oc-prose-lead on the intro paragraph); the snippet's demo article when empty. size: compact (widgets, 13 px) | sm | md | lg, full = no max width.
6
+ * Classes: .oc-prose(--compact/--sm/--lg/--full), .oc-prose-lead
7
7
  */
8
- withDefaults(defineProps<{ size?: 'sm' | 'md' | 'lg'; full?: boolean; as?: 'article' | 'div' | 'section' }>(), { size: 'md', as: 'article' })
8
+ withDefaults(defineProps<{ size?: 'compact' | 'sm' | 'md' | 'lg'; full?: boolean; as?: 'article' | 'div' | 'section' }>(), { size: 'md', as: 'article' })
9
9
  </script>
10
10
 
11
11
  <template>
@@ -0,0 +1,16 @@
1
+ <!-- File: packages/vue/src/components/OcStatus.vue | Map: props (tone, meta) -> p.oc-status -> OcStatusDot + __text (slot) + __meta -->
2
+ <script setup lang="ts">
3
+ /** Status row: dot + one line of state text (slot, cuts off with …) + optional meta on the right.
4
+ * Classes: .oc-status, .oc-status__text, .oc-status__meta */
5
+ import OcStatusDot from './OcStatusDot.vue'
6
+
7
+ withDefaults(defineProps<{ tone?: 'default' | 'working' | 'waiting' | 'done' | 'error' | 'idle'; meta?: string }>(), { tone: 'default' })
8
+ </script>
9
+
10
+ <template>
11
+ <p class="oc-status">
12
+ <OcStatusDot :tone="tone" />
13
+ <span class="oc-status__text"><slot /></span>
14
+ <span v-if="meta || $slots.meta" class="oc-status__meta"><slot name="meta">{{ meta }}</slot></span>
15
+ </p>
16
+ </template>
@@ -0,0 +1,18 @@
1
+ <!-- File: packages/vue/src/components/OcStatusDot.vue | Map: props (tone, size, label) -> span.oc-status-dot (role="img" with a label, else aria-hidden) -->
2
+ <script setup lang="ts">
3
+ /** A live state light; --working pulses. With `label` the dot stands alone (role="img"), without it is decoration.
4
+ * Classes: .oc-status-dot + --working/--waiting/--done/--error/--idle, --sm/--lg */
5
+ withDefaults(
6
+ defineProps<{ tone?: 'default' | 'working' | 'waiting' | 'done' | 'error' | 'idle'; size?: 'sm' | 'md' | 'lg'; label?: string }>(),
7
+ { tone: 'default', size: 'md' },
8
+ )
9
+ </script>
10
+
11
+ <template>
12
+ <span
13
+ :class="['oc-status-dot', tone !== 'default' && `oc-status-dot--${tone}`, size !== 'md' && `oc-status-dot--${size}`]"
14
+ :role="label ? 'img' : undefined"
15
+ :aria-label="label"
16
+ :aria-hidden="label ? undefined : 'true'"
17
+ ></span>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ <!-- File: packages/vue/src/components/OcTitlebar.vue | Map: props (title, subtitle, bordered, size) -> header.oc-titlebar -> __main (icon slot, title, subtitle) -> __actions (default slot) -->
2
+ <script setup lang="ts">
3
+ /** Drag area of a frameless desktop window (app-region: drag); buttons in it stay clickable.
4
+ * Slots: icon, title, subtitle, default (the OcTitlebarButton actions).
5
+ * Classes: .oc-titlebar(--bordered/--sm), __main, __icon, __title, __subtitle, __actions */
6
+ withDefaults(defineProps<{ title?: string; subtitle?: string; bordered?: boolean; size?: 'sm' | 'md' }>(), { size: 'md' })
7
+ </script>
8
+
9
+ <template>
10
+ <header :class="['oc-titlebar', bordered && 'oc-titlebar--bordered', size === 'sm' && 'oc-titlebar--sm']">
11
+ <div class="oc-titlebar__main">
12
+ <span v-if="$slots.icon" class="oc-titlebar__icon" aria-hidden="true"><slot name="icon" /></span>
13
+ <span v-if="title || $slots.title" class="oc-titlebar__title"><slot name="title">{{ title }}</slot></span>
14
+ <span v-if="subtitle || $slots.subtitle" class="oc-titlebar__subtitle"><slot name="subtitle">{{ subtitle }}</slot></span>
15
+ </div>
16
+ <div v-if="$slots.default" class="oc-titlebar__actions"><slot /></div>
17
+ </header>
18
+ </template>
@@ -0,0 +1,8 @@
1
+ <!-- File: packages/vue/src/components/OcTitlebarBody.vue | Map: div.oc-titlebar-body -> slot -->
2
+ <script setup lang="ts">
3
+ /** The part of the window that scrolls; the title bar gets its hairline once it does. Class: .oc-titlebar-body */
4
+ </script>
5
+
6
+ <template>
7
+ <div class="oc-titlebar-body"><slot /></div>
8
+ </template>
@@ -0,0 +1,10 @@
1
+ <!-- File: packages/vue/src/components/OcTitlebarButton.vue | Map: props (label, close) -> button.oc-titlebar__btn -> slot (icon) -->
2
+ <script setup lang="ts">
3
+ /** Compact icon button in the title bar; `label` names it for screen readers, `close` turns it red on hover.
4
+ * Classes: .oc-titlebar__btn(--close) */
5
+ defineProps<{ label: string; close?: boolean }>()
6
+ </script>
7
+
8
+ <template>
9
+ <button type="button" :class="['oc-titlebar__btn', close && 'oc-titlebar__btn--close']" :aria-label="label" :title="label"><slot /></button>
10
+ </template>
@@ -0,0 +1,8 @@
1
+ <!-- File: packages/vue/src/components/OcTitlebarWindow.vue | Map: div.oc-titlebar-window -> slot (OcTitlebar + OcTitlebarBody) -->
2
+ <script setup lang="ts">
3
+ /** Column around the title bar and the body, so the bar sees the body scroll. Class: .oc-titlebar-window */
4
+ </script>
5
+
6
+ <template>
7
+ <div class="oc-titlebar-window"><slot /></div>
8
+ </template>
package/src/index.ts CHANGED
@@ -55,6 +55,8 @@ import OcFactList from './components/OcFactList.vue'
55
55
  import OcFilterCounts from './components/OcFilterCounts.vue'
56
56
  import OcFlipCard from './components/OcFlipCard.vue'
57
57
  import OcFormField from './components/OcFormField.vue'
58
+ import OcGlass from './components/OcGlass.vue'
59
+ import OcGlassPanel from './components/OcGlassPanel.vue'
58
60
  import OcGreeting from './components/OcGreeting.vue'
59
61
  import OcHeading from './components/OcHeading.vue'
60
62
  import OcHoverCard from './components/OcHoverCard.vue'
@@ -120,6 +122,8 @@ import OcSpinner from './components/OcSpinner.vue'
120
122
  import OcStackCard from './components/OcStackCard.vue'
121
123
  import OcStackList from './components/OcStackList.vue'
122
124
  import OcStatCard from './components/OcStatCard.vue'
125
+ import OcStatus from './components/OcStatus.vue'
126
+ import OcStatusDot from './components/OcStatusDot.vue'
123
127
  import OcStepper from './components/OcStepper.vue'
124
128
  import OcSwitch from './components/OcSwitch.vue'
125
129
  import OcTable from './components/OcTable.vue'
@@ -132,6 +136,10 @@ import OcTextarea from './components/OcTextarea.vue'
132
136
  import OcThemeSwitch from './components/OcThemeSwitch.vue'
133
137
  import OcTimeInput from './components/OcTimeInput.vue'
134
138
  import OcTimeline from './components/OcTimeline.vue'
139
+ import OcTitlebar from './components/OcTitlebar.vue'
140
+ import OcTitlebarBody from './components/OcTitlebarBody.vue'
141
+ import OcTitlebarButton from './components/OcTitlebarButton.vue'
142
+ import OcTitlebarWindow from './components/OcTitlebarWindow.vue'
135
143
  import OcToast from './components/OcToast.vue'
136
144
  import OcToastContainer from './components/OcToastContainer.vue'
137
145
  import OcToggle from './components/OcToggle.vue'
@@ -232,6 +240,8 @@ export {
232
240
  OcFilterCounts,
233
241
  OcFlipCard,
234
242
  OcFormField,
243
+ OcGlass,
244
+ OcGlassPanel,
235
245
  OcGreeting,
236
246
  OcHeading,
237
247
  OcHoverCard,
@@ -297,6 +307,8 @@ export {
297
307
  OcStackCard,
298
308
  OcStackList,
299
309
  OcStatCard,
310
+ OcStatus,
311
+ OcStatusDot,
300
312
  OcStepper,
301
313
  OcSwitch,
302
314
  OcTable,
@@ -309,6 +321,10 @@ export {
309
321
  OcThemeSwitch,
310
322
  OcTimeInput,
311
323
  OcTimeline,
324
+ OcTitlebar,
325
+ OcTitlebarBody,
326
+ OcTitlebarButton,
327
+ OcTitlebarWindow,
312
328
  OcToast,
313
329
  OcToastContainer,
314
330
  OcToggle,
@@ -465,6 +481,8 @@ export const components: Record<string, Component> = {
465
481
  OcFilterCounts,
466
482
  OcFlipCard,
467
483
  OcFormField,
484
+ OcGlass,
485
+ OcGlassPanel,
468
486
  OcGreeting,
469
487
  OcHeading,
470
488
  OcHoverCard,
@@ -530,6 +548,8 @@ export const components: Record<string, Component> = {
530
548
  OcStackCard,
531
549
  OcStackList,
532
550
  OcStatCard,
551
+ OcStatus,
552
+ OcStatusDot,
533
553
  OcStepper,
534
554
  OcSwitch,
535
555
  OcTable,
@@ -542,6 +562,10 @@ export const components: Record<string, Component> = {
542
562
  OcThemeSwitch,
543
563
  OcTimeInput,
544
564
  OcTimeline,
565
+ OcTitlebar,
566
+ OcTitlebarBody,
567
+ OcTitlebarButton,
568
+ OcTitlebarWindow,
545
569
  OcToast,
546
570
  OcToastContainer,
547
571
  OcToggle,