@7pmlabs/design-system 2.0.9 → 2.1.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.
- package/README.md +4 -4
- package/dist/design-system.css +1 -1
- package/dist/design-system.js +65 -59
- package/dist/design-system100.js +1 -1
- package/dist/design-system100.js.map +1 -1
- package/dist/design-system101.js +87 -53
- package/dist/design-system101.js.map +1 -1
- package/dist/design-system103.js +5 -13
- package/dist/design-system103.js.map +1 -1
- package/dist/design-system104.js +53 -108
- package/dist/design-system104.js.map +1 -1
- package/dist/{design-system102.js → design-system105.js} +1 -1
- package/dist/{design-system102.js.map → design-system105.js.map} +1 -1
- package/dist/design-system106.js +13 -6
- package/dist/design-system106.js.map +1 -1
- package/dist/design-system107.js +93 -190
- package/dist/design-system107.js.map +1 -1
- package/dist/design-system109.js +2 -2
- package/dist/design-system109.js.map +1 -1
- package/dist/design-system110.js +183 -484
- package/dist/design-system110.js.map +1 -1
- package/dist/design-system112.js +5 -4
- package/dist/design-system112.js.map +1 -1
- package/dist/design-system113.js +507 -7
- package/dist/design-system113.js.map +1 -1
- package/dist/design-system115.js +8 -0
- package/dist/design-system115.js.map +1 -0
- package/dist/design-system116.js +7 -6
- package/dist/design-system116.js.map +1 -1
- package/dist/design-system117.js +154 -169
- package/dist/design-system117.js.map +1 -1
- package/dist/design-system119.js +2 -2
- package/dist/design-system119.js.map +1 -1
- package/dist/design-system120.js +210 -149
- package/dist/design-system120.js.map +1 -1
- package/dist/design-system122.js +5 -4
- package/dist/design-system122.js.map +1 -1
- package/dist/design-system123.js +160 -9
- package/dist/design-system123.js.map +1 -1
- package/dist/design-system125.js +8 -0
- package/dist/design-system125.js.map +1 -0
- package/dist/design-system126.js +176 -6
- package/dist/design-system126.js.map +1 -1
- package/dist/design-system128.js +8 -0
- package/dist/design-system128.js.map +1 -0
- package/dist/design-system129.js +213 -5
- package/dist/design-system129.js.map +1 -1
- package/dist/design-system131.js +5 -90
- package/dist/design-system131.js.map +1 -1
- package/dist/design-system132.js +166 -0
- package/dist/design-system132.js.map +1 -0
- package/dist/design-system134.js +5 -42
- package/dist/design-system134.js.map +1 -1
- package/dist/design-system135.js +12 -0
- package/dist/design-system135.js.map +1 -0
- package/dist/design-system136.js +274 -5
- package/dist/design-system136.js.map +1 -1
- package/dist/design-system138.js +9 -0
- package/dist/{design-system124.js.map → design-system138.js.map} +1 -1
- package/dist/design-system139.js +16 -5
- package/dist/design-system139.js.map +1 -1
- package/dist/design-system141.js +8 -0
- package/dist/{design-system127.js.map → design-system141.js.map} +1 -1
- package/dist/design-system142.js +12 -5
- package/dist/design-system142.js.map +1 -1
- package/dist/design-system143.js +78 -83
- package/dist/design-system143.js.map +1 -1
- package/dist/design-system145.js +1 -1
- package/dist/design-system145.js.map +1 -1
- package/dist/design-system146.js +42 -9
- package/dist/design-system146.js.map +1 -1
- package/dist/design-system148.js +3 -2
- package/dist/design-system148.js.map +1 -1
- package/dist/design-system149.js +230 -18
- package/dist/design-system149.js.map +1 -1
- package/dist/design-system151.js +5 -158
- package/dist/design-system151.js.map +1 -1
- package/dist/{design-system140.js → design-system152.js} +6 -6
- package/dist/{design-system140.js.map → design-system152.js.map} +1 -1
- package/dist/design-system154.js +5 -307
- package/dist/design-system154.js.map +1 -1
- package/dist/design-system155.js +98 -0
- package/dist/design-system155.js.map +1 -0
- package/dist/design-system157.js +5 -240
- package/dist/design-system157.js.map +1 -1
- package/dist/design-system158.js +12 -0
- package/dist/design-system158.js.map +1 -0
- package/dist/design-system159.js +37 -5
- package/dist/design-system159.js.map +1 -1
- package/dist/design-system160.js +4 -189
- package/dist/design-system160.js.map +1 -1
- package/dist/design-system161.js +24 -0
- package/dist/{design-system150.js.map → design-system161.js.map} +1 -1
- package/dist/design-system162.js +2 -3
- package/dist/design-system162.js.map +1 -1
- package/dist/design-system163.js +158 -3
- package/dist/design-system163.js.map +1 -1
- package/dist/{design-system153.js → design-system165.js} +2 -2
- package/dist/{design-system153.js.map → design-system165.js.map} +1 -1
- package/dist/design-system166.js +307 -6
- package/dist/design-system166.js.map +1 -1
- package/dist/{design-system156.js → design-system168.js} +2 -2
- package/dist/{design-system156.js.map → design-system168.js.map} +1 -1
- package/dist/design-system169.js +167 -6
- package/dist/design-system169.js.map +1 -1
- package/dist/design-system171.js +8 -0
- package/dist/design-system171.js.map +1 -0
- package/dist/design-system172.js +240 -6
- package/dist/design-system172.js.map +1 -1
- package/dist/design-system174.js +8 -0
- package/dist/design-system174.js.map +1 -0
- package/dist/design-system175.js +189 -6
- package/dist/design-system175.js.map +1 -1
- package/dist/design-system177.js +8 -0
- package/dist/design-system177.js.map +1 -0
- package/dist/design-system178.js +3 -5
- package/dist/design-system178.js.map +1 -1
- package/dist/design-system179.js +58 -11
- package/dist/design-system179.js.map +1 -1
- package/dist/design-system181.js +9 -0
- package/dist/design-system181.js.map +1 -0
- package/dist/design-system182.js +56 -6
- package/dist/design-system182.js.map +1 -1
- package/dist/design-system184.js +9 -0
- package/dist/{design-system167.js.map → design-system184.js.map} +1 -1
- package/dist/design-system185.js +69 -5
- package/dist/design-system185.js.map +1 -1
- package/dist/design-system187.js +9 -0
- package/dist/{design-system170.js.map → design-system187.js.map} +1 -1
- package/dist/design-system188.js +182 -5
- package/dist/design-system188.js.map +1 -1
- package/dist/design-system190.js +9 -0
- package/dist/design-system190.js.map +1 -0
- package/dist/design-system191.js +115 -5
- package/dist/design-system191.js.map +1 -1
- package/dist/design-system193.js +8 -0
- package/dist/{design-system176.js.map → design-system193.js.map} +1 -1
- package/dist/design-system194.js +11 -5
- package/dist/design-system194.js.map +1 -1
- package/dist/design-system195.js +453 -24
- package/dist/design-system195.js.map +1 -1
- package/dist/design-system197.js +5 -4
- package/dist/design-system197.js.map +1 -1
- package/dist/design-system198.js +20 -16
- package/dist/design-system198.js.map +1 -1
- package/dist/design-system200.js +1 -1
- package/dist/design-system200.js.map +1 -1
- package/dist/design-system201.js +70 -314
- package/dist/design-system201.js.map +1 -1
- package/dist/design-system203.js +1 -1
- package/dist/design-system203.js.map +1 -1
- package/dist/design-system204.js +24 -89
- package/dist/design-system204.js.map +1 -1
- package/dist/design-system206.js +1 -1
- package/dist/design-system206.js.map +1 -1
- package/dist/design-system207.js +26 -17
- package/dist/design-system207.js.map +1 -1
- package/dist/design-system209.js +5 -3
- package/dist/design-system209.js.map +1 -1
- package/dist/design-system210.js +22 -408
- package/dist/design-system210.js.map +1 -1
- package/dist/design-system212.js +1 -1
- package/dist/design-system212.js.map +1 -1
- package/dist/design-system213.js +24 -52
- package/dist/design-system213.js.map +1 -1
- package/dist/design-system215.js +1 -1
- package/dist/design-system215.js.map +1 -1
- package/dist/design-system216.js +329 -85
- package/dist/design-system216.js.map +1 -1
- package/dist/design-system218.js +5 -108
- package/dist/design-system218.js.map +1 -1
- package/dist/design-system219.js +103 -0
- package/dist/design-system219.js.map +1 -0
- package/dist/design-system221.js +5 -106
- package/dist/design-system221.js.map +1 -1
- package/dist/design-system222.js +22 -0
- package/dist/{design-system208.js.map → design-system222.js.map} +1 -1
- package/dist/design-system223.js +4 -6
- package/dist/design-system223.js.map +1 -1
- package/dist/design-system224.js +3 -737
- package/dist/design-system224.js.map +1 -1
- package/dist/design-system225.js +422 -0
- package/dist/design-system225.js.map +1 -0
- package/dist/design-system227.js +5 -11
- package/dist/design-system227.js.map +1 -1
- package/dist/design-system228.js +51 -517
- package/dist/design-system228.js.map +1 -1
- package/dist/design-system230.js +1 -1
- package/dist/design-system230.js.map +1 -1
- package/dist/design-system231.js +88 -3
- package/dist/design-system231.js.map +1 -1
- package/dist/design-system232.js +4 -46
- package/dist/design-system232.js.map +1 -1
- package/dist/design-system233.js +108 -4
- package/dist/design-system233.js.map +1 -1
- package/dist/{design-system220.js → design-system235.js} +2 -2
- package/dist/{design-system220.js.map → design-system235.js.map} +1 -1
- package/dist/design-system236.js +106 -5
- package/dist/design-system236.js.map +1 -1
- package/dist/design-system238.js +9 -0
- package/dist/design-system238.js.map +1 -0
- package/dist/design-system239.js +737 -5
- package/dist/design-system239.js.map +1 -1
- package/dist/{design-system226.js → design-system241.js} +2 -2
- package/dist/{design-system226.js.map → design-system241.js.map} +1 -1
- package/dist/design-system242.js +3 -5
- package/dist/design-system242.js.map +1 -1
- package/dist/design-system243.js +42 -50
- package/dist/design-system243.js.map +1 -1
- package/dist/design-system244.js +1 -1
- package/dist/design-system244.js.map +1 -1
- package/dist/design-system245.js +254 -141
- package/dist/design-system245.js.map +1 -1
- package/dist/design-system247.js +1 -1
- package/dist/design-system247.js.map +1 -1
- package/dist/design-system248.js +119 -7
- package/dist/design-system248.js.map +1 -1
- package/dist/design-system250.js +8 -0
- package/dist/design-system250.js.map +1 -0
- package/dist/design-system251.js +172 -5
- package/dist/design-system251.js.map +1 -1
- package/dist/design-system253.js +8 -0
- package/dist/design-system253.js.map +1 -0
- package/dist/design-system254.js +11 -6
- package/dist/design-system254.js.map +1 -1
- package/dist/design-system255.js +525 -9
- package/dist/design-system255.js.map +1 -1
- package/dist/design-system257.js +8 -0
- package/dist/design-system257.js.map +1 -0
- package/dist/design-system258.js +112 -6
- package/dist/design-system258.js.map +1 -1
- package/dist/design-system260.js +5 -374
- package/dist/design-system260.js.map +1 -1
- package/dist/design-system261.js +57 -0
- package/dist/design-system261.js.map +1 -0
- package/dist/design-system262.js +4 -6
- package/dist/design-system262.js.map +1 -1
- package/dist/design-system263.js +173 -0
- package/dist/design-system263.js.map +1 -0
- package/dist/design-system265.js +8 -0
- package/dist/design-system265.js.map +1 -0
- package/dist/design-system266.js +10 -0
- package/dist/design-system266.js.map +1 -0
- package/dist/{design-system249.js → design-system267.js} +2 -2
- package/dist/{design-system249.js.map → design-system267.js.map} +1 -1
- package/dist/design-system269.js +8 -0
- package/dist/design-system269.js.map +1 -0
- package/dist/{design-system252.js → design-system270.js} +1 -1
- package/dist/{design-system252.js.map → design-system270.js.map} +1 -1
- package/dist/design-system272.js +9 -0
- package/dist/design-system272.js.map +1 -0
- package/dist/design-system273.js +12 -0
- package/dist/design-system273.js.map +1 -0
- package/dist/{design-system256.js → design-system274.js} +2 -2
- package/dist/{design-system256.js.map → design-system274.js.map} +1 -1
- package/dist/design-system276.js +9 -0
- package/dist/design-system276.js.map +1 -0
- package/dist/{design-system259.js → design-system277.js} +1 -1
- package/dist/{design-system259.js.map → design-system277.js.map} +1 -1
- package/dist/design-system278.js +377 -0
- package/dist/design-system278.js.map +1 -0
- package/dist/design-system280.js +9 -0
- package/dist/design-system280.js.map +1 -0
- package/dist/design-system69.js +182 -13
- package/dist/design-system69.js.map +1 -1
- package/dist/design-system71.js +8 -0
- package/dist/design-system71.js.map +1 -0
- package/dist/design-system72.js +13 -5
- package/dist/design-system72.js.map +1 -1
- package/dist/design-system73.js +677 -139
- package/dist/design-system73.js.map +1 -1
- package/dist/design-system75.js +1 -1
- package/dist/design-system75.js.map +1 -1
- package/dist/design-system76.js +152 -23
- package/dist/design-system76.js.map +1 -1
- package/dist/design-system78.js +5 -49
- package/dist/design-system78.js.map +1 -1
- package/dist/design-system79.js +32 -0
- package/dist/design-system79.js.map +1 -0
- package/dist/design-system80.js +2 -3
- package/dist/design-system80.js.map +1 -1
- package/dist/design-system81.js +38 -188
- package/dist/design-system81.js.map +1 -1
- package/dist/design-system83.js +1 -1
- package/dist/design-system83.js.map +1 -1
- package/dist/design-system84.js +199 -7
- package/dist/design-system84.js.map +1 -1
- package/dist/design-system86.js +8 -0
- package/dist/design-system86.js.map +1 -0
- package/dist/design-system87.js +7 -5
- package/dist/design-system87.js.map +1 -1
- package/dist/design-system88.js +264 -48
- package/dist/design-system88.js.map +1 -1
- package/dist/design-system90.js +1 -1
- package/dist/design-system90.js.map +1 -1
- package/dist/design-system91.js +57 -11
- package/dist/design-system91.js.map +1 -1
- package/dist/design-system93.js +8 -0
- package/dist/design-system93.js.map +1 -0
- package/dist/design-system94.js +11 -5
- package/dist/design-system94.js.map +1 -1
- package/dist/design-system95.js +92 -59
- package/dist/design-system95.js.map +1 -1
- package/dist/design-system97.js +1 -1
- package/dist/design-system97.js.map +1 -1
- package/dist/design-system98.js +56 -78
- package/dist/design-system98.js.map +1 -1
- package/dist/types/components/BContextMenu/BContextMenu.spec.d.ts +1 -0
- package/dist/types/components/BContextMenu/BContextMenu.vue.d.ts +42 -0
- package/dist/types/components/BContextMenu/index.d.ts +2 -0
- package/dist/types/components/BContextMenu/types.d.ts +23 -0
- package/dist/types/components/BInputTags/BInputTags.spec.d.ts +1 -0
- package/dist/types/components/BInputTags/BInputTags.vue.d.ts +54 -0
- package/dist/types/components/BInputTags/index.d.ts +1 -0
- package/dist/types/components/BLink/BLink.spec.d.ts +1 -0
- package/dist/types/components/BLink/BLink.vue.d.ts +100 -0
- package/dist/types/components/BLink/index.d.ts +1 -0
- package/dist/types/components/BListbox/BListbox.spec.d.ts +1 -0
- package/dist/types/components/BListbox/BListbox.vue.d.ts +52 -0
- package/dist/types/components/BListbox/index.d.ts +1 -0
- package/dist/types/components/BModal/BModal.spec.d.ts +1 -0
- package/dist/types/components/BPinInput/BPinInput.spec.d.ts +1 -0
- package/dist/types/components/BPinInput/BPinInput.vue.d.ts +43 -0
- package/dist/types/components/BPinInput/index.d.ts +1 -0
- package/dist/types/components/BProgress/BProgress.vue.d.ts +47 -2
- package/dist/types/components/BTextarea/BTextarea.spec.d.ts +1 -0
- package/dist/types/components/BTextarea/BTextarea.vue.d.ts +77 -0
- package/dist/types/components/BTextarea/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +7 -1
- package/package.json +1 -1
- package/dist/design-system114.js +0 -212
- package/dist/design-system114.js.map +0 -1
- package/dist/design-system124.js +0 -277
- package/dist/design-system127.js +0 -19
- package/dist/design-system130.js +0 -15
- package/dist/design-system130.js.map +0 -1
- package/dist/design-system133.js +0 -8
- package/dist/design-system133.js.map +0 -1
- package/dist/design-system137.js +0 -236
- package/dist/design-system137.js.map +0 -1
- package/dist/design-system147.js +0 -40
- package/dist/design-system147.js.map +0 -1
- package/dist/design-system150.js +0 -7
- package/dist/design-system164.js +0 -61
- package/dist/design-system164.js.map +0 -1
- package/dist/design-system167.js +0 -59
- package/dist/design-system170.js +0 -72
- package/dist/design-system173.js +0 -185
- package/dist/design-system173.js.map +0 -1
- package/dist/design-system176.js +0 -118
- package/dist/design-system180.js +0 -465
- package/dist/design-system180.js.map +0 -1
- package/dist/design-system183.js +0 -38
- package/dist/design-system183.js.map +0 -1
- package/dist/design-system186.js +0 -91
- package/dist/design-system186.js.map +0 -1
- package/dist/design-system189.js +0 -38
- package/dist/design-system189.js.map +0 -1
- package/dist/design-system192.js +0 -31
- package/dist/design-system192.js.map +0 -1
- package/dist/design-system208.js +0 -7
- package/dist/design-system217.js +0 -7
- package/dist/design-system217.js.map +0 -1
- package/dist/design-system234.js +0 -286
- package/dist/design-system234.js.map +0 -1
- package/dist/design-system237.js +0 -122
- package/dist/design-system237.js.map +0 -1
- package/dist/design-system240.js +0 -115
- package/dist/design-system240.js.map +0 -1
- package/dist/design-system70.js +0 -699
- package/dist/design-system70.js.map +0 -1
- package/dist/design-system77.js +0 -7
- package/dist/design-system77.js.map +0 -1
- package/dist/design-system85.js +0 -276
- package/dist/design-system85.js.map +0 -1
- package/dist/design-system92.js +0 -102
- package/dist/design-system92.js.map +0 -1
package/dist/design-system76.js
CHANGED
|
@@ -1,32 +1,161 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/components/BDescriptions/
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, normalizeClass as c, normalizeStyle as l, openBlock as u, renderList as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, useSlots as h } from "vue";
|
|
2
|
+
//#region src/components/BDescriptions/BDescriptions.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var g = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "b-descriptions__header"
|
|
6
|
+
}, _ = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "b-descriptions__title"
|
|
9
|
+
}, v = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "b-descriptions__extra"
|
|
12
|
+
}, y = { class: "b-descriptions__body" }, b = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "b-descriptions__table",
|
|
15
|
+
role: "presentation"
|
|
16
|
+
}, x = ["colspan"], S = { class: "b-descriptions__row" }, C = ["colspan"], w = { class: "b-descriptions__row" }, T = ["colspan"], E = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "b-descriptions__table",
|
|
19
|
+
role: "presentation"
|
|
20
|
+
}, D = ["colspan"], O = { class: "b-descriptions__row" }, k = ["colspan"], A = { class: "b-descriptions__row" }, j = ["colspan"], M = /* @__PURE__ */ s({
|
|
21
|
+
__name: "BDescriptions",
|
|
5
22
|
props: {
|
|
6
|
-
|
|
7
|
-
|
|
23
|
+
bordered: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
colon: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !0
|
|
30
|
+
},
|
|
31
|
+
column: { default: 3 },
|
|
32
|
+
layout: { default: "horizontal" },
|
|
33
|
+
size: { default: "default" },
|
|
34
|
+
title: {},
|
|
35
|
+
extra: {},
|
|
36
|
+
items: {},
|
|
8
37
|
labelStyle: {},
|
|
9
38
|
contentStyle: {}
|
|
10
39
|
},
|
|
11
|
-
setup(
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
setup(s) {
|
|
41
|
+
let M = h(), N = t(() => !!(s.title || M.title || s.extra || M.extra)), P = t(() => ["b-descriptions", {
|
|
42
|
+
"b-descriptions--bordered": s.bordered,
|
|
43
|
+
"b-descriptions--vertical": s.layout === "vertical",
|
|
44
|
+
"b-descriptions--horizontal": s.layout === "horizontal",
|
|
45
|
+
"b-descriptions--middle": s.size === "middle",
|
|
46
|
+
"b-descriptions--small": s.size === "small",
|
|
47
|
+
"b-descriptions--colon": s.colon
|
|
48
|
+
}]), F = t(() => {
|
|
49
|
+
if (s.items && s.items.length > 0) return s.items.map((e) => ({
|
|
50
|
+
label: e.label,
|
|
51
|
+
children: e.children,
|
|
52
|
+
span: e.span ?? 1,
|
|
53
|
+
labelStyle: e.labelStyle,
|
|
54
|
+
contentStyle: e.contentStyle
|
|
55
|
+
}));
|
|
56
|
+
let t = M.default?.();
|
|
57
|
+
if (!t) return [];
|
|
58
|
+
let n = [];
|
|
59
|
+
function r(t) {
|
|
60
|
+
for (let i of t) {
|
|
61
|
+
if (i.type === e) {
|
|
62
|
+
Array.isArray(i.children) && r(i.children);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
let t = i.props || {}, a = i.children, o = a?.label?.(), s = a?.default?.();
|
|
66
|
+
n.push({
|
|
67
|
+
label: t.label,
|
|
68
|
+
span: t.span ?? 1,
|
|
69
|
+
labelStyle: t.labelStyle,
|
|
70
|
+
contentStyle: t.contentStyle,
|
|
71
|
+
labelSlot: o ? Array.isArray(o) ? o : [o] : void 0,
|
|
72
|
+
contentSlot: s ? Array.isArray(s) ? s : [s] : void 0
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return r(t), n;
|
|
77
|
+
}), I = t(() => {
|
|
78
|
+
let e = [], t = { items: [] }, n = 0;
|
|
79
|
+
for (let r = 0; r < F.value.length; r++) {
|
|
80
|
+
let i = F.value[r], a = r === F.value.length - 1, o = Math.min(i.span, s.column);
|
|
81
|
+
if (n + o > s.column && t.items.length > 0) {
|
|
82
|
+
let r = t.items[t.items.length - 1];
|
|
83
|
+
r.effectiveSpan += s.column - n, e.push(t), t = { items: [] }, n = 0;
|
|
84
|
+
}
|
|
85
|
+
a && (o = s.column - n), t.items.push({
|
|
86
|
+
...i,
|
|
87
|
+
effectiveSpan: o
|
|
88
|
+
}), n += o, n >= s.column && (e.push(t), t = { items: [] }, n = 0);
|
|
89
|
+
}
|
|
90
|
+
if (t.items.length > 0) {
|
|
91
|
+
let r = t.items[t.items.length - 1];
|
|
92
|
+
r.effectiveSpan += s.column - n, e.push(t);
|
|
93
|
+
}
|
|
94
|
+
return e;
|
|
95
|
+
});
|
|
96
|
+
function L(e) {
|
|
97
|
+
if (!(!s.labelStyle && !e.labelStyle)) return {
|
|
98
|
+
...s.labelStyle,
|
|
99
|
+
...e.labelStyle
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function R(e) {
|
|
103
|
+
if (!(!s.contentStyle && !e.contentStyle)) return {
|
|
104
|
+
...s.contentStyle,
|
|
105
|
+
...e.contentStyle
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return (t, h) => (u(), i("div", { class: c(P.value) }, [N.value ? (u(), i("div", g, [s.title || t.$slots.title ? (u(), i("div", _, [f(t.$slots, "title", {}, () => [o(m(s.title), 1)])])) : r("", !0), s.extra || t.$slots.extra ? (u(), i("div", v, [f(t.$slots, "extra", {}, () => [o(m(s.extra), 1)])])) : r("", !0)])) : r("", !0), a("div", y, [s.bordered ? (u(), i("table", b, [a("tbody", null, [s.layout === "horizontal" ? (u(!0), i(e, { key: 0 }, d(I.value, (t, r) => (u(), i("tr", {
|
|
109
|
+
key: r,
|
|
110
|
+
class: "b-descriptions__row"
|
|
111
|
+
}, [(u(!0), i(e, null, d(t.items, (t, r) => (u(), i(e, { key: r }, [a("th", {
|
|
112
|
+
class: "b-descriptions__item-label b-descriptions__item-label--bordered",
|
|
113
|
+
style: l(L(t))
|
|
114
|
+
}, [t.labelSlot && t.labelSlot.length ? (u(), n(p(() => t.labelSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.label), 1)], 64))], 4), a("td", {
|
|
115
|
+
class: "b-descriptions__item-content b-descriptions__item-content--bordered",
|
|
116
|
+
colspan: t.effectiveSpan * 2 - 1,
|
|
117
|
+
style: l(R(t))
|
|
118
|
+
}, [t.contentSlot && t.contentSlot.length ? (u(), n(p(() => t.contentSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.children), 1)], 64))], 12, x)], 64))), 128))]))), 128)) : (u(!0), i(e, { key: 1 }, d(I.value, (t, r) => (u(), i(e, { key: r }, [a("tr", S, [(u(!0), i(e, null, d(t.items, (t, r) => (u(), i("th", {
|
|
119
|
+
key: "label-" + r,
|
|
120
|
+
class: "b-descriptions__item-label b-descriptions__item-label--bordered",
|
|
121
|
+
colspan: t.effectiveSpan,
|
|
122
|
+
style: l(L(t))
|
|
123
|
+
}, [t.labelSlot && t.labelSlot.length ? (u(), n(p(() => t.labelSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.label), 1)], 64))], 12, C))), 128))]), a("tr", w, [(u(!0), i(e, null, d(t.items, (t, r) => (u(), i("td", {
|
|
124
|
+
key: "content-" + r,
|
|
125
|
+
class: "b-descriptions__item-content b-descriptions__item-content--bordered",
|
|
126
|
+
colspan: t.effectiveSpan,
|
|
127
|
+
style: l(R(t))
|
|
128
|
+
}, [t.contentSlot && t.contentSlot.length ? (u(), n(p(() => t.contentSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.children), 1)], 64))], 12, T))), 128))])], 64))), 128))])])) : (u(), i("table", E, [a("tbody", null, [s.layout === "horizontal" ? (u(!0), i(e, { key: 0 }, d(I.value, (t, r) => (u(), i("tr", {
|
|
129
|
+
key: r,
|
|
130
|
+
class: "b-descriptions__row"
|
|
131
|
+
}, [(u(!0), i(e, null, d(t.items, (t, r) => (u(), i("td", {
|
|
132
|
+
key: r,
|
|
133
|
+
class: "b-descriptions__item",
|
|
134
|
+
colspan: t.effectiveSpan
|
|
135
|
+
}, [a("span", {
|
|
136
|
+
class: "b-descriptions__item-label",
|
|
137
|
+
style: l(L(t))
|
|
138
|
+
}, [t.labelSlot && t.labelSlot.length ? (u(), n(p(() => t.labelSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.label), 1)], 64))], 4), a("span", {
|
|
139
|
+
class: "b-descriptions__item-content",
|
|
140
|
+
style: l(R(t))
|
|
141
|
+
}, [t.contentSlot && t.contentSlot.length ? (u(), n(p(() => t.contentSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.children), 1)], 64))], 4)], 8, D))), 128))]))), 128)) : (u(!0), i(e, { key: 1 }, d(I.value, (t, r) => (u(), i(e, { key: r }, [a("tr", O, [(u(!0), i(e, null, d(t.items, (t, r) => (u(), i("td", {
|
|
142
|
+
key: "label-" + r,
|
|
143
|
+
class: "b-descriptions__item",
|
|
144
|
+
colspan: t.effectiveSpan
|
|
145
|
+
}, [a("span", {
|
|
146
|
+
class: "b-descriptions__item-label",
|
|
147
|
+
style: l(L(t))
|
|
148
|
+
}, [t.labelSlot && t.labelSlot.length ? (u(), n(p(() => t.labelSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.label), 1)], 64))], 4)], 8, k))), 128))]), a("tr", A, [(u(!0), i(e, null, d(t.items, (t, r) => (u(), i("td", {
|
|
149
|
+
key: "content-" + r,
|
|
150
|
+
class: "b-descriptions__item",
|
|
151
|
+
colspan: t.effectiveSpan
|
|
152
|
+
}, [a("span", {
|
|
153
|
+
class: "b-descriptions__item-content",
|
|
154
|
+
style: l(R(t))
|
|
155
|
+
}, [t.contentSlot && t.contentSlot.length ? (u(), n(p(() => t.contentSlot), { key: 0 })) : (u(), i(e, { key: 1 }, [o(m(t.children), 1)], 64))], 4)], 8, j))), 128))])], 64))), 128))])]))])], 2));
|
|
27
156
|
}
|
|
28
157
|
});
|
|
29
158
|
//#endregion
|
|
30
|
-
export {
|
|
159
|
+
export { M as default };
|
|
31
160
|
|
|
32
161
|
//# sourceMappingURL=design-system76.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-system76.js","names":["$slots"],"sources":["../src/components/BDescriptions/BDescriptionsItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CSSProperties } from 'vue';\nimport { useSlots } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst {\n label,\n span = 1,\n labelStyle,\n contentStyle,\n} = defineProps<{\n /** Label text displayed for this item. Can be overridden by the `label` slot. */\n label?: string;\n /** Number of columns this item spans. @default 1 */\n span?: number;\n /** Inline style applied to the label cell. */\n labelStyle?: CSSProperties;\n /** Inline style applied to the content cell. */\n contentStyle?: CSSProperties;\n}>();\n\n// ─────────────────────────────────────────────\n// Slots\n// ─────────────────────────────────────────────\ndefineSlots<{\n /** Main content of the description item */\n default?: (props: Record<string, never>) => unknown;\n /** Custom label content. Overrides the `label` prop */\n label?: (props: Record<string, never>) => unknown;\n}>();\n\nconst slots = useSlots();\n\n// Expose props for parent to read\ndefineExpose({ label, span, labelStyle, contentStyle, slots });\n</script>\n\n<template>\n <!--\n BDescriptionsItem is a data-only component.\n It does not render its own markup; BDescriptions reads its props/slots\n and renders them in a table/list structure.\n This template is used as a fallback if the item is rendered standalone.\n -->\n <div class=\"b-descriptions-item\">\n <span v-if=\"label || $slots.label\" class=\"b-descriptions-item__label\" :style=\"labelStyle\">\n <slot name=\"label\">{{ label }}</slot>\n </span>\n <span class=\"b-descriptions-item__content\" :style=\"contentStyle\">\n <slot />\n </span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;EAiCA,IAAM,IAAQ,GAAU;SAGxB,EAAa;GAAE,OAAI,EAAA;GAAG,MAAG,EAAA;GAAG,YAAS,EAAA;GAAG,cAAW,EAAA;GAAG;GAAO,CAAC,kBAU5D,EAOM,OAPN,GAOM,CANQ,EAAA,SAASA,EAAAA,OAAO,SAAA,GAAA,EAA5B,EAEO,QAAA;;GAF4B,OAAM;GAA8B,OAAK,EAAE,EAAA,WAAU;MACtF,EAAqC,EAAA,QAAA,SAAA,EAAA,QAAA,CAAA,EAAA,EAAf,EAAA,MAAK,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,EAE7B,EAEO,QAAA;GAFD,OAAM;GAAgC,OAAK,EAAE,EAAA,aAAY;MAC7D,EAAQ,EAAA,QAAA,UAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"design-system76.js","names":["$slots"],"sources":["../src/components/BDescriptions/BDescriptions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CSSProperties, VNode } from 'vue';\nimport { computed, Fragment, useSlots } from 'vue';\n\nimport type { BDescriptionsItem } from './types';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst {\n bordered = false,\n colon = true,\n column = 3,\n layout = 'horizontal',\n size = 'default',\n title,\n extra,\n items,\n labelStyle,\n contentStyle,\n} = defineProps<{\n /** Whether to show border around the list. @default false */\n bordered?: boolean;\n /** Whether to show colon after the label. @default true */\n colon?: boolean;\n /** Number of columns per row. @default 3 */\n column?: number;\n /** Layout direction of description items. @default 'horizontal' */\n layout?: 'horizontal' | 'vertical';\n /** Size of the component. @default 'default' */\n size?: 'default' | 'middle' | 'small';\n /** Title of the descriptions block */\n title?: string;\n /** Extra content in the top-right corner */\n extra?: string;\n /** Description items data (alternative to slot-based usage) */\n items?: BDescriptionsItem[];\n /** Default style for all labels */\n labelStyle?: CSSProperties;\n /** Default style for all content cells */\n contentStyle?: CSSProperties;\n}>();\n\n// ─────────────────────────────────────────────\n// Slots\n// ─────────────────────────────────────────────\ndefineSlots<{\n /** BDescriptionsItem children */\n default?: (props: Record<string, never>) => unknown;\n /** Title area. Overrides the `title` prop */\n title?: (props: Record<string, never>) => unknown;\n /** Extra content area. Overrides the `extra` prop */\n extra?: (props: Record<string, never>) => unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Internal state\n// ─────────────────────────────────────────────\nconst slots = useSlots();\n\n// ─────────────────────────────────────────────\n// Computed\n// ─────────────────────────────────────────────\nconst hasHeader = computed(() => {\n return !!(title || slots.title || extra || slots.extra);\n});\n\nconst rootClasses = computed(() => [\n 'b-descriptions',\n {\n 'b-descriptions--bordered': bordered,\n 'b-descriptions--vertical': layout === 'vertical',\n 'b-descriptions--horizontal': layout === 'horizontal',\n 'b-descriptions--middle': size === 'middle',\n 'b-descriptions--small': size === 'small',\n 'b-descriptions--colon': colon,\n },\n]);\n\n/**\n * Collect items from the `items` prop or from slot children (BDescriptionsItem VNodes).\n * Each resolved item has: label, children, span, labelStyle, contentStyle, labelSlot, contentSlot.\n */\ninterface ResolvedItem {\n label?: string;\n children?: string;\n span: number;\n labelStyle?: CSSProperties;\n contentStyle?: CSSProperties;\n /** VNode array for the label slot (from BDescriptionsItem slot usage) */\n labelSlot?: VNode[];\n /** VNode array for the content slot (from BDescriptionsItem default slot) */\n contentSlot?: VNode[];\n}\n\nconst resolvedItems = computed<ResolvedItem[]>(() => {\n // If items prop is provided, use it directly\n if (items && items.length > 0) {\n return items.map((item) => ({\n label: item.label,\n children: item.children,\n span: item.span ?? 1,\n labelStyle: item.labelStyle,\n contentStyle: item.contentStyle,\n }));\n }\n\n // Otherwise, extract from default slot VNodes (BDescriptionsItem instances)\n const defaultSlot = slots.default?.();\n if (!defaultSlot) return [];\n\n const result: ResolvedItem[] = [];\n\n function extractItems(vnodes: VNode[]) {\n for (const vnode of vnodes) {\n // Handle fragments (v-for, template wrappers)\n if (vnode.type === Fragment) {\n if (Array.isArray(vnode.children)) {\n extractItems(vnode.children as VNode[]);\n }\n continue;\n }\n\n const props = (vnode.props || {}) as Record<string, unknown>;\n const children = vnode.children as Record<\n string,\n (...args: unknown[]) => VNode | VNode[]\n > | null;\n\n const rawLabel = children?.label?.();\n const rawContent = children?.default?.();\n\n result.push({\n label: props.label as string | undefined,\n span: (props.span as number) ?? 1,\n labelStyle: props.labelStyle as CSSProperties | undefined,\n contentStyle: props.contentStyle as CSSProperties | undefined,\n labelSlot: rawLabel ? (Array.isArray(rawLabel) ? rawLabel : [rawLabel]) : undefined,\n contentSlot: rawContent\n ? Array.isArray(rawContent)\n ? rawContent\n : [rawContent]\n : undefined,\n });\n }\n }\n\n extractItems(defaultSlot);\n return result;\n});\n\n/**\n * Organize items into rows based on the column count.\n * The last item in each row gets its span extended to fill the remaining columns.\n */\ninterface RowData {\n items: Array<ResolvedItem & { effectiveSpan: number }>;\n}\n\nconst rows = computed<RowData[]>(() => {\n const result: RowData[] = [];\n let currentRow: RowData = { items: [] };\n let colsUsed = 0;\n\n for (let i = 0; i < resolvedItems.value.length; i++) {\n const item = resolvedItems.value[i];\n const isLast = i === resolvedItems.value.length - 1;\n let span = Math.min(item.span, column);\n\n // If this item would exceed the row, start a new row\n if (colsUsed + span > column) {\n if (currentRow.items.length > 0) {\n // Fill remaining columns of the previous row\n const lastInRow = currentRow.items[currentRow.items.length - 1];\n lastInRow.effectiveSpan += column - colsUsed;\n result.push(currentRow);\n currentRow = { items: [] };\n colsUsed = 0;\n }\n }\n\n // If this is the last item, it takes up remaining space in the row\n if (isLast) {\n span = column - colsUsed;\n }\n\n currentRow.items.push({ ...item, effectiveSpan: span });\n colsUsed += span;\n\n if (colsUsed >= column) {\n result.push(currentRow);\n currentRow = { items: [] };\n colsUsed = 0;\n }\n }\n\n // Push any remaining items\n if (currentRow.items.length > 0) {\n const lastInRow = currentRow.items[currentRow.items.length - 1];\n lastInRow.effectiveSpan += column - colsUsed;\n result.push(currentRow);\n }\n\n return result;\n});\n\n/**\n * Merge global label/content styles with per-item styles.\n * Item-level styles override global styles.\n */\nfunction mergedLabelStyle(item: ResolvedItem): CSSProperties | undefined {\n if (!labelStyle && !item.labelStyle) return undefined;\n return { ...labelStyle, ...item.labelStyle };\n}\n\nfunction mergedContentStyle(item: ResolvedItem): CSSProperties | undefined {\n if (!contentStyle && !item.contentStyle) return undefined;\n return { ...contentStyle, ...item.contentStyle };\n}\n</script>\n\n<template>\n <div :class=\"rootClasses\">\n <!-- Header -->\n <div v-if=\"hasHeader\" class=\"b-descriptions__header\">\n <div v-if=\"title || $slots.title\" class=\"b-descriptions__title\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n <div v-if=\"extra || $slots.extra\" class=\"b-descriptions__extra\">\n <slot name=\"extra\">{{ extra }}</slot>\n </div>\n </div>\n\n <!-- Body -->\n <div class=\"b-descriptions__body\">\n <!-- Bordered: use a real <table> -->\n <table v-if=\"bordered\" class=\"b-descriptions__table\" role=\"presentation\">\n <tbody>\n <!-- Horizontal layout with border -->\n <template v-if=\"layout === 'horizontal'\">\n <tr v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\" class=\"b-descriptions__row\">\n <template v-for=\"(item, itemIndex) in row.items\" :key=\"itemIndex\">\n <th\n class=\"b-descriptions__item-label b-descriptions__item-label--bordered\"\n :style=\"mergedLabelStyle(item)\"\n >\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </th>\n <td\n class=\"b-descriptions__item-content b-descriptions__item-content--bordered\"\n :colspan=\"item.effectiveSpan * 2 - 1\"\n :style=\"mergedContentStyle(item)\"\n >\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </td>\n </template>\n </tr>\n </template>\n\n <!-- Vertical layout with border -->\n <template v-else>\n <template v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\">\n <tr class=\"b-descriptions__row\">\n <th\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'label-' + itemIndex\"\n class=\"b-descriptions__item-label b-descriptions__item-label--bordered\"\n :colspan=\"item.effectiveSpan\"\n :style=\"mergedLabelStyle(item)\"\n >\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </th>\n </tr>\n <tr class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'content-' + itemIndex\"\n class=\"b-descriptions__item-content b-descriptions__item-content--bordered\"\n :colspan=\"item.effectiveSpan\"\n :style=\"mergedContentStyle(item)\"\n >\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </td>\n </tr>\n </template>\n </template>\n </tbody>\n </table>\n\n <!-- Non-bordered: use a description list -->\n <table v-else class=\"b-descriptions__table\" role=\"presentation\">\n <tbody>\n <!-- Horizontal layout (default) -->\n <template v-if=\"layout === 'horizontal'\">\n <tr v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\" class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"itemIndex\"\n class=\"b-descriptions__item\"\n :colspan=\"item.effectiveSpan\"\n >\n <span class=\"b-descriptions__item-label\" :style=\"mergedLabelStyle(item)\">\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </span>\n <span class=\"b-descriptions__item-content\" :style=\"mergedContentStyle(item)\">\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </span>\n </td>\n </tr>\n </template>\n\n <!-- Vertical layout -->\n <template v-else>\n <template v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\">\n <tr class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'label-' + itemIndex\"\n class=\"b-descriptions__item\"\n :colspan=\"item.effectiveSpan\"\n >\n <span class=\"b-descriptions__item-label\" :style=\"mergedLabelStyle(item)\">\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </span>\n </td>\n </tr>\n <tr class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'content-' + itemIndex\"\n class=\"b-descriptions__item\"\n :colspan=\"item.effectiveSpan\"\n >\n <span class=\"b-descriptions__item-content\" :style=\"mergedContentStyle(item)\">\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </span>\n </td>\n </tr>\n </template>\n </template>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n\n<style>\n/* ─────────────────────────────────────────────\n BDescriptions - CSS custom properties (scoped to root)\n ───────────────────────────────────────────── */\n.b-descriptions {\n /* Surface */\n --b-descriptions-bg: oklch(100% 0 0);\n --b-descriptions-color: oklch(20% 0.02 260);\n --b-descriptions-border-color: oklch(88% 0.01 260);\n --b-descriptions-border-radius: 8px;\n --b-descriptions-transition-duration: 200ms;\n\n /* Title */\n --b-descriptions-title-color: oklch(20% 0.02 260);\n --b-descriptions-title-font-size: 16px;\n --b-descriptions-title-font-weight: 600;\n --b-descriptions-title-margin-bottom: 20px;\n\n /* Extra */\n --b-descriptions-extra-color: oklch(45% 0.02 260);\n --b-descriptions-extra-font-size: 14px;\n\n /* Label */\n --b-descriptions-label-color: oklch(40% 0.02 260);\n --b-descriptions-label-bg: oklch(97% 0.005 260);\n --b-descriptions-label-font-weight: 400;\n\n /* Content */\n --b-descriptions-content-color: oklch(20% 0.02 260);\n\n /* Item spacing */\n --b-descriptions-item-padding-bottom: 16px;\n --b-descriptions-item-padding-end: 16px;\n\n /* Colon */\n --b-descriptions-colon-margin-left: 2px;\n --b-descriptions-colon-margin-right: 8px;\n\n /* Bordered cell padding */\n --b-descriptions-cell-padding: 16px 24px;\n --b-descriptions-cell-padding-middle: 12px 20px;\n --b-descriptions-cell-padding-small: 8px 16px;\n\n /* Layout */\n color: var(--b-descriptions-color);\n font-size: 14px;\n line-height: 1.5715;\n box-sizing: border-box;\n}\n\n/* ── Header ── */\n.b-descriptions__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: var(--b-descriptions-title-margin-bottom);\n gap: 16px;\n}\n\n.b-descriptions__title {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--b-descriptions-title-color);\n font-size: var(--b-descriptions-title-font-size);\n font-weight: var(--b-descriptions-title-font-weight);\n line-height: 1.5;\n}\n\n.b-descriptions__extra {\n flex: none;\n color: var(--b-descriptions-extra-color);\n font-size: var(--b-descriptions-extra-font-size);\n}\n\n/* ── Body ── */\n.b-descriptions__body {\n width: 100%;\n overflow: hidden;\n}\n\n/* ── Table ── */\n.b-descriptions__table {\n width: 100%;\n border-collapse: collapse;\n table-layout: auto;\n}\n\n/* ── Bordered table ── */\n.b-descriptions--bordered .b-descriptions__table {\n border: 1px solid var(--b-descriptions-border-color);\n border-radius: var(--b-descriptions-border-radius);\n overflow: hidden;\n}\n\n.b-descriptions--bordered .b-descriptions__row > th,\n.b-descriptions--bordered .b-descriptions__row > td {\n border-inline-end: 1px solid var(--b-descriptions-border-color);\n border-bottom: 1px solid var(--b-descriptions-border-color);\n}\n\n.b-descriptions--bordered .b-descriptions__row > th:last-child,\n.b-descriptions--bordered .b-descriptions__row > td:last-child {\n border-inline-end: none;\n}\n\n.b-descriptions--bordered .b-descriptions__row:last-child > th,\n.b-descriptions--bordered .b-descriptions__row:last-child > td {\n border-bottom: none;\n}\n\n.b-descriptions--bordered .b-descriptions__item-label--bordered {\n padding: var(--b-descriptions-cell-padding);\n background: var(--b-descriptions-label-bg);\n color: var(--b-descriptions-label-color);\n font-weight: var(--b-descriptions-label-font-weight);\n white-space: nowrap;\n}\n\n.b-descriptions--bordered .b-descriptions__item-content--bordered {\n padding: var(--b-descriptions-cell-padding);\n color: var(--b-descriptions-content-color);\n}\n\n/* ── Non-bordered items ── */\n.b-descriptions__item {\n padding-bottom: var(--b-descriptions-item-padding-bottom);\n vertical-align: top;\n}\n\n.b-descriptions__item .b-descriptions__item-label {\n color: var(--b-descriptions-label-color);\n font-weight: var(--b-descriptions-label-font-weight);\n display: inline-block;\n}\n\n.b-descriptions__item .b-descriptions__item-content {\n color: var(--b-descriptions-content-color);\n display: inline-block;\n}\n\n/* ── Colon ── */\n.b-descriptions--colon:not(.b-descriptions--vertical)\n .b-descriptions__item\n .b-descriptions__item-label::after {\n content: ':';\n position: relative;\n margin-inline-start: var(--b-descriptions-colon-margin-left);\n margin-inline-end: var(--b-descriptions-colon-margin-right);\n}\n\n.b-descriptions--colon.b-descriptions--bordered .b-descriptions__item-label--bordered::after {\n content: none;\n}\n\n/* ── Vertical layout ── */\n.b-descriptions--vertical .b-descriptions__item .b-descriptions__item-label {\n display: block;\n padding-bottom: 4px;\n}\n\n.b-descriptions--vertical .b-descriptions__item .b-descriptions__item-content {\n display: block;\n}\n\n/* ── Size: middle ── */\n.b-descriptions--middle .b-descriptions__item {\n padding-bottom: 12px;\n}\n\n.b-descriptions--middle.b-descriptions--bordered .b-descriptions__item-label--bordered,\n.b-descriptions--middle.b-descriptions--bordered .b-descriptions__item-content--bordered {\n padding: var(--b-descriptions-cell-padding-middle);\n}\n\n/* ── Size: small ── */\n.b-descriptions--small .b-descriptions__item {\n padding-bottom: 8px;\n}\n\n.b-descriptions--small.b-descriptions--bordered .b-descriptions__item-label--bordered,\n.b-descriptions--small.b-descriptions--bordered .b-descriptions__item-content--bordered {\n padding: var(--b-descriptions-cell-padding-small);\n}\n\n.b-descriptions--small .b-descriptions__title {\n font-size: 14px;\n}\n\n.b-descriptions--middle .b-descriptions__title {\n font-size: 15px;\n}\n\n/* ── Dark mode ── */\n[data-prefers-color='dark'] .b-descriptions {\n --b-descriptions-bg: oklch(20% 0.02 260);\n --b-descriptions-color: oklch(88% 0.01 260);\n --b-descriptions-border-color: oklch(35% 0.02 260);\n --b-descriptions-title-color: oklch(92% 0.01 260);\n --b-descriptions-extra-color: oklch(65% 0.01 260);\n --b-descriptions-label-color: oklch(65% 0.01 260);\n --b-descriptions-label-bg: oklch(25% 0.02 260);\n --b-descriptions-content-color: oklch(88% 0.01 260);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-descriptions {\n --b-descriptions-bg: oklch(20% 0.02 260);\n --b-descriptions-color: oklch(88% 0.01 260);\n --b-descriptions-border-color: oklch(35% 0.02 260);\n --b-descriptions-title-color: oklch(92% 0.01 260);\n --b-descriptions-extra-color: oklch(65% 0.01 260);\n --b-descriptions-label-color: oklch(65% 0.01 260);\n --b-descriptions-label-bg: oklch(25% 0.02 260);\n --b-descriptions-content-color: oklch(88% 0.01 260);\n }\n}\n\n/* ── Reduced motion ── */\n@media (prefers-reduced-motion: reduce) {\n .b-descriptions {\n --b-descriptions-transition-duration: 0ms;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DA,IAAM,IAAQ,GAAU,EAKlB,IAAY,QACT,CAAC,EAAE,EAAA,SAAS,EAAM,SAAS,EAAA,SAAS,EAAM,OACjD,EAEI,IAAc,QAAe,CACjC,kBACA;GACE,4BAA4B,EAAA;GAC5B,4BAA4B,EAAA,WAAW;GACvC,8BAA8B,EAAA,WAAW;GACzC,0BAA0B,EAAA,SAAS;GACnC,yBAAyB,EAAA,SAAS;GAClC,yBAAyB,EAAA;GAC1B,CACF,CAAC,EAkBI,IAAgB,QAA+B;AAEnD,OAAI,EAAA,SAAS,EAAA,MAAM,SAAS,EAC1B,QAAO,EAAA,MAAM,KAAK,OAAU;IAC1B,OAAO,EAAK;IACZ,UAAU,EAAK;IACf,MAAM,EAAK,QAAQ;IACnB,YAAY,EAAK;IACjB,cAAc,EAAK;IACpB,EAAE;GAIL,IAAM,IAAc,EAAM,WAAW;AACrC,OAAI,CAAC,EAAa,QAAO,EAAE;GAE3B,IAAM,IAAyB,EAAE;GAEjC,SAAS,EAAa,GAAiB;AACrC,SAAK,IAAM,KAAS,GAAQ;AAE1B,SAAI,EAAM,SAAS,GAAU;AAC3B,MAAI,MAAM,QAAQ,EAAM,SAAS,IAC/B,EAAa,EAAM,SAAoB;AAEzC;;KAGF,IAAM,IAAS,EAAM,SAAS,EAAE,EAC1B,IAAW,EAAM,UAKjB,I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-
variant: { default: "solid" },
|
|
8
|
-
dashed: {
|
|
9
|
-
type: Boolean,
|
|
10
|
-
default: !1
|
|
11
|
-
},
|
|
12
|
-
plain: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
default: !0
|
|
15
|
-
},
|
|
16
|
-
size: { default: "large" },
|
|
17
|
-
titlePlacement: { default: "center" }
|
|
18
|
-
},
|
|
19
|
-
setup(r) {
|
|
20
|
-
let l = s(), u = e(() => r.orientation === "vertical"), d = e(() => r.orientation === "horizontal"), f = e(() => !!l.default), p = e(() => r.dashed && r.variant === "solid" ? "dashed" : r.variant), m = e(() => [
|
|
21
|
-
"b-divider",
|
|
22
|
-
`b-divider--${r.orientation}`,
|
|
23
|
-
`b-divider--${p.value}`,
|
|
24
|
-
`b-divider--size-${r.size}`,
|
|
25
|
-
{
|
|
26
|
-
"b-divider--with-text": f.value && d.value,
|
|
27
|
-
[`b-divider--text-${r.titlePlacement}`]: f.value && d.value,
|
|
28
|
-
"b-divider--plain": r.plain
|
|
29
|
-
}
|
|
30
|
-
]);
|
|
31
|
-
return (e, r) => u.value ? (a(), t("span", {
|
|
32
|
-
key: 0,
|
|
33
|
-
class: i(m.value),
|
|
34
|
-
role: "separator",
|
|
35
|
-
"aria-orientation": "vertical"
|
|
36
|
-
}, null, 2)) : d.value && !f.value ? (a(), t("div", {
|
|
37
|
-
key: 1,
|
|
38
|
-
class: i(m.value),
|
|
39
|
-
role: "separator",
|
|
40
|
-
"aria-orientation": "horizontal"
|
|
41
|
-
}, null, 2)) : (a(), t("div", {
|
|
42
|
-
key: 2,
|
|
43
|
-
class: i(m.value),
|
|
44
|
-
role: "separator",
|
|
45
|
-
"aria-orientation": "horizontal"
|
|
46
|
-
}, [n("span", c, [o(e.$slots, "default")])], 2));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
1
|
+
import e from "./design-system76.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
//#region src/components/BDescriptions/BDescriptions.vue
|
|
4
|
+
var t = e;
|
|
49
5
|
//#endregion
|
|
50
|
-
export {
|
|
6
|
+
export { t as default };
|
|
51
7
|
|
|
52
8
|
//# sourceMappingURL=design-system78.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-system78.js","names":[],"sources":["../src/components/BDivider/BDivider.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type {\n BDividerOrientation,\n BDividerSize,\n BDividerTitlePlacement,\n BDividerVariant,\n} from './types.ts';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst {\n orientation = 'horizontal',\n variant = 'solid',\n dashed = false,\n plain = true,\n size = 'large',\n titlePlacement = 'center',\n} = defineProps<{\n /**\n * Line direction.\n * - `'horizontal'` - a full-width horizontal rule (default)\n * - `'vertical'` - an inline vertical separator\n * @default 'horizontal'\n */\n orientation?: BDividerOrientation;\n /**\n * Line style.\n * - `'solid'` - continuous line (default)\n * - `'dashed'` - dashed line\n * - `'dotted'` - dotted line\n * @default 'solid'\n */\n variant?: BDividerVariant;\n /**\n * Shorthand for `variant=\"dashed\"`. Overridden when `variant` is also set.\n * Kept for AntD API compatibility.\n * @default false\n * @deprecated Prefer `variant` prop\n */\n dashed?: boolean;\n /**\n * Render the text in plain (normal weight) style rather than bold.\n * Only meaningful for horizontal dividers with content.\n * @default true\n */\n plain?: boolean;\n /**\n * Vertical spacing around horizontal dividers (ignored for vertical orientation).\n * - `'small'` - tighter margin\n * - `'medium'` - medium margin\n * - `'large'` - standard Ant Design margin (default)\n * @default 'large'\n */\n size?: BDividerSize;\n /**\n * Horizontal position of the title text inside a horizontal divider.\n * - `'start'` - align text to the leading edge\n * - `'center'` - centre the text (default)\n * - `'end'` - align text to the trailing edge\n * @default 'center'\n */\n titlePlacement?: BDividerTitlePlacement;\n}>();\n\nconst slots = defineSlots<{\n /** Optional title or content placed inside the divider line. */\n default?(): unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Computed\n// ─────────────────────────────────────────────\nconst isVertical = computed(() => orientation === 'vertical');\nconst isHorizontal = computed(() => orientation === 'horizontal');\n\n/** Whether there is slot content to render. */\nconst hasContent = computed(() => Boolean(slots.default));\n\n/**\n * Resolve the effective line style.\n * `dashed` prop is a legacy alias for `variant=\"dashed\"`.\n */\nconst effectiveVariant = computed<BDividerVariant>(() => {\n if (dashed && variant === 'solid') return 'dashed';\n return variant;\n});\n\nconst rootClass = computed(() => [\n 'b-divider',\n `b-divider--${orientation}`,\n `b-divider--${effectiveVariant.value}`,\n `b-divider--size-${size}`,\n {\n 'b-divider--with-text': hasContent.value && isHorizontal.value,\n [`b-divider--text-${titlePlacement}`]: hasContent.value && isHorizontal.value,\n 'b-divider--plain': plain,\n },\n]);\n</script>\n\n<template>\n <!--\n Vertical divider: a presentational inline separator.\n role=\"separator\" with aria-orientation covers both horizontal and vertical.\n -->\n <span v-if=\"isVertical\" :class=\"rootClass\" role=\"separator\" aria-orientation=\"vertical\" />\n\n <!--\n Horizontal divider WITHOUT content.\n <div role=\"separator\"> is used instead of <hr> because axe-core evaluates\n <hr> (which carries implicit role=\"separator\") for text-colour contrast by\n reading its CSS `color` property. A <div role=\"separator\"> with no text\n content is exempt from that check (WCAG SC 1.4.3 applies only to text).\n -->\n <div\n v-else-if=\"isHorizontal && !hasContent\"\n :class=\"rootClass\"\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />\n\n <!--\n Horizontal divider WITH content: <div role=\"separator\"> wrapping the text.\n <hr> cannot contain children, so we fall back to a div.\n -->\n <div v-else :class=\"rootClass\" role=\"separator\" aria-orientation=\"horizontal\">\n <span class=\"b-divider__content\">\n <slot />\n </span>\n </div>\n</template>\n\n<style>\n/* ────────────────────────────────────────────\n CSS Custom Properties (design tokens)\n Scoped to .b-divider — never on :root\n ──────────────────────────────────────────── */\n.b-divider {\n /* AntD token: textPaddingInline → horizontal padding around inner text */\n --b-divider-text-padding-inline: 1em;\n\n /* AntD token: orientationMargin → fraction of width from the near edge for start/end text */\n --b-divider-orientation-margin: 0.05;\n\n /* AntD token: verticalMarginInline → horizontal margin on vertical dividers */\n --b-divider-vertical-margin-inline: 8px;\n\n /* Colour */\n --b-divider-color: oklch(88% 0.01 264); /* neutral border */\n --b-divider-text-color: oklch(32% 0.02 264);\n\n /* Typography */\n --b-divider-font-size: 1rem;\n --b-divider-font-weight-text: 500; /* \"with-text\" non-plain heading weight */\n\n /* Size (margin-block for horizontal) */\n --b-divider-margin-block-large: 1.5rem; /* size=large (AntD default) */\n --b-divider-margin-block-medium: 0.75rem; /* size=medium */\n --b-divider-margin-block-small: 0.25rem; /* size=small */\n\n /* Line geometry */\n --b-divider-line-width: 1px;\n}\n\n/* ── Dark mode ───────────────────────────────────────────────────────────\n Use only the attribute selector, consistent with every other component\n in this system (BAlert, BCard, etc.). The @media (prefers-color-scheme)\n query is deliberately omitted: Storybook controls the theme by toggling\n [data-prefers-color='dark'] on <html>. A media-query override would fire\n based on the OS/test-runner's colour scheme regardless of the canvas\n setting, producing light text (#c7cedb) on a white canvas — failing\n WCAG 1.4.3 contrast in automated a11y checks.\n ──────────────────────────────────────────────────────────────────────── */\n[data-prefers-color='dark'] .b-divider {\n --b-divider-color: oklch(35% 0.02 264);\n --b-divider-text-color: oklch(85% 0.02 264);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-divider {\n --b-divider-color: oklch(35% 0.02 264);\n --b-divider-text-color: oklch(85% 0.02 264);\n }\n}\n\n/* ─────────────────────────────────────────────\n Horizontal — <div role=separator> (no text) or <div role=separator> (with text)\n ───────────────────────────────────────────── */\n.b-divider--horizontal {\n display: block;\n clear: both;\n width: 100%;\n margin-block: var(--b-divider-margin-block-large);\n border: none;\n border-block-start: var(--b-divider-line-width) var(--b-divider-color);\n /* default style is overridden by variant classes below */\n border-block-start-style: solid;\n box-sizing: border-box;\n}\n\n/* Size variants (horizontal only) */\n.b-divider--horizontal.b-divider--size-small {\n margin-block: var(--b-divider-margin-block-small);\n}\n.b-divider--horizontal.b-divider--size-medium {\n margin-block: var(--b-divider-margin-block-medium);\n}\n.b-divider--horizontal.b-divider--size-large {\n margin-block: var(--b-divider-margin-block-large);\n}\n\n/* ─────────────────────────────────────────────\n Horizontal WITH text\n ───────────────────────────────────────────── */\n.b-divider--with-text {\n display: flex;\n align-items: center;\n border-block-start-style: none; /* lines rendered via ::before / ::after */\n white-space: nowrap;\n font-size: var(--b-divider-font-size);\n color: var(--b-divider-text-color);\n font-weight: var(--b-divider-font-weight-text);\n}\n\n/* Plain text: normal weight */\n.b-divider--with-text.b-divider--plain {\n font-weight: normal;\n}\n\n/* Lines flanking the text */\n.b-divider--with-text::before,\n.b-divider--with-text::after {\n content: '';\n flex: 1;\n border-block-start: var(--b-divider-line-width) solid var(--b-divider-color);\n}\n\n/* variant overrides for ::before / ::after */\n.b-divider--dashed.b-divider--with-text::before,\n.b-divider--dashed.b-divider--with-text::after {\n border-block-start-style: dashed;\n}\n.b-divider--dotted.b-divider--with-text::before,\n.b-divider--dotted.b-divider--with-text::after {\n border-block-start-style: dotted;\n}\n\n/* Text placement — start: push text to left edge */\n.b-divider--text-start::before {\n /* orientationMargin is a unitless fraction (0.05 = 5% of width) */\n flex: calc(var(--b-divider-orientation-margin) * 1);\n min-width: 0;\n}\n.b-divider--text-start::after {\n flex: 1;\n}\n\n/* Text placement — end: push text to right edge */\n.b-divider--text-end::after {\n flex: calc(var(--b-divider-orientation-margin) * 1);\n min-width: 0;\n}\n.b-divider--text-end::before {\n flex: 1;\n}\n\n/* Text placement — center (default): equal halves */\n.b-divider--text-center::before,\n.b-divider--text-center::after {\n flex: 1;\n}\n\n.b-divider__content {\n padding-inline: var(--b-divider-text-padding-inline);\n /* prevent the text itself from shrinking below its natural width */\n flex-shrink: 0;\n}\n\n/* ─────────────────────────────────────────────\n Line-style variants (horizontal no-text)\n ───────────────────────────────────────────── */\n.b-divider--horizontal:not(.b-divider--with-text).b-divider--dashed {\n border-block-start-style: dashed;\n}\n.b-divider--horizontal:not(.b-divider--with-text).b-divider--dotted {\n border-block-start-style: dotted;\n}\n\n/* ─────────────────────────────────────────────\n Vertical divider\n ───────────────────────────────────────────── */\n.b-divider--vertical {\n display: inline-block;\n /* explicit height is not set — inherits from line-height of surrounding text */\n height: 0.9em;\n border-inline-start: var(--b-divider-line-width) solid var(--b-divider-color);\n border-block-start: none;\n vertical-align: middle;\n margin-inline: var(--b-divider-vertical-margin-inline);\n}\n\n.b-divider--vertical.b-divider--dashed {\n border-inline-start-style: dashed;\n}\n.b-divider--vertical.b-divider--dotted {\n border-inline-start-style: dotted;\n}\n\n/* ─────────────────────────────────────────────\n Reduced motion\n (dividers have no animations, but guard is here for completeness)\n ───────────────────────────────────────────── */\n@media (prefers-reduced-motion: reduce) {\n .b-divider {\n transition: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAkEA,IAAM,IAAQ,GAGV,EAKE,IAAa,QAAe,EAAA,gBAAgB,WAAW,EACvD,IAAe,QAAe,EAAA,gBAAgB,aAAa,EAG3D,IAAa,QAAe,EAAQ,EAAM,QAAS,EAMnD,IAAmB,QACnB,EAAA,UAAU,EAAA,YAAY,UAAgB,WACnC,EAAA,QACP,EAEI,IAAY,QAAe;GAC/B;GACA,cAAc,EAAA;GACd,cAAc,EAAiB;GAC/B,mBAAmB,EAAA;GACnB;IACE,wBAAwB,EAAW,SAAS,EAAa;KACxD,mBAAmB,EAAA,mBAAmB,EAAW,SAAS,EAAa;IACxE,oBAAoB,EAAA;IACrB;GACF,CAAC;mBAQY,EAAA,SAAA,GAAA,EAAZ,EAA0F,QAAA;;GAAjE,OAAK,EAAE,EAAA,MAAS;GAAE,MAAK;GAAY,oBAAiB;iBAUhE,EAAA,SAAY,CAAK,EAAA,SAAA,GAAA,EAD9B,EAKE,OAAA;;GAHC,OAAK,EAAE,EAAA,MAAS;GACjB,MAAK;GACL,oBAAiB;uBAOnB,EAIM,OAAA;;GAJO,OAAK,EAAE,EAAA,MAAS;GAAE,MAAK;GAAY,oBAAiB;MAC/D,EAEO,QAFP,GAEO,CADL,EAAQ,EAAA,QAAA,UAAA,CAAA,CAAA,CAAA,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"design-system78.js","names":[],"sources":["../src/components/BDescriptions/BDescriptions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CSSProperties, VNode } from 'vue';\nimport { computed, Fragment, useSlots } from 'vue';\n\nimport type { BDescriptionsItem } from './types';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst {\n bordered = false,\n colon = true,\n column = 3,\n layout = 'horizontal',\n size = 'default',\n title,\n extra,\n items,\n labelStyle,\n contentStyle,\n} = defineProps<{\n /** Whether to show border around the list. @default false */\n bordered?: boolean;\n /** Whether to show colon after the label. @default true */\n colon?: boolean;\n /** Number of columns per row. @default 3 */\n column?: number;\n /** Layout direction of description items. @default 'horizontal' */\n layout?: 'horizontal' | 'vertical';\n /** Size of the component. @default 'default' */\n size?: 'default' | 'middle' | 'small';\n /** Title of the descriptions block */\n title?: string;\n /** Extra content in the top-right corner */\n extra?: string;\n /** Description items data (alternative to slot-based usage) */\n items?: BDescriptionsItem[];\n /** Default style for all labels */\n labelStyle?: CSSProperties;\n /** Default style for all content cells */\n contentStyle?: CSSProperties;\n}>();\n\n// ─────────────────────────────────────────────\n// Slots\n// ─────────────────────────────────────────────\ndefineSlots<{\n /** BDescriptionsItem children */\n default?: (props: Record<string, never>) => unknown;\n /** Title area. Overrides the `title` prop */\n title?: (props: Record<string, never>) => unknown;\n /** Extra content area. Overrides the `extra` prop */\n extra?: (props: Record<string, never>) => unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Internal state\n// ─────────────────────────────────────────────\nconst slots = useSlots();\n\n// ─────────────────────────────────────────────\n// Computed\n// ─────────────────────────────────────────────\nconst hasHeader = computed(() => {\n return !!(title || slots.title || extra || slots.extra);\n});\n\nconst rootClasses = computed(() => [\n 'b-descriptions',\n {\n 'b-descriptions--bordered': bordered,\n 'b-descriptions--vertical': layout === 'vertical',\n 'b-descriptions--horizontal': layout === 'horizontal',\n 'b-descriptions--middle': size === 'middle',\n 'b-descriptions--small': size === 'small',\n 'b-descriptions--colon': colon,\n },\n]);\n\n/**\n * Collect items from the `items` prop or from slot children (BDescriptionsItem VNodes).\n * Each resolved item has: label, children, span, labelStyle, contentStyle, labelSlot, contentSlot.\n */\ninterface ResolvedItem {\n label?: string;\n children?: string;\n span: number;\n labelStyle?: CSSProperties;\n contentStyle?: CSSProperties;\n /** VNode array for the label slot (from BDescriptionsItem slot usage) */\n labelSlot?: VNode[];\n /** VNode array for the content slot (from BDescriptionsItem default slot) */\n contentSlot?: VNode[];\n}\n\nconst resolvedItems = computed<ResolvedItem[]>(() => {\n // If items prop is provided, use it directly\n if (items && items.length > 0) {\n return items.map((item) => ({\n label: item.label,\n children: item.children,\n span: item.span ?? 1,\n labelStyle: item.labelStyle,\n contentStyle: item.contentStyle,\n }));\n }\n\n // Otherwise, extract from default slot VNodes (BDescriptionsItem instances)\n const defaultSlot = slots.default?.();\n if (!defaultSlot) return [];\n\n const result: ResolvedItem[] = [];\n\n function extractItems(vnodes: VNode[]) {\n for (const vnode of vnodes) {\n // Handle fragments (v-for, template wrappers)\n if (vnode.type === Fragment) {\n if (Array.isArray(vnode.children)) {\n extractItems(vnode.children as VNode[]);\n }\n continue;\n }\n\n const props = (vnode.props || {}) as Record<string, unknown>;\n const children = vnode.children as Record<\n string,\n (...args: unknown[]) => VNode | VNode[]\n > | null;\n\n const rawLabel = children?.label?.();\n const rawContent = children?.default?.();\n\n result.push({\n label: props.label as string | undefined,\n span: (props.span as number) ?? 1,\n labelStyle: props.labelStyle as CSSProperties | undefined,\n contentStyle: props.contentStyle as CSSProperties | undefined,\n labelSlot: rawLabel ? (Array.isArray(rawLabel) ? rawLabel : [rawLabel]) : undefined,\n contentSlot: rawContent\n ? Array.isArray(rawContent)\n ? rawContent\n : [rawContent]\n : undefined,\n });\n }\n }\n\n extractItems(defaultSlot);\n return result;\n});\n\n/**\n * Organize items into rows based on the column count.\n * The last item in each row gets its span extended to fill the remaining columns.\n */\ninterface RowData {\n items: Array<ResolvedItem & { effectiveSpan: number }>;\n}\n\nconst rows = computed<RowData[]>(() => {\n const result: RowData[] = [];\n let currentRow: RowData = { items: [] };\n let colsUsed = 0;\n\n for (let i = 0; i < resolvedItems.value.length; i++) {\n const item = resolvedItems.value[i];\n const isLast = i === resolvedItems.value.length - 1;\n let span = Math.min(item.span, column);\n\n // If this item would exceed the row, start a new row\n if (colsUsed + span > column) {\n if (currentRow.items.length > 0) {\n // Fill remaining columns of the previous row\n const lastInRow = currentRow.items[currentRow.items.length - 1];\n lastInRow.effectiveSpan += column - colsUsed;\n result.push(currentRow);\n currentRow = { items: [] };\n colsUsed = 0;\n }\n }\n\n // If this is the last item, it takes up remaining space in the row\n if (isLast) {\n span = column - colsUsed;\n }\n\n currentRow.items.push({ ...item, effectiveSpan: span });\n colsUsed += span;\n\n if (colsUsed >= column) {\n result.push(currentRow);\n currentRow = { items: [] };\n colsUsed = 0;\n }\n }\n\n // Push any remaining items\n if (currentRow.items.length > 0) {\n const lastInRow = currentRow.items[currentRow.items.length - 1];\n lastInRow.effectiveSpan += column - colsUsed;\n result.push(currentRow);\n }\n\n return result;\n});\n\n/**\n * Merge global label/content styles with per-item styles.\n * Item-level styles override global styles.\n */\nfunction mergedLabelStyle(item: ResolvedItem): CSSProperties | undefined {\n if (!labelStyle && !item.labelStyle) return undefined;\n return { ...labelStyle, ...item.labelStyle };\n}\n\nfunction mergedContentStyle(item: ResolvedItem): CSSProperties | undefined {\n if (!contentStyle && !item.contentStyle) return undefined;\n return { ...contentStyle, ...item.contentStyle };\n}\n</script>\n\n<template>\n <div :class=\"rootClasses\">\n <!-- Header -->\n <div v-if=\"hasHeader\" class=\"b-descriptions__header\">\n <div v-if=\"title || $slots.title\" class=\"b-descriptions__title\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n <div v-if=\"extra || $slots.extra\" class=\"b-descriptions__extra\">\n <slot name=\"extra\">{{ extra }}</slot>\n </div>\n </div>\n\n <!-- Body -->\n <div class=\"b-descriptions__body\">\n <!-- Bordered: use a real <table> -->\n <table v-if=\"bordered\" class=\"b-descriptions__table\" role=\"presentation\">\n <tbody>\n <!-- Horizontal layout with border -->\n <template v-if=\"layout === 'horizontal'\">\n <tr v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\" class=\"b-descriptions__row\">\n <template v-for=\"(item, itemIndex) in row.items\" :key=\"itemIndex\">\n <th\n class=\"b-descriptions__item-label b-descriptions__item-label--bordered\"\n :style=\"mergedLabelStyle(item)\"\n >\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </th>\n <td\n class=\"b-descriptions__item-content b-descriptions__item-content--bordered\"\n :colspan=\"item.effectiveSpan * 2 - 1\"\n :style=\"mergedContentStyle(item)\"\n >\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </td>\n </template>\n </tr>\n </template>\n\n <!-- Vertical layout with border -->\n <template v-else>\n <template v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\">\n <tr class=\"b-descriptions__row\">\n <th\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'label-' + itemIndex\"\n class=\"b-descriptions__item-label b-descriptions__item-label--bordered\"\n :colspan=\"item.effectiveSpan\"\n :style=\"mergedLabelStyle(item)\"\n >\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </th>\n </tr>\n <tr class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'content-' + itemIndex\"\n class=\"b-descriptions__item-content b-descriptions__item-content--bordered\"\n :colspan=\"item.effectiveSpan\"\n :style=\"mergedContentStyle(item)\"\n >\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </td>\n </tr>\n </template>\n </template>\n </tbody>\n </table>\n\n <!-- Non-bordered: use a description list -->\n <table v-else class=\"b-descriptions__table\" role=\"presentation\">\n <tbody>\n <!-- Horizontal layout (default) -->\n <template v-if=\"layout === 'horizontal'\">\n <tr v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\" class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"itemIndex\"\n class=\"b-descriptions__item\"\n :colspan=\"item.effectiveSpan\"\n >\n <span class=\"b-descriptions__item-label\" :style=\"mergedLabelStyle(item)\">\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </span>\n <span class=\"b-descriptions__item-content\" :style=\"mergedContentStyle(item)\">\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </span>\n </td>\n </tr>\n </template>\n\n <!-- Vertical layout -->\n <template v-else>\n <template v-for=\"(row, rowIndex) in rows\" :key=\"rowIndex\">\n <tr class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'label-' + itemIndex\"\n class=\"b-descriptions__item\"\n :colspan=\"item.effectiveSpan\"\n >\n <span class=\"b-descriptions__item-label\" :style=\"mergedLabelStyle(item)\">\n <component\n v-if=\"item.labelSlot && item.labelSlot.length\"\n :is=\"() => item.labelSlot\"\n />\n <template v-else>{{ item.label }}</template>\n </span>\n </td>\n </tr>\n <tr class=\"b-descriptions__row\">\n <td\n v-for=\"(item, itemIndex) in row.items\"\n :key=\"'content-' + itemIndex\"\n class=\"b-descriptions__item\"\n :colspan=\"item.effectiveSpan\"\n >\n <span class=\"b-descriptions__item-content\" :style=\"mergedContentStyle(item)\">\n <component\n v-if=\"item.contentSlot && item.contentSlot.length\"\n :is=\"() => item.contentSlot\"\n />\n <template v-else>{{ item.children }}</template>\n </span>\n </td>\n </tr>\n </template>\n </template>\n </tbody>\n </table>\n </div>\n </div>\n</template>\n\n<style>\n/* ─────────────────────────────────────────────\n BDescriptions - CSS custom properties (scoped to root)\n ───────────────────────────────────────────── */\n.b-descriptions {\n /* Surface */\n --b-descriptions-bg: oklch(100% 0 0);\n --b-descriptions-color: oklch(20% 0.02 260);\n --b-descriptions-border-color: oklch(88% 0.01 260);\n --b-descriptions-border-radius: 8px;\n --b-descriptions-transition-duration: 200ms;\n\n /* Title */\n --b-descriptions-title-color: oklch(20% 0.02 260);\n --b-descriptions-title-font-size: 16px;\n --b-descriptions-title-font-weight: 600;\n --b-descriptions-title-margin-bottom: 20px;\n\n /* Extra */\n --b-descriptions-extra-color: oklch(45% 0.02 260);\n --b-descriptions-extra-font-size: 14px;\n\n /* Label */\n --b-descriptions-label-color: oklch(40% 0.02 260);\n --b-descriptions-label-bg: oklch(97% 0.005 260);\n --b-descriptions-label-font-weight: 400;\n\n /* Content */\n --b-descriptions-content-color: oklch(20% 0.02 260);\n\n /* Item spacing */\n --b-descriptions-item-padding-bottom: 16px;\n --b-descriptions-item-padding-end: 16px;\n\n /* Colon */\n --b-descriptions-colon-margin-left: 2px;\n --b-descriptions-colon-margin-right: 8px;\n\n /* Bordered cell padding */\n --b-descriptions-cell-padding: 16px 24px;\n --b-descriptions-cell-padding-middle: 12px 20px;\n --b-descriptions-cell-padding-small: 8px 16px;\n\n /* Layout */\n color: var(--b-descriptions-color);\n font-size: 14px;\n line-height: 1.5715;\n box-sizing: border-box;\n}\n\n/* ── Header ── */\n.b-descriptions__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: var(--b-descriptions-title-margin-bottom);\n gap: 16px;\n}\n\n.b-descriptions__title {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--b-descriptions-title-color);\n font-size: var(--b-descriptions-title-font-size);\n font-weight: var(--b-descriptions-title-font-weight);\n line-height: 1.5;\n}\n\n.b-descriptions__extra {\n flex: none;\n color: var(--b-descriptions-extra-color);\n font-size: var(--b-descriptions-extra-font-size);\n}\n\n/* ── Body ── */\n.b-descriptions__body {\n width: 100%;\n overflow: hidden;\n}\n\n/* ── Table ── */\n.b-descriptions__table {\n width: 100%;\n border-collapse: collapse;\n table-layout: auto;\n}\n\n/* ── Bordered table ── */\n.b-descriptions--bordered .b-descriptions__table {\n border: 1px solid var(--b-descriptions-border-color);\n border-radius: var(--b-descriptions-border-radius);\n overflow: hidden;\n}\n\n.b-descriptions--bordered .b-descriptions__row > th,\n.b-descriptions--bordered .b-descriptions__row > td {\n border-inline-end: 1px solid var(--b-descriptions-border-color);\n border-bottom: 1px solid var(--b-descriptions-border-color);\n}\n\n.b-descriptions--bordered .b-descriptions__row > th:last-child,\n.b-descriptions--bordered .b-descriptions__row > td:last-child {\n border-inline-end: none;\n}\n\n.b-descriptions--bordered .b-descriptions__row:last-child > th,\n.b-descriptions--bordered .b-descriptions__row:last-child > td {\n border-bottom: none;\n}\n\n.b-descriptions--bordered .b-descriptions__item-label--bordered {\n padding: var(--b-descriptions-cell-padding);\n background: var(--b-descriptions-label-bg);\n color: var(--b-descriptions-label-color);\n font-weight: var(--b-descriptions-label-font-weight);\n white-space: nowrap;\n}\n\n.b-descriptions--bordered .b-descriptions__item-content--bordered {\n padding: var(--b-descriptions-cell-padding);\n color: var(--b-descriptions-content-color);\n}\n\n/* ── Non-bordered items ── */\n.b-descriptions__item {\n padding-bottom: var(--b-descriptions-item-padding-bottom);\n vertical-align: top;\n}\n\n.b-descriptions__item .b-descriptions__item-label {\n color: var(--b-descriptions-label-color);\n font-weight: var(--b-descriptions-label-font-weight);\n display: inline-block;\n}\n\n.b-descriptions__item .b-descriptions__item-content {\n color: var(--b-descriptions-content-color);\n display: inline-block;\n}\n\n/* ── Colon ── */\n.b-descriptions--colon:not(.b-descriptions--vertical)\n .b-descriptions__item\n .b-descriptions__item-label::after {\n content: ':';\n position: relative;\n margin-inline-start: var(--b-descriptions-colon-margin-left);\n margin-inline-end: var(--b-descriptions-colon-margin-right);\n}\n\n.b-descriptions--colon.b-descriptions--bordered .b-descriptions__item-label--bordered::after {\n content: none;\n}\n\n/* ── Vertical layout ── */\n.b-descriptions--vertical .b-descriptions__item .b-descriptions__item-label {\n display: block;\n padding-bottom: 4px;\n}\n\n.b-descriptions--vertical .b-descriptions__item .b-descriptions__item-content {\n display: block;\n}\n\n/* ── Size: middle ── */\n.b-descriptions--middle .b-descriptions__item {\n padding-bottom: 12px;\n}\n\n.b-descriptions--middle.b-descriptions--bordered .b-descriptions__item-label--bordered,\n.b-descriptions--middle.b-descriptions--bordered .b-descriptions__item-content--bordered {\n padding: var(--b-descriptions-cell-padding-middle);\n}\n\n/* ── Size: small ── */\n.b-descriptions--small .b-descriptions__item {\n padding-bottom: 8px;\n}\n\n.b-descriptions--small.b-descriptions--bordered .b-descriptions__item-label--bordered,\n.b-descriptions--small.b-descriptions--bordered .b-descriptions__item-content--bordered {\n padding: var(--b-descriptions-cell-padding-small);\n}\n\n.b-descriptions--small .b-descriptions__title {\n font-size: 14px;\n}\n\n.b-descriptions--middle .b-descriptions__title {\n font-size: 15px;\n}\n\n/* ── Dark mode ── */\n[data-prefers-color='dark'] .b-descriptions {\n --b-descriptions-bg: oklch(20% 0.02 260);\n --b-descriptions-color: oklch(88% 0.01 260);\n --b-descriptions-border-color: oklch(35% 0.02 260);\n --b-descriptions-title-color: oklch(92% 0.01 260);\n --b-descriptions-extra-color: oklch(65% 0.01 260);\n --b-descriptions-label-color: oklch(65% 0.01 260);\n --b-descriptions-label-bg: oklch(25% 0.02 260);\n --b-descriptions-content-color: oklch(88% 0.01 260);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-descriptions {\n --b-descriptions-bg: oklch(20% 0.02 260);\n --b-descriptions-color: oklch(88% 0.01 260);\n --b-descriptions-border-color: oklch(35% 0.02 260);\n --b-descriptions-title-color: oklch(92% 0.01 260);\n --b-descriptions-extra-color: oklch(65% 0.01 260);\n --b-descriptions-label-color: oklch(65% 0.01 260);\n --b-descriptions-label-bg: oklch(25% 0.02 260);\n --b-descriptions-content-color: oklch(88% 0.01 260);\n }\n}\n\n/* ── Reduced motion ── */\n@media (prefers-reduced-motion: reduce) {\n .b-descriptions {\n --b-descriptions-transition-duration: 0ms;\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, createTextVNode as r, defineComponent as i, normalizeStyle as a, openBlock as o, renderSlot as s, toDisplayString as c, useSlots as l } from "vue";
|
|
2
|
+
//#region src/components/BDescriptions/BDescriptionsItem.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var u = { class: "b-descriptions-item" }, d = /* @__PURE__ */ i({
|
|
4
|
+
__name: "BDescriptionsItem",
|
|
5
|
+
props: {
|
|
6
|
+
label: {},
|
|
7
|
+
span: { default: 1 },
|
|
8
|
+
labelStyle: {},
|
|
9
|
+
contentStyle: {}
|
|
10
|
+
},
|
|
11
|
+
setup(i, { expose: d }) {
|
|
12
|
+
let f = l();
|
|
13
|
+
return d({
|
|
14
|
+
label: i.label,
|
|
15
|
+
span: i.span,
|
|
16
|
+
labelStyle: i.labelStyle,
|
|
17
|
+
contentStyle: i.contentStyle,
|
|
18
|
+
slots: f
|
|
19
|
+
}), (l, d) => (o(), t("div", u, [i.label || l.$slots.label ? (o(), t("span", {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "b-descriptions-item__label",
|
|
22
|
+
style: a(i.labelStyle)
|
|
23
|
+
}, [s(l.$slots, "label", {}, () => [r(c(i.label), 1)])], 4)) : e("", !0), n("span", {
|
|
24
|
+
class: "b-descriptions-item__content",
|
|
25
|
+
style: a(i.contentStyle)
|
|
26
|
+
}, [s(l.$slots, "default")], 4)]));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { d as default };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=design-system79.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-system79.js","names":["$slots"],"sources":["../src/components/BDescriptions/BDescriptionsItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CSSProperties } from 'vue';\nimport { useSlots } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst {\n label,\n span = 1,\n labelStyle,\n contentStyle,\n} = defineProps<{\n /** Label text displayed for this item. Can be overridden by the `label` slot. */\n label?: string;\n /** Number of columns this item spans. @default 1 */\n span?: number;\n /** Inline style applied to the label cell. */\n labelStyle?: CSSProperties;\n /** Inline style applied to the content cell. */\n contentStyle?: CSSProperties;\n}>();\n\n// ─────────────────────────────────────────────\n// Slots\n// ─────────────────────────────────────────────\ndefineSlots<{\n /** Main content of the description item */\n default?: (props: Record<string, never>) => unknown;\n /** Custom label content. Overrides the `label` prop */\n label?: (props: Record<string, never>) => unknown;\n}>();\n\nconst slots = useSlots();\n\n// Expose props for parent to read\ndefineExpose({ label, span, labelStyle, contentStyle, slots });\n</script>\n\n<template>\n <!--\n BDescriptionsItem is a data-only component.\n It does not render its own markup; BDescriptions reads its props/slots\n and renders them in a table/list structure.\n This template is used as a fallback if the item is rendered standalone.\n -->\n <div class=\"b-descriptions-item\">\n <span v-if=\"label || $slots.label\" class=\"b-descriptions-item__label\" :style=\"labelStyle\">\n <slot name=\"label\">{{ label }}</slot>\n </span>\n <span class=\"b-descriptions-item__content\" :style=\"contentStyle\">\n <slot />\n </span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;EAiCA,IAAM,IAAQ,GAAU;SAGxB,EAAa;GAAE,OAAI,EAAA;GAAG,MAAG,EAAA;GAAG,YAAS,EAAA;GAAG,cAAW,EAAA;GAAG;GAAO,CAAC,kBAU5D,EAOM,OAPN,GAOM,CANQ,EAAA,SAASA,EAAAA,OAAO,SAAA,GAAA,EAA5B,EAEO,QAAA;;GAF4B,OAAM;GAA8B,OAAK,EAAE,EAAA,WAAU;MACtF,EAAqC,EAAA,QAAA,SAAA,EAAA,QAAA,CAAA,EAAA,EAAf,EAAA,MAAK,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,EAE7B,EAEO,QAAA;GAFD,OAAM;GAAgC,OAAK,EAAE,EAAA,aAAY;MAC7D,EAAQ,EAAA,QAAA,UAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
|
package/dist/design-system80.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-system80.js","names":[],"sources":["../src/components/BDivider/BDivider.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type {\n BDividerOrientation,\n BDividerSize,\n BDividerTitlePlacement,\n BDividerVariant,\n} from './types.ts';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst {\n orientation = 'horizontal',\n variant = 'solid',\n dashed = false,\n plain = true,\n size = 'large',\n titlePlacement = 'center',\n} = defineProps<{\n /**\n * Line direction.\n * - `'horizontal'` - a full-width horizontal rule (default)\n * - `'vertical'` - an inline vertical separator\n * @default 'horizontal'\n */\n orientation?: BDividerOrientation;\n /**\n * Line style.\n * - `'solid'` - continuous line (default)\n * - `'dashed'` - dashed line\n * - `'dotted'` - dotted line\n * @default 'solid'\n */\n variant?: BDividerVariant;\n /**\n * Shorthand for `variant=\"dashed\"`. Overridden when `variant` is also set.\n * Kept for AntD API compatibility.\n * @default false\n * @deprecated Prefer `variant` prop\n */\n dashed?: boolean;\n /**\n * Render the text in plain (normal weight) style rather than bold.\n * Only meaningful for horizontal dividers with content.\n * @default true\n */\n plain?: boolean;\n /**\n * Vertical spacing around horizontal dividers (ignored for vertical orientation).\n * - `'small'` - tighter margin\n * - `'medium'` - medium margin\n * - `'large'` - standard Ant Design margin (default)\n * @default 'large'\n */\n size?: BDividerSize;\n /**\n * Horizontal position of the title text inside a horizontal divider.\n * - `'start'` - align text to the leading edge\n * - `'center'` - centre the text (default)\n * - `'end'` - align text to the trailing edge\n * @default 'center'\n */\n titlePlacement?: BDividerTitlePlacement;\n}>();\n\nconst slots = defineSlots<{\n /** Optional title or content placed inside the divider line. */\n default?(): unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Computed\n// ─────────────────────────────────────────────\nconst isVertical = computed(() => orientation === 'vertical');\nconst isHorizontal = computed(() => orientation === 'horizontal');\n\n/** Whether there is slot content to render. */\nconst hasContent = computed(() => Boolean(slots.default));\n\n/**\n * Resolve the effective line style.\n * `dashed` prop is a legacy alias for `variant=\"dashed\"`.\n */\nconst effectiveVariant = computed<BDividerVariant>(() => {\n if (dashed && variant === 'solid') return 'dashed';\n return variant;\n});\n\nconst rootClass = computed(() => [\n 'b-divider',\n `b-divider--${orientation}`,\n `b-divider--${effectiveVariant.value}`,\n `b-divider--size-${size}`,\n {\n 'b-divider--with-text': hasContent.value && isHorizontal.value,\n [`b-divider--text-${titlePlacement}`]: hasContent.value && isHorizontal.value,\n 'b-divider--plain': plain,\n },\n]);\n</script>\n\n<template>\n <!--\n Vertical divider: a presentational inline separator.\n role=\"separator\" with aria-orientation covers both horizontal and vertical.\n -->\n <span v-if=\"isVertical\" :class=\"rootClass\" role=\"separator\" aria-orientation=\"vertical\" />\n\n <!--\n Horizontal divider WITHOUT content.\n <div role=\"separator\"> is used instead of <hr> because axe-core evaluates\n <hr> (which carries implicit role=\"separator\") for text-colour contrast by\n reading its CSS `color` property. A <div role=\"separator\"> with no text\n content is exempt from that check (WCAG SC 1.4.3 applies only to text).\n -->\n <div\n v-else-if=\"isHorizontal && !hasContent\"\n :class=\"rootClass\"\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />\n\n <!--\n Horizontal divider WITH content: <div role=\"separator\"> wrapping the text.\n <hr> cannot contain children, so we fall back to a div.\n -->\n <div v-else :class=\"rootClass\" role=\"separator\" aria-orientation=\"horizontal\">\n <span class=\"b-divider__content\">\n <slot />\n </span>\n </div>\n</template>\n\n<style>\n/* ────────────────────────────────────────────\n CSS Custom Properties (design tokens)\n Scoped to .b-divider — never on :root\n ──────────────────────────────────────────── */\n.b-divider {\n /* AntD token: textPaddingInline → horizontal padding around inner text */\n --b-divider-text-padding-inline: 1em;\n\n /* AntD token: orientationMargin → fraction of width from the near edge for start/end text */\n --b-divider-orientation-margin: 0.05;\n\n /* AntD token: verticalMarginInline → horizontal margin on vertical dividers */\n --b-divider-vertical-margin-inline: 8px;\n\n /* Colour */\n --b-divider-color: oklch(88% 0.01 264); /* neutral border */\n --b-divider-text-color: oklch(32% 0.02 264);\n\n /* Typography */\n --b-divider-font-size: 1rem;\n --b-divider-font-weight-text: 500; /* \"with-text\" non-plain heading weight */\n\n /* Size (margin-block for horizontal) */\n --b-divider-margin-block-large: 1.5rem; /* size=large (AntD default) */\n --b-divider-margin-block-medium: 0.75rem; /* size=medium */\n --b-divider-margin-block-small: 0.25rem; /* size=small */\n\n /* Line geometry */\n --b-divider-line-width: 1px;\n}\n\n/* ── Dark mode ───────────────────────────────────────────────────────────\n Use only the attribute selector, consistent with every other component\n in this system (BAlert, BCard, etc.). The @media (prefers-color-scheme)\n query is deliberately omitted: Storybook controls the theme by toggling\n [data-prefers-color='dark'] on <html>. A media-query override would fire\n based on the OS/test-runner's colour scheme regardless of the canvas\n setting, producing light text (#c7cedb) on a white canvas — failing\n WCAG 1.4.3 contrast in automated a11y checks.\n ──────────────────────────────────────────────────────────────────────── */\n[data-prefers-color='dark'] .b-divider {\n --b-divider-color: oklch(35% 0.02 264);\n --b-divider-text-color: oklch(85% 0.02 264);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-divider {\n --b-divider-color: oklch(35% 0.02 264);\n --b-divider-text-color: oklch(85% 0.02 264);\n }\n}\n\n/* ─────────────────────────────────────────────\n Horizontal — <div role=separator> (no text) or <div role=separator> (with text)\n ───────────────────────────────────────────── */\n.b-divider--horizontal {\n display: block;\n clear: both;\n width: 100%;\n margin-block: var(--b-divider-margin-block-large);\n border: none;\n border-block-start: var(--b-divider-line-width) var(--b-divider-color);\n /* default style is overridden by variant classes below */\n border-block-start-style: solid;\n box-sizing: border-box;\n}\n\n/* Size variants (horizontal only) */\n.b-divider--horizontal.b-divider--size-small {\n margin-block: var(--b-divider-margin-block-small);\n}\n.b-divider--horizontal.b-divider--size-medium {\n margin-block: var(--b-divider-margin-block-medium);\n}\n.b-divider--horizontal.b-divider--size-large {\n margin-block: var(--b-divider-margin-block-large);\n}\n\n/* ─────────────────────────────────────────────\n Horizontal WITH text\n ───────────────────────────────────────────── */\n.b-divider--with-text {\n display: flex;\n align-items: center;\n border-block-start-style: none; /* lines rendered via ::before / ::after */\n white-space: nowrap;\n font-size: var(--b-divider-font-size);\n color: var(--b-divider-text-color);\n font-weight: var(--b-divider-font-weight-text);\n}\n\n/* Plain text: normal weight */\n.b-divider--with-text.b-divider--plain {\n font-weight: normal;\n}\n\n/* Lines flanking the text */\n.b-divider--with-text::before,\n.b-divider--with-text::after {\n content: '';\n flex: 1;\n border-block-start: var(--b-divider-line-width) solid var(--b-divider-color);\n}\n\n/* variant overrides for ::before / ::after */\n.b-divider--dashed.b-divider--with-text::before,\n.b-divider--dashed.b-divider--with-text::after {\n border-block-start-style: dashed;\n}\n.b-divider--dotted.b-divider--with-text::before,\n.b-divider--dotted.b-divider--with-text::after {\n border-block-start-style: dotted;\n}\n\n/* Text placement — start: push text to left edge */\n.b-divider--text-start::before {\n /* orientationMargin is a unitless fraction (0.05 = 5% of width) */\n flex: calc(var(--b-divider-orientation-margin) * 1);\n min-width: 0;\n}\n.b-divider--text-start::after {\n flex: 1;\n}\n\n/* Text placement — end: push text to right edge */\n.b-divider--text-end::after {\n flex: calc(var(--b-divider-orientation-margin) * 1);\n min-width: 0;\n}\n.b-divider--text-end::before {\n flex: 1;\n}\n\n/* Text placement — center (default): equal halves */\n.b-divider--text-center::before,\n.b-divider--text-center::after {\n flex: 1;\n}\n\n.b-divider__content {\n padding-inline: var(--b-divider-text-padding-inline);\n /* prevent the text itself from shrinking below its natural width */\n flex-shrink: 0;\n}\n\n/* ─────────────────────────────────────────────\n Line-style variants (horizontal no-text)\n ───────────────────────────────────────────── */\n.b-divider--horizontal:not(.b-divider--with-text).b-divider--dashed {\n border-block-start-style: dashed;\n}\n.b-divider--horizontal:not(.b-divider--with-text).b-divider--dotted {\n border-block-start-style: dotted;\n}\n\n/* ─────────────────────────────────────────────\n Vertical divider\n ───────────────────────────────────────────── */\n.b-divider--vertical {\n display: inline-block;\n /* explicit height is not set — inherits from line-height of surrounding text */\n height: 0.9em;\n border-inline-start: var(--b-divider-line-width) solid var(--b-divider-color);\n border-block-start: none;\n vertical-align: middle;\n margin-inline: var(--b-divider-vertical-margin-inline);\n}\n\n.b-divider--vertical.b-divider--dashed {\n border-inline-start-style: dashed;\n}\n.b-divider--vertical.b-divider--dotted {\n border-inline-start-style: dotted;\n}\n\n/* ─────────────────────────────────────────────\n Reduced motion\n (dividers have no animations, but guard is here for completeness)\n ───────────────────────────────────────────── */\n@media (prefers-reduced-motion: reduce) {\n .b-divider {\n transition: none;\n }\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"design-system80.js","names":[],"sources":["../src/components/BDescriptions/BDescriptionsItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CSSProperties } from 'vue';\nimport { useSlots } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst {\n label,\n span = 1,\n labelStyle,\n contentStyle,\n} = defineProps<{\n /** Label text displayed for this item. Can be overridden by the `label` slot. */\n label?: string;\n /** Number of columns this item spans. @default 1 */\n span?: number;\n /** Inline style applied to the label cell. */\n labelStyle?: CSSProperties;\n /** Inline style applied to the content cell. */\n contentStyle?: CSSProperties;\n}>();\n\n// ─────────────────────────────────────────────\n// Slots\n// ─────────────────────────────────────────────\ndefineSlots<{\n /** Main content of the description item */\n default?: (props: Record<string, never>) => unknown;\n /** Custom label content. Overrides the `label` prop */\n label?: (props: Record<string, never>) => unknown;\n}>();\n\nconst slots = useSlots();\n\n// Expose props for parent to read\ndefineExpose({ label, span, labelStyle, contentStyle, slots });\n</script>\n\n<template>\n <!--\n BDescriptionsItem is a data-only component.\n It does not render its own markup; BDescriptions reads its props/slots\n and renders them in a table/list structure.\n This template is used as a fallback if the item is rendered standalone.\n -->\n <div class=\"b-descriptions-item\">\n <span v-if=\"label || $slots.label\" class=\"b-descriptions-item__label\" :style=\"labelStyle\">\n <slot name=\"label\">{{ label }}</slot>\n </span>\n <span class=\"b-descriptions-item__content\" :style=\"contentStyle\">\n <slot />\n </span>\n </div>\n</template>\n"],"mappings":""}
|