ranui 0.2.0-alpha.2 → 0.2.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.js +1 -1
- package/dist/{button-BstLjXNe.js → button-CJFSrjq_.js} +10 -10
- package/dist/button.js +1 -1
- package/dist/card-F-3fRynz.js +67 -0
- package/dist/card.js +1 -1
- package/dist/{checkbox-iHZQb-yQ.js → checkbox-BS5kNY6n.js} +9 -9
- package/dist/checkbox.js +1 -1
- package/dist/{colorpicker-CGh8pRqo.js → colorpicker-CdzUAVC5.js} +11 -11
- package/dist/colorpicker.js +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/theme-switch/index.d.ts +36 -0
- package/dist/{dropdown-RqHMRhFE.js → dropdown-BYS1Trdu.js} +9 -9
- package/dist/dropdown.js +1 -1
- package/dist/fonts/Geist-Variable.woff2 +0 -0
- package/dist/fonts/GeistMono-Variable.woff2 +0 -0
- package/dist/fonts/OFL-LICENSE.txt +92 -0
- package/dist/fonts/fonts.css +26 -0
- package/dist/{form-05Lxxl3D.js → form-BsB5JhS4.js} +9 -9
- package/dist/form.js +1 -1
- package/dist/{icon-Blm7AbyY.js → icon-pfolda2m.js} +3 -3
- package/dist/icon.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/link.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +9 -9
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/iife/theme-switch.iife.js +1 -0
- package/dist/{image-DKm6z7YQ.js → image-BXpKQ9sU.js} +9 -9
- package/dist/image.js +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.d.ts +4 -0
- package/dist/index.iife.js +67 -78
- package/dist/index.js +73 -72
- package/dist/{input-Dskw1bAl.js → input-BM6e_LQr.js} +13 -13
- package/dist/input.js +1 -1
- package/dist/{link-BW-gvrpN.js → link-DURZzd7u.js} +7 -7
- package/dist/link.js +1 -1
- package/dist/{loading-C4QUpm70.js → loading-Bd-gF1AH.js} +24 -24
- package/dist/loading.js +1 -1
- package/dist/{math-Dv4nXSoI.js → math-IjzOAwnA.js} +7 -7
- package/dist/math.js +1 -1
- package/dist/{message-De5e1txT.js → message-CLpuP8HY.js} +8 -8
- package/dist/message.js +1 -1
- package/dist/{modal-DruDj3AB.js → modal-DOTpABRe.js} +7 -7
- package/dist/modal.js +1 -1
- package/dist/{player-CqTAmg_E.js → player-C2pB5L2N.js} +7 -7
- package/dist/player.js +1 -1
- package/dist/{popover-BY32HNMl.js → popover-DRUQjdPs.js} +10 -10
- package/dist/popover.js +1 -1
- package/dist/{progress-gZo0knzu.js → progress-BIEXYYd2.js} +6 -6
- package/dist/progress.js +1 -1
- package/dist/{radar-19P5Mtld.js → radar-DAF95_Mj.js} +9 -9
- package/dist/radar.js +1 -1
- package/dist/ranui.css +1 -1
- package/dist/{route-BY_E6-2C.js → route-MQZpn2BP.js} +14 -14
- package/dist/route.js +1 -1
- package/dist/{router-BDcv4F-2.js → router-B9rCrWXm.js} +5 -5
- package/dist/router.js +1 -1
- package/dist/{scratch-Dbd9G6Q6.js → scratch-QlPyy1f4.js} +1 -1
- package/dist/scratch.js +1 -1
- package/dist/{section-CNTvgdQ-.js → section-D0qMm9KM.js} +8 -8
- package/dist/section.js +1 -1
- package/dist/{select-BVdUtQX5.js → select-BSeCT9tF.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/{signal-XHfNsQNW.js → signal-CSSZxlK5.js} +1 -1
- package/dist/{skeleton-BAdJ6vyA.js → skeleton-CFqQmKyt.js} +8 -8
- package/dist/skeleton.js +1 -1
- package/dist/{tab-DH2owP2V.js → tab-CqFrgo2v.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-B_M-Jokw.js → tabpane-B-m3xwqu.js} +7 -7
- package/dist/tabpane.js +1 -1
- package/dist/test/unit/theme-switch.contract.test.d.ts +1 -0
- package/dist/theme-switch-B8K9y2RL.js +170 -0
- package/dist/theme-switch.js +5 -0
- package/dist/{utils-D4pPF77E.js → utils-DBfrRFoE.js} +116 -198
- package/docs/COMPONENTS.md +21 -5
- package/docs/DESIGN.md +24 -19
- package/docs/style-tokens-public.md +55 -8
- package/package.json +16 -10
- package/dist/card-DQUJoDUQ.js +0 -60
package/dist/builder.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as s, c as e, i as t, n as o, o as r, r as c, s as i, t as l } from "./mocks-CMGoftIc.js";
|
|
2
2
|
import { t as n } from "./events-C59wGdni.js";
|
|
3
|
-
import { i as d, n as u, r as S, t as f } from "./signal-
|
|
3
|
+
import { i as d, n as u, r as S, t as f } from "./signal-CSSZxlK5.js";
|
|
4
4
|
import { _ as M, a as v, b as B, c as b, d as g, f as w, g as E, h as H, i as k, l as D, m as L, n as R, o as y, p as A, r as F, s as x, t as I, u as N, v as T, y as U } from "./factory-BdsO0dEW.js";
|
|
5
5
|
export {
|
|
6
6
|
I as Article,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { a as
|
|
5
|
-
var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, color var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1), border-color var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1), box-shadow var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1), opacity var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #
|
|
1
|
+
import { _ as i, a as b, n as d, o as l, s as a, t as h } from "./utils-DBfrRFoE.js";
|
|
2
|
+
import { t as v } from "./events-C59wGdni.js";
|
|
3
|
+
import { _ as u, i as s, p as f } from "./factory-BdsO0dEW.js";
|
|
4
|
+
import { a as g, n as p } from "./ssr-DSGwPtEd.js";
|
|
5
|
+
var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, color var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1), border-color var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1), box-shadow var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1), opacity var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #006bff));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-primary, #006bff));color:var(--ran-btn-content-color, #fff)}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-primary-active, #005ff2));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-primary-active, #005ff2))}:host([type="contrast"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-contrast-bg, #171717));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-contrast-bg, #171717));color:var(--ran-btn-content-color, var(--ran-color-contrast-text, #fff))}:host([type="contrast"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, var(--ran-color-contrast-text, #fff) 10%, transparent 10.01%))}:host([type="contrast"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-contrast-bg-active, #4d4d4d));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-contrast-bg-active, #4d4d4d))}@media(min-width:1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-border-hover, #c9c9c9));color:var(--ran-btn-content-hover-color, var(--ran-color-text, #171717))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-primary-hover, #0059ec));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-primary-hover, #0059ec));color:var(--ran-btn-content-hover-color, #fff)}:host([type="contrast"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-contrast-bg-hover, #383838));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-contrast-bg-hover, #383838));color:var(--ran-btn-content-hover-color, var(--ran-color-contrast-text, #fff))}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));color:var(--ran-btn-content-warning-color, #fff)}}:host([type="warning"]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));background-image:var(--ran-btn-content-background-image, none);color:var(--ran-btn-content-warning-color, #fff)}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="text"]) .ran-btn-content{border:var(--ran-btn-content-text-border, none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events, all);opacity:var(--ran-btn-disabled-opacity, .6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events, all);opacity:var(--ran-btn-disabled-container-opacity, .6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform, translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity, .3);transition:var(--ran-btn-after-transition, 0s)}@media(min-width:1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,var(--ran-gray-alpha-400, #00000014) 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:var(--ran-btn-slot-display, block)}.ran-btn-content{display:var(--ran-btn-content-display, flex);justify-content:var(--ran-btn-content-display, space-between);align-items:var(--ran-btn-content-align-items, center);padding:var(--ran-btn-content-padding, 4px 15px);border:var(--ran-btn-content-border, 1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source, none);border-image-slice:var(--ran-btn-content-border-image-slice, 8);border-image-width:var(--ran-btn-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));border-color:var(--ran-btn-content-border-color, var(--ran-color-border, #eaeaea));color:var(--ran-btn-content-color, var(--ran-color-text, #000000d9));line-height:var(--ran-btn-content-line-height, 22px);font-size:var(--ran-btn-content-font-size, 14px);font-weight:var(--ran-btn-content-font-weight, 400);font-family:var(--ran-btn-content-font-family, var(--ran-skin-font-family, inherit));white-space:var(--ran-btn-content-white-space, nowrap);text-align:var(--ran-btn-content-text-align, center);box-sizing:var(--ran-btn-content-box-sizing, border-box)}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right, 2px)}', y = class extends p {
|
|
6
6
|
_btn;
|
|
7
7
|
_btnContent;
|
|
8
8
|
_iconElement;
|
|
9
9
|
_slot;
|
|
10
10
|
_shadowDom;
|
|
11
|
-
_events = new
|
|
11
|
+
_events = new v();
|
|
12
12
|
debounceTimeId;
|
|
13
13
|
static get observedAttributes() {
|
|
14
14
|
return [
|
|
@@ -21,7 +21,7 @@ var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
23
|
constructor() {
|
|
24
|
-
super(), this._shadowDom =
|
|
24
|
+
super(), this._shadowDom = d(this, m);
|
|
25
25
|
const t = h(this._shadowDom, ".ran-btn", () => s().class("ran-btn").attr("part", "button").role("button").tabIndex(0).children(s().class("ran-btn-content").attr("part", "content").children(f().class("slot"))).build());
|
|
26
26
|
this._btn = t, this._btnContent = t.querySelector(".ran-btn-content"), this._slot = t.querySelector("slot");
|
|
27
27
|
}
|
|
@@ -71,7 +71,7 @@ var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
71
71
|
if (this._iconElement) this._iconElement.setAttribute("name", t);
|
|
72
72
|
else {
|
|
73
73
|
let e = this._shadowDom.querySelector("r-icon");
|
|
74
|
-
e || (e =
|
|
74
|
+
e || (e = u("r-icon").attr("color", "currentColor").class("icon").build(), this._slot.insertAdjacentElement("beforebegin", e)), this._iconElement = e, this._iconElement.setAttribute("name", t);
|
|
75
75
|
}
|
|
76
76
|
const { width: n, height: r } = this._slot.getBoundingClientRect(), o = Math.min(n, r) || 16, c = this.iconSize || `${o > 5 ? o - 5 : o}`;
|
|
77
77
|
this._iconElement.setAttribute("size", String(c));
|
|
@@ -95,7 +95,7 @@ var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
95
95
|
this.debounceTimeId && (clearTimeout(this.debounceTimeId), this.debounceTimeId = void 0);
|
|
96
96
|
};
|
|
97
97
|
handlerExternalCss = () => {
|
|
98
|
-
|
|
98
|
+
b(this, this._shadowDom, "sheet", null, this.sheet);
|
|
99
99
|
};
|
|
100
100
|
syncA11yState = () => {
|
|
101
101
|
const t = a(this);
|
|
@@ -111,7 +111,7 @@ var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
111
111
|
n !== r && (t === "disabled" && this._btnContent && this.syncA11yState(), (t === "icon" || t === "iconSize") && this.setIcon(), t === "sheet" && this.handlerExternalCss());
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
|
|
114
|
+
g("r-button", y);
|
|
115
115
|
export {
|
|
116
116
|
y as t
|
|
117
117
|
};
|
package/dist/button.js
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { a as n, i as a, n as d, r as i, t as c } from "./utils-DBfrRFoE.js";
|
|
2
|
+
import { i as t, p as o } from "./factory-BdsO0dEW.js";
|
|
3
|
+
import { a as l, n as h } from "./ssr-DSGwPtEd.js";
|
|
4
|
+
var p = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:var(--ran-card-display, block);box-sizing:border-box;min-height:var(--ran-card-min-height, 0)}:host([hoverable]) .ran-card{transition:border-color var(--ran-motion-duration-base, .2s),box-shadow var(--ran-motion-duration-base, .2s)}:host([hoverable]:hover) .ran-card{border-color:var(--ran-card-hover-border-color, var(--ran-color-border-hover, #c9c9c9));box-shadow:var(--ran-card-hover-shadow, var(--ran-shadow-elevated, 0 1px 2px rgba(0, 0, 0, .04)))}.ran-card{display:grid;align-content:start;gap:var(--ran-card-gap, 14px);height:100%;min-width:0;padding:var(--ran-card-padding, 16px);border-width:var(--ran-skin-border-width, 1px);border-style:var(--ran-skin-border-style, solid);border-color:var(--ran-card-border-color, var(--ran-color-border, #eaeaea));border-radius:var(--ran-card-radius, var(--ran-radius-md));background:var(--ran-card-background, var(--ran-color-bg));box-shadow:var(--ran-card-shadow, none);box-sizing:border-box}.ran-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.ran-card-title-area{flex:1;min-width:0}.ran-card-title{margin:0;color:var(--ran-card-title-color, var(--ran-color-text));font-size:var(--ran-card-title-font-size, 16px);font-weight:var(--ran-card-title-font-weight, 600);line-height:1.3}.ran-card-title:empty{display:none}.ran-card-description{margin:4px 0 0;color:var(--ran-card-description-color, var(--ran-color-text-secondary));font-size:var(--ran-card-description-font-size, 14px);line-height:1.5}.ran-card-description:empty{display:none}.ran-card-body,.ran-card-footer{min-width:0}:host(:not([title]):not([description])) .ran-card-header{display:none}", b = class extends h {
|
|
5
|
+
_shadowDom;
|
|
6
|
+
_titleEl;
|
|
7
|
+
_descriptionEl;
|
|
8
|
+
_headerEl;
|
|
9
|
+
_footerEl;
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return [
|
|
12
|
+
"title",
|
|
13
|
+
"description",
|
|
14
|
+
"sheet",
|
|
15
|
+
"hoverable"
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
super(), this._shadowDom = d(this, p);
|
|
20
|
+
const r = c(this._shadowDom, ".ran-card", () => t().class("ran-card").attr("part", "card").children(t().class("ran-card-header").attr("part", "header").children(t().class("ran-card-title-area").children(t().class("ran-card-title").attr("part", "title"), t().class("ran-card-description").attr("part", "description")), o().attr("name", "extra").attr("part", "extra")), t().class("ran-card-body").attr("part", "body").children(o()), t().class("ran-card-footer").attr("part", "footer").children(o().attr("name", "footer"))).build());
|
|
21
|
+
this._headerEl = r.querySelector(".ran-card-header"), this._titleEl = r.querySelector(".ran-card-title"), this._descriptionEl = r.querySelector(".ran-card-description"), this._footerEl = r.querySelector(".ran-card-footer"), this._footerEl.style.display = "none";
|
|
22
|
+
const e = this._footerEl.querySelector('slot[name="footer"]');
|
|
23
|
+
e.addEventListener("slotchange", () => {
|
|
24
|
+
this._footerEl.style.display = e.assignedElements().length > 0 ? "" : "none";
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
get title() {
|
|
28
|
+
return i(this, "title");
|
|
29
|
+
}
|
|
30
|
+
set title(r) {
|
|
31
|
+
a(this, "title", r);
|
|
32
|
+
}
|
|
33
|
+
get description() {
|
|
34
|
+
return i(this, "description");
|
|
35
|
+
}
|
|
36
|
+
set description(r) {
|
|
37
|
+
a(this, "description", r);
|
|
38
|
+
}
|
|
39
|
+
get sheet() {
|
|
40
|
+
return i(this, "sheet");
|
|
41
|
+
}
|
|
42
|
+
set sheet(r) {
|
|
43
|
+
a(this, "sheet", r);
|
|
44
|
+
}
|
|
45
|
+
get hoverable() {
|
|
46
|
+
return this.hasAttribute("hoverable");
|
|
47
|
+
}
|
|
48
|
+
set hoverable(r) {
|
|
49
|
+
r ? this.setAttribute("hoverable", "") : this.removeAttribute("hoverable");
|
|
50
|
+
}
|
|
51
|
+
_syncTitle() {
|
|
52
|
+
this._titleEl.textContent = this.getAttribute("title") ?? "";
|
|
53
|
+
}
|
|
54
|
+
_syncDescription() {
|
|
55
|
+
this._descriptionEl.textContent = this.getAttribute("description") ?? "";
|
|
56
|
+
}
|
|
57
|
+
connectedCallback() {
|
|
58
|
+
this._syncTitle(), this._syncDescription(), n(this, this._shadowDom, "sheet", null, this.sheet);
|
|
59
|
+
}
|
|
60
|
+
attributeChangedCallback(r, e, s) {
|
|
61
|
+
e !== s && (r === "title" && this._syncTitle(), r === "description" && this._syncDescription(), r === "sheet" && n(this, this._shadowDom, r, e, s));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
l("r-card", b);
|
|
65
|
+
export {
|
|
66
|
+
b as t
|
|
67
|
+
};
|
package/dist/card.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as o, c as i, f as s, i as h, n as b, o as t, r as d, s as l, t as k } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as x } from "./events-C59wGdni.js";
|
|
3
3
|
import { i as a, m as c, p as u, s as p } from "./factory-BdsO0dEW.js";
|
|
4
4
|
import { a as v, n as f } from "./ssr-DSGwPtEd.js";
|
|
5
|
-
var g = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-checkbox-host-position, relative);display:var(--ran-checkbox-host-display, inline-flex);margin:var(--ran-checkbox-host-margin, 0);padding:var(--ran-checkbox-host-padding, 0);box-sizing:var(--ran-checkbox-host-box-sizing, border-box);list-style:var(--ran-checkbox-host-list-style, none)}:host([disabled]){opacity:var(--ran-checkbox-disabled-opacity, .6)}:host([disabled]) .ran-checkbox-input{cursor:var(--ran-checkbox-disabled-cursor, not-allowed);pointer-events:var(--ran-checkbox-disabled-pointer-events, all)}:host([disabled]) .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-bg-muted, #
|
|
5
|
+
var g = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-checkbox-host-position, relative);display:var(--ran-checkbox-host-display, inline-flex);margin:var(--ran-checkbox-host-margin, 0);padding:var(--ran-checkbox-host-padding, 0);box-sizing:var(--ran-checkbox-host-box-sizing, border-box);list-style:var(--ran-checkbox-host-list-style, none)}:host([disabled]){opacity:var(--ran-checkbox-disabled-opacity, .6)}:host([disabled]) .ran-checkbox-input{cursor:var(--ran-checkbox-disabled-cursor, not-allowed);pointer-events:var(--ran-checkbox-disabled-pointer-events, all)}:host([disabled]) .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-bg-muted, #f2f2f2));border:1px solid var(--ran-color-border, #eaeaea)}:host([disabled]) .ran-checkbox-inner:after{cursor:not-allowed;pointer-events:none;opacity:var(--ran-checkbox-checked-after-opacity, 1)}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-bg-muted, #f2f2f2))}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-checked-after-opacity, 0)}.ran-checkbox-wrapper{display:inline-flex;align-items:center;gap:var(--ran-checkbox-label-gap, 8px);cursor:pointer;line-height:1}.ran-checkbox-label{color:var(--ran-checkbox-label-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-checkbox-label-font-size, 14px);font-family:var(--ran-checkbox-label-font-family, var(--ran-skin-font-family, inherit));line-height:var(--ran-checkbox-label-line-height, 1.5);-webkit-user-select:none;user-select:none}.ran-checkbox{position:var(--ran-checkbox-position, relative);display:var(--ran-checkbox-display, block);box-sizing:var(--ran-checkbox-box-sizing, border-box);margin:var(--ran-checkbox-margin, 0);width:var(--ran-checkbox-width, 16px);height:var(--ran-checkbox-height, 16px);padding:var(--ran-checkbox-padding, 0);color:var(--ran-checkbox-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-checkbox-font-size, 14px);line-height:var(--ran-checkbox-line-height, 1);list-style:var(--ran-checkbox-list-style, none);font-family:var(--ran-checkbox-font-family, var(--ran-skin-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));white-space:var(--ran-checkbox-white-space, nowrap);cursor:var(--ran-checkbox-cursor, pointer);border-radius:var(--ran-checkbox-border-radius, 4px)}.ran-checkbox-input{position:var(--ran-checkbox-input-position, absolute);inset:var(--ran-checkbox-input-inset, 0);z-index:var(--ran-checkbox-input-z-index, 1);cursor:var(--ran-checkbox-input-cursor, pointer);opacity:var(--ran-checkbox-input-opacity, 0);margin:var(--ran-checkbox-input-margin, 0)}.ran-checkbox-inner{box-sizing:var(--ran-checkbox-inner-box-sizing, border-box);display:var(--ran-checkbox-inner-display, block);width:var(--ran-checkbox-inner-width, 16px);height:var(--ran-checkbox-inner-height, 16px);direction:var(--ran-checkbox-inner-direction, ltr);background-color:var(--ran-checkbox-inner-background-color, var(--ran-color-bg-elevated, #fff));border:var(--ran-checkbox-inner-border, 1px solid var(--ran-color-border, #eaeaea));border-image-source:var(--ran-checkbox-inner-border-image-source, none);border-image-slice:var(--ran-checkbox-inner-border-image-slice, 8);border-image-width:var(--ran-checkbox-inner-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-checkbox-inner-border-radius, 4px);border-collapse:var(--ran-checkbox-inner-border-collapse, separate)}.ran-checkbox-inner:after{box-sizing:var(--ran-checkbox-inner-after-box-sizing, border-box);position:var(--ran-checkbox-inner-after-position, absolute);top:var(--ran-checkbox-inner-after-top, 50%);inset-inline-start:var(--ran-checkbox-inner-after-inset-inline-start, 25%);display:var(--ran-checkbox-inner-after-display, table);width:var(--ran-checkbox-inner-after-width, calc(16px / 14 * 5));height:var(--ran-checkbox-inner-after-height, calc(16px / 14 * 8));border:var(--ran-checkbox-inner-after-border, 2px solid #fff);border-top:var(--ran-checkbox-inner-after-border-top, 0);border-inline-start:var(--ran-checkbox-inner-after-border-inline-start, 0);opacity:var(--ran-checkbox-inner-after-opacity, 0);content:var(--ran-checkbox-inner-after-content, "");transition:var(--ran-checkbox-inner-after-transition, all .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s);transform:var(--ran-checkbox-inner-after-transform, rotate(45deg) scale(1) translate(-50%, -50%))}.ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-primary, #006bff));background-image:var(--ran-checkbox-checked-background-image, none);border:var(--ran-checkbox-checked-border, 1px solid var(--ran-color-primary, #006bff))}.ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-checked-after-opacity, 1)}.ran-checkbox:focus-within .ran-checkbox-inner{box-shadow:var(--ran-checkbox-focus-box-shadow, 0 0 0 2px var(--ran-blue-400, #cae7ff));border-color:var(--ran-checkbox-focus-border-color, var(--ran-color-primary, #006bff))}', m = class extends f {
|
|
6
6
|
static formAssociated = !0;
|
|
7
7
|
_events = new x();
|
|
8
8
|
_internals;
|
|
@@ -26,12 +26,12 @@ var g = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
26
26
|
} catch {
|
|
27
27
|
this._internals = void 0;
|
|
28
28
|
}
|
|
29
|
-
this._shadowDom =
|
|
30
|
-
const e =
|
|
29
|
+
this._shadowDom = b(this, g);
|
|
30
|
+
const e = k(this._shadowDom, ".ran-checkbox-wrapper", () => a().class("ran-checkbox-wrapper").part("wrapper").children(a().class("ran-checkbox").part("checkbox").children(p().class("ran-checkbox-input").part("input").attr("type", "checkbox"), c().class("ran-checkbox-inner").part("inner")), c().class("ran-checkbox-label").part("label").children(u())).build());
|
|
31
31
|
this.container = e.querySelector(".ran-checkbox"), this.checkInput = e.querySelector(".ran-checkbox-input"), this.checkInner = e.querySelector(".ran-checkbox-inner"), this.checkInput.setAttribute("aria-hidden", "true"), this.checkInput.tabIndex = -1, this.context = { checked: !1 };
|
|
32
32
|
}
|
|
33
33
|
get disabled() {
|
|
34
|
-
return
|
|
34
|
+
return l(this);
|
|
35
35
|
}
|
|
36
36
|
set disabled(e) {
|
|
37
37
|
t.includes(e) ? this.removeAttribute("disabled") : this.setAttribute("disabled", "");
|
|
@@ -51,17 +51,17 @@ var g = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
51
51
|
t.includes(e) ? (this.setAttribute("checked", "false"), this.context.checked = !1) : (this.setAttribute("checked", "true"), this.context.checked = !0), this.updateChecked();
|
|
52
52
|
}
|
|
53
53
|
get sheet() {
|
|
54
|
-
return
|
|
54
|
+
return d(this, "sheet");
|
|
55
55
|
}
|
|
56
56
|
set sheet(e) {
|
|
57
|
-
|
|
57
|
+
h(this, "sheet", e);
|
|
58
58
|
}
|
|
59
59
|
handlerExternalCss = () => {
|
|
60
|
-
|
|
60
|
+
o(this, this._shadowDom, "sheet", null, this.sheet);
|
|
61
61
|
};
|
|
62
62
|
updateChecked = () => {
|
|
63
63
|
const { checked: e } = this.context;
|
|
64
|
-
e ? (this.setAttribute("checked", "true"), this.setAttribute("value", "true"),
|
|
64
|
+
e ? (this.setAttribute("checked", "true"), this.setAttribute("value", "true"), i(this.container, "ran-checkbox-checked")) : (this.setAttribute("checked", "false"), this.setAttribute("value", "false"), s(this.container, "ran-checkbox-checked")), this.syncA11yAndForm();
|
|
65
65
|
};
|
|
66
66
|
syncA11yAndForm = () => {
|
|
67
67
|
const { checked: e } = this.context;
|
package/dist/checkbox.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as v, h as l, i as x, n as m, r as P, s as h, t as y } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as w } from "./events-C59wGdni.js";
|
|
3
|
-
import { i as S, r as p } from "./signal-
|
|
3
|
+
import { i as S, r as p } from "./signal-CSSZxlK5.js";
|
|
4
4
|
import { _ as u, h as A, i as n } from "./factory-BdsO0dEW.js";
|
|
5
5
|
import { a as $, n as _ } from "./ssr-DSGwPtEd.js";
|
|
6
|
-
import "./input-
|
|
7
|
-
import "./select-
|
|
8
|
-
import "./popover-
|
|
6
|
+
import "./input-BM6e_LQr.js";
|
|
7
|
+
import "./select-BSeCT9tF.js";
|
|
8
|
+
import "./popover-DRUQjdPs.js";
|
|
9
9
|
var D = (e) => {
|
|
10
10
|
const { r: t, g: i, b: r } = I(e);
|
|
11
11
|
return f(t, i, r);
|
|
@@ -71,7 +71,7 @@ var D = (e) => {
|
|
|
71
71
|
k(e),
|
|
72
72
|
k(t),
|
|
73
73
|
k(i)
|
|
74
|
-
].join(""), C = /^#([\da-f]{6}|[\da-f]{3})$/i, E = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/, R = /^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3}(\.\d+)?)\)$/, V = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-colorpicker{box-sizing:border-box;min-width:32px;height:32px;border-radius:var(--ran-colorpicker-border-radius, var(--ran-radius-md, 8px));border:var(--ran-colorpicker-border, 1px solid var(--ran-color-border, #
|
|
74
|
+
].join(""), C = /^#([\da-f]{6}|[\da-f]{3})$/i, E = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/, R = /^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3}(\.\d+)?)\)$/, V = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-colorpicker{box-sizing:border-box;min-width:32px;height:32px;border-radius:var(--ran-colorpicker-border-radius, var(--ran-radius-md, 8px));border:var(--ran-colorpicker-border, 1px solid var(--ran-color-border, #eaeaea));cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:var(--ran-colorpicker-transition, border-color .2s, box-shadow .2s);background:var(--ran-colorpicker-background, var(--ran-color-bg-elevated, #ffffff));padding:3px}.ran-colorpicker:hover{border-color:var(--ran-colorpicker-border-hover, var(--ran-color-border-hover, var(--ran-gray-500)))}.ran-colorpicker-block{position:relative;border-radius:var(--ran-colorpicker-block-border-radius, var(--ran-radius-sm, 4px));width:24px;height:24px;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));background-image:conic-gradient(var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 25%,transparent 0 50%,var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 75%,transparent 0);background-size:50% 50%}.ran-colorpicker-inner{width:100%;height:100%;border-radius:inherit}.ran-colorpicker-block[disabled]{cursor:var(--ran-colorpicker-disabled-cursor, not-allowed);opacity:var(--ran-colorpicker-disabled-opacity, .5)}", H = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-color-picker-inner{box-sizing:border-box}.ran-color-picker-inner-content{box-sizing:border-box;display:flex;flex-direction:column;gap:12px;width:224px;padding:12px;font-family:var(--ran-font-family, inherit)}.ran-color-picker-inner-content *,.ran-color-picker-inner-content *:before,.ran-color-picker-inner-content *:after{box-sizing:border-box}.ran-color-picker-palette{position:relative;width:100%;height:160px;border-radius:var(--ran-radius-sm, 6px);overflow:hidden;cursor:crosshair;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));touch-action:none}.ran-color-picker-saturation{position:absolute;inset:0;border-radius:inherit;background-image:linear-gradient(to top,#000,#0000),linear-gradient(to right,#fff,#fff0)}.ran-color-picker-palette-dot{position:absolute;top:0;left:0;z-index:2;width:14px;height:14px;transform:translate(-50%,-50%);border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #0003,0 1px 3px #00000059;pointer-events:none}.ran-color-picker-controls{display:flex;align-items:center;gap:12px}.ran-color-picker-preview{position:relative;flex:none;width:28px;height:28px;border-radius:50%;overflow:hidden;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));background-image:conic-gradient(var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 25%,transparent 0 50%,var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 75%,transparent 0);background-size:12px 12px}.ran-color-picker-preview-inner{position:absolute;inset:0;border-radius:inherit}.ran-color-picker-sliders{flex:1;min-width:0;display:flex;flex-direction:column;gap:12px}.ran-color-picker-slider{position:relative;height:10px;border-radius:999px;cursor:pointer;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));touch-action:none}.ran-color-picker-slider-hue{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.ran-color-picker-slider-alpha{background-image:conic-gradient(var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 25%,transparent 0 50%,var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 75%,transparent 0);background-size:8px 8px}.ran-color-picker-slider-alpha-track{position:absolute;inset:0;border-radius:inherit}.ran-color-picker-slider-thumb{position:absolute;top:50%;left:0;z-index:1;width:14px;height:14px;transform:translate(-50%,-50%);border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #0003,0 1px 3px #00000059;pointer-events:none}.ran-color-picker-input-container{display:flex;align-items:center;gap:8px}.ran-color-picker-format{flex:none;width:68px}.ran-color-picker-value{flex:1;min-width:0}", d = 360, F = class extends _ {
|
|
75
75
|
colorpicker;
|
|
76
76
|
colorpickerInner;
|
|
77
77
|
context;
|
|
@@ -104,8 +104,8 @@ var D = (e) => {
|
|
|
104
104
|
];
|
|
105
105
|
}
|
|
106
106
|
constructor() {
|
|
107
|
-
super(), this._shadowDom =
|
|
108
|
-
const e =
|
|
107
|
+
super(), this._shadowDom = m(this, V);
|
|
108
|
+
const e = y(this._shadowDom, "r-popover", () => {
|
|
109
109
|
const t = n().class("ran-colorpicker-inner").part("swatch").build(), i = n().class("ran-colorpicker-block").part("block").children(t).build(), r = u("r-content").class("ran-content").build();
|
|
110
110
|
return u("r-popover").class("ran-popover").attr("trigger", "click").children(i, r).build();
|
|
111
111
|
});
|
|
@@ -118,10 +118,10 @@ var D = (e) => {
|
|
|
118
118
|
this.setAttribute("value", e);
|
|
119
119
|
}
|
|
120
120
|
get sheet() {
|
|
121
|
-
return
|
|
121
|
+
return P(this, "sheet");
|
|
122
122
|
}
|
|
123
123
|
set sheet(e) {
|
|
124
|
-
|
|
124
|
+
x(this, "sheet", e);
|
|
125
125
|
}
|
|
126
126
|
get disabled() {
|
|
127
127
|
return h(this);
|
|
@@ -130,7 +130,7 @@ var D = (e) => {
|
|
|
130
130
|
e === !1 || e === void 0 || e === null ? this.removeAttribute("disabled") : this.setAttribute("disabled", "");
|
|
131
131
|
}
|
|
132
132
|
handlerExternalCss = () => {
|
|
133
|
-
|
|
133
|
+
v(this, this._shadowDom, "sheet", null, this.sheet);
|
|
134
134
|
};
|
|
135
135
|
syncDisabledState = () => {
|
|
136
136
|
const e = h(this);
|
package/dist/colorpicker.js
CHANGED
|
@@ -20,7 +20,7 @@ export declare class Button extends RanElement {
|
|
|
20
20
|
set icon(value: string | null);
|
|
21
21
|
get effect(): string;
|
|
22
22
|
set effect(value: string | null);
|
|
23
|
-
/** Visual variant: `''` (default) | `'primary'` | `'warning'` | `'text'`. Drives the `:host([type=...])` styles. */
|
|
23
|
+
/** Visual variant: `''` (default) | `'primary'` | `'contrast'` | `'warning'` | `'text'`. Drives the `:host([type=...])` styles. */
|
|
24
24
|
get type(): string;
|
|
25
25
|
set type(value: string | null);
|
|
26
26
|
/**
|
|
@@ -13,6 +13,9 @@ export declare class Card extends RanElement {
|
|
|
13
13
|
set description(value: string);
|
|
14
14
|
get sheet(): string;
|
|
15
15
|
set sheet(value: string);
|
|
16
|
+
/** Interactive card (Geist): hover darkens the border and lifts to the elevated shadow tier. Purely presentational — gate it to cards that are actually clickable. */
|
|
17
|
+
get hoverable(): boolean;
|
|
18
|
+
set hoverable(value: boolean);
|
|
16
19
|
private _syncTitle;
|
|
17
20
|
private _syncDescription;
|
|
18
21
|
connectedCallback(): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EventManager } from '@/utils/builder';
|
|
2
|
+
import { RanElement } from '@/utils/index';
|
|
3
|
+
import type { RanThemeName } from '@/utils/theme';
|
|
4
|
+
/**
|
|
5
|
+
* `<r-theme-switch>` — a three-state (system / light / dark) segmented control
|
|
6
|
+
* wired to ranui's theme API (`setTheme`/`getTheme`, localStorage `ran-theme`).
|
|
7
|
+
* Multiple instances on one page stay in sync; `label-*` attributes localize
|
|
8
|
+
* the aria-labels. Emits a composed `change` event with `{ theme }`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ThemeSwitch extends RanElement {
|
|
11
|
+
static get observedAttributes(): string[];
|
|
12
|
+
_events: EventManager;
|
|
13
|
+
_shadowDom: ShadowRoot;
|
|
14
|
+
_group: HTMLDivElement;
|
|
15
|
+
constructor();
|
|
16
|
+
get sheet(): string;
|
|
17
|
+
set sheet(v: string);
|
|
18
|
+
/** Current selection; falls back to 'system' when nothing is forced. */
|
|
19
|
+
get value(): RanThemeName;
|
|
20
|
+
set value(v: RanThemeName);
|
|
21
|
+
_label(choice: RanThemeName): string;
|
|
22
|
+
_syncLabels(): void;
|
|
23
|
+
_reflect(): void;
|
|
24
|
+
_select(choice: RanThemeName): void;
|
|
25
|
+
/** Keep <meta name="theme-color"> (browser/PWA chrome) in step. Forced
|
|
26
|
+
* themes get the page's resolved background (no hardcoded colors); 'system'
|
|
27
|
+
* restores each meta's original — possibly media-qualified — content. */
|
|
28
|
+
_syncMeta(choice: RanThemeName): void;
|
|
29
|
+
_handleClick: (event: MouseEvent) => void;
|
|
30
|
+
_handleSync: () => void;
|
|
31
|
+
handlerExternalCss: () => void;
|
|
32
|
+
connectedCallback(): void;
|
|
33
|
+
disconnectedCallback(): void;
|
|
34
|
+
attributeChangedCallback(name: string, old: string, next: string): void;
|
|
35
|
+
}
|
|
36
|
+
export default ThemeSwitch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as w, c as i, f as d, i as o, n as p, r as a, t as h } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { i as n, p as l } from "./factory-BdsO0dEW.js";
|
|
3
3
|
import { a as c, n as f } from "./ssr-DSGwPtEd.js";
|
|
4
4
|
var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}@keyframes ranui-dropdown-up-in{0%{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}to{transform:scaleY(1);transform-origin:100% 100%;opacity:1}}@keyframes ranui-dropdown-up-out{0%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}to{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}}@keyframes ranui-dropdown-down-in{0%{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-down-out{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}to{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}}@keyframes ranui-dropdown-left-in{0%{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}to{transform:scaleX(1);transform-origin:100% 0%;opacity:1}}@keyframes ranui-dropdown-left-out{0%{transform:scaleX(1);transform-origin:100% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}}@keyframes ranui-dropdown-right-in{0%{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleX(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-right-out{0%{transform:scaleX(1);transform-origin:0% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}}.ran-dropdown-down-in{animation:ranui-dropdown-down-in .1s;animation-fill-mode:forwards}.ran-dropdown-down-out{animation:ranui-dropdown-down-out .1s;animation-fill-mode:forwards}.ran-dropdown-up-in{animation:ranui-dropdown-up-in .1s;animation-fill-mode:forwards}.ran-dropdown-up-out{animation:ranui-dropdown-up-out .1s;animation-fill-mode:forwards}.ran-dropdown-left-in{animation:ranui-dropdown-left-in .1s;animation-fill-mode:forwards}.ran-dropdown-left-out{animation:ranui-dropdown-left-out .1s;animation-fill-mode:forwards}.ran-dropdown-right-in{animation:ranui-dropdown-right-in .1s;animation-fill-mode:forwards}.ran-dropdown-right-out{animation:ranui-dropdown-right-out .1s;animation-fill-mode:forwards}:host{text-align:var(--ran-dropdown-host-text-align, left);z-index:var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, 1100))}.ranui-dropdown{transform-origin:var(--ran-x, 50%) var(--ran-y, 50%);box-sizing:var(--ran-dropdown-box-sizing, border-box);margin:var(--ran-dropdown-margin, 0);padding:var(--ran-dropdown-padding, 0);color:var(--ran-dropdown-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-dropdown-font-size, 14px);list-style:var(--ran-dropdown-list-style, none);font-family:var(--ran-dropdown-font-family, var(--ran-skin-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index, 1050);overflow:var(--ran-dropdown-overflow, hidden);font-variant:var(--ran-dropdown-font-variant, initial);background:var(--ran-dropdown-background, var(--ran-color-bg-elevated, #ffffff));border-radius:var(--ran-dropdown-border-radius, var(--ran-radius-md, 12px));outline:var(--ran-dropdown-outline, none);box-shadow:var(--ran-dropdown-box-shadow, var(--ran-shadow-menu, var(--ran-shadow-elevated, 0 6px 16px 0 rgba(0, 0, 0, .08), 0 3px 6px -4px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05))));cursor:var(--ran-dropdown-cursor, auto);width:var(--ran-dropdown-width, 100%);height:var(--ran-dropdown-height, 100%);min-height:var(--ran-dropdown-min-height, 100%);min-width:var(--ran-dropdown-min-width, 100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position, relative);display:var(--ran-dropdown-container-display, block);width:var(--ran-dropdown-container-width, 100%);height:var(--ran-dropdown-container-height, 100%);box-sizing:var(--ran-dropdown-container-box-sizing, border-box)}.ranui-dropdown-container .top{transform:translate(calc(var(--ran-dropdown-arrow-anchor-width, var(--ran-dropdown-min-width, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px)) + var(--ran-dropdown-arrow-overlap, 2px))) rotate(0);top:0}.ranui-dropdown-container .bottom{transform:translate(calc(var(--ran-dropdown-arrow-anchor-width, var(--ran-dropdown-min-width, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap, 2px)) rotate(180deg);top:max(0px,calc(var(--ran-dropdown-min-height, 100%) - calc(var(--ran-dropdown-arrow-width, 16px) / 4)))}.ranui-dropdown-container .left{transform:translate(calc(0px - var(--ran-dropdown-arrow-width, 16px))) translateY(calc(var(--ran-dropdown-arrow-width, 16px) / 2 + var(--ran-dropdown-arrow-overlap, 2px))) rotate(270deg);top:max(0px,calc(var(--ran-dropdown-arrow-anchor-height, var(--ran-dropdown-min-height, 100%)) / 2 - var(--ran-dropdown-arrow-width, 16px)))}.ranui-dropdown-container .right{left:100%;transform:translate(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height, var(--ran-dropdown-min-height, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2) + var(--ran-dropdown-arrow-overlap, 2px))) rotate(90deg);top:0}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position, absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing, border-box);z-index:var(--ran-dropdown-arrow-z-index, 1);display:var(--ran-dropdown-arrow-display, block);pointer-events:var(--ran-dropdown-arrow-pointer-events, none);width:var(--ran-dropdown-arrow-width, var(--ran-dropdown-arrow-width, 16px));height:var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px));overflow:var(--ran-dropdown-arrow-overflow, hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background, var(--ran-color-bg-elevated, #fff));position:var(--ran-dropdown-arrow-before-position, absolute);bottom:var(--ran-dropdown-arrow-before-bottom, 0);inset-inline-start:0;width:var(--ran-dropdown-arrow-before-width, var(--ran-dropdown-arrow-width, 16px));height:var(--ran-dropdown-arrow-before-height, calc(var(--ran-dropdown-arrow-width, 16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content, "")}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content, "");position:var(--ran-dropdown-arrow-after-position, absolute);width:var(--ran-dropdown-arrow-after-width, 9px);height:var(--ran-dropdown-arrow-after-height, 9px);bottom:var(--ran-dropdown-arrow-after-bottom, 0);inset-inline:0;margin:var(--ran-dropdown-arrow-after-margin, auto);border-radius:var(--ran-dropdown-arrow-after-border-radius, 0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform, translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow, 2px 2px 5px rgba(0, 0, 0, .05));z-index:var(--ran-dropdown-arrow-after-z-index, 0);background:var(--ran-dropdown-arrow-after-background, var(--ran-color-bg-elevated, #fff))}', e = 300, x = /* @__PURE__ */ (function(r) {
|
|
@@ -17,30 +17,30 @@ var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
17
17
|
];
|
|
18
18
|
}
|
|
19
19
|
constructor() {
|
|
20
|
-
super(), this._shadowDom =
|
|
20
|
+
super(), this._shadowDom = p(this, m);
|
|
21
21
|
const r = h(this._shadowDom, ".ranui-dropdown-container", () => n().class("ranui-dropdown-container").children(n().style("-webkit-tap-highlight-color", "transparent").style("outline", "0").class("ranui-dropdown").part("dropdown").children(l().class("slot"))).build());
|
|
22
22
|
this.container = r, this.dropdown = r.querySelector(".ranui-dropdown"), this._slot = r.querySelector(".slot");
|
|
23
23
|
}
|
|
24
24
|
get transit() {
|
|
25
|
-
return
|
|
25
|
+
return a(this, "transit");
|
|
26
26
|
}
|
|
27
27
|
set transit(r) {
|
|
28
|
-
|
|
28
|
+
o(this, "transit", r, { removeEmpty: !0 });
|
|
29
29
|
}
|
|
30
30
|
get arrow() {
|
|
31
|
-
return
|
|
31
|
+
return a(this, "arrow");
|
|
32
32
|
}
|
|
33
33
|
set arrow(r) {
|
|
34
|
-
|
|
34
|
+
o(this, "arrow", r, { removeEmpty: !0 });
|
|
35
35
|
}
|
|
36
36
|
get sheet() {
|
|
37
|
-
return
|
|
37
|
+
return a(this, "sheet");
|
|
38
38
|
}
|
|
39
39
|
set sheet(r) {
|
|
40
|
-
|
|
40
|
+
o(this, "sheet", r);
|
|
41
41
|
}
|
|
42
42
|
handlerExternalCss = () => {
|
|
43
|
-
|
|
43
|
+
w(this, this._shadowDom, "sheet", null, this.sheet);
|
|
44
44
|
};
|
|
45
45
|
handlerTransit = () => {
|
|
46
46
|
this.transit && this.dropdown && (i(this.dropdown, this.transit), setTimeout(() => {
|
package/dist/dropdown.js
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Copyright (c) 2023 Vercel, in collaboration with basement.studio
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
-----------------------------------------------------------
|
|
8
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
PREAMBLE
|
|
12
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
13
|
+
development of collaborative font projects, to support the font creation
|
|
14
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
15
|
+
open framework in which fonts may be shared and improved in partnership
|
|
16
|
+
with others.
|
|
17
|
+
|
|
18
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
19
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
20
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
21
|
+
redistributed and/or sold with any software provided that any reserved
|
|
22
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
23
|
+
however, cannot be released under any other type of license. The
|
|
24
|
+
requirement for fonts to remain under this license does not apply
|
|
25
|
+
to any document created using the fonts or their derivatives.
|
|
26
|
+
|
|
27
|
+
DEFINITIONS
|
|
28
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
29
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
30
|
+
include source files, build scripts and documentation.
|
|
31
|
+
|
|
32
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
33
|
+
copyright statement(s).
|
|
34
|
+
|
|
35
|
+
"Original Version" refers to the collection of Font Software components as
|
|
36
|
+
distributed by the Copyright Holder(s).
|
|
37
|
+
|
|
38
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
39
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
40
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
41
|
+
new environment.
|
|
42
|
+
|
|
43
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
44
|
+
writer or other person who contributed to the Font Software.
|
|
45
|
+
|
|
46
|
+
PERMISSION AND CONDITIONS
|
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
48
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
49
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
50
|
+
Software, subject to the following conditions:
|
|
51
|
+
|
|
52
|
+
1) Neither the Font Software nor any of its individual components,
|
|
53
|
+
in Original or Modified Versions, may be sold by itself.
|
|
54
|
+
|
|
55
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
56
|
+
redistributed and/or sold with any software, provided that each copy
|
|
57
|
+
contains the above copyright notice and this license. These can be
|
|
58
|
+
included either as stand-alone text files, human-readable headers or
|
|
59
|
+
in the appropriate machine-readable metadata fields within text or
|
|
60
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
61
|
+
|
|
62
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
63
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
64
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
65
|
+
presented to the users.
|
|
66
|
+
|
|
67
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
68
|
+
Software shall not be used to promote, endorse or advertise any
|
|
69
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
70
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
71
|
+
permission.
|
|
72
|
+
|
|
73
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
74
|
+
must be distributed entirely under this license, and must not be
|
|
75
|
+
distributed under any other license. The requirement for fonts to
|
|
76
|
+
remain under this license does not apply to any document created
|
|
77
|
+
using the Font Software.
|
|
78
|
+
|
|
79
|
+
TERMINATION
|
|
80
|
+
This license becomes null and void if any of the above conditions are
|
|
81
|
+
not met.
|
|
82
|
+
|
|
83
|
+
DISCLAIMER
|
|
84
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
85
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
86
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
87
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
88
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
89
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
90
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
91
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
92
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* Geist Sans + Geist Mono (variable weight), self-hosted.
|
|
2
|
+
© Vercel, in collaboration with basement.studio — SIL Open Font License 1.1
|
|
3
|
+
(see ./OFL-LICENSE.txt). Shipped with ranui so consumers of the design
|
|
4
|
+
system get the canonical faces behind --ran-font-family / --ran-font-mono
|
|
5
|
+
with one import, offline-friendly (no CDN):
|
|
6
|
+
|
|
7
|
+
import 'ranui/fonts'; // bundlers
|
|
8
|
+
<link rel="stylesheet" href=".../ranui/dist/fonts/fonts.css" /> // static
|
|
9
|
+
|
|
10
|
+
URLs are relative, so keep this file next to the .woff2 files when copying. */
|
|
11
|
+
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'Geist';
|
|
14
|
+
src: url('./Geist-Variable.woff2') format('woff2-variations');
|
|
15
|
+
font-weight: 100 900;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-display: swap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: 'Geist Mono';
|
|
22
|
+
src: url('./GeistMono-Variable.woff2') format('woff2-variations');
|
|
23
|
+
font-weight: 100 900;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-display: swap;
|
|
26
|
+
}
|