@threadlabs/looma 0.52.5 → 0.52.6
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/components/ui-notice-stripe/ui-notice-stripe.html +109 -0
- package/components/ui-notice-stripe/ui-notice-stripe.js +13 -0
- package/dist/index.js +28 -27
- package/docs/catalog.json +248 -1
- package/docs/examples/ui-notice-stripe/examples/02-service-notice.behavior.js +7 -0
- package/package.json +1 -1
- package/styles/ui-notice-stripe.css +172 -0
- package/vanilla/UiNoticeStripe.d.ts +26 -0
- package/vanilla/UiNoticeStripe.js +89 -0
- package/vanilla/index.js +1 -0
package/docs/catalog.json
CHANGED
|
@@ -497,6 +497,13 @@
|
|
|
497
497
|
"angularHost": "ng-template",
|
|
498
498
|
"resource": "@threadlabs/looma/components/ui-nav-item/ui-nav-item.html"
|
|
499
499
|
},
|
|
500
|
+
{
|
|
501
|
+
"tag": "ui-notice-stripe",
|
|
502
|
+
"package": "@threadlabs/looma",
|
|
503
|
+
"root": "div",
|
|
504
|
+
"angularHost": "div",
|
|
505
|
+
"resource": "@threadlabs/looma/components/ui-notice-stripe/ui-notice-stripe.html"
|
|
506
|
+
},
|
|
500
507
|
{
|
|
501
508
|
"tag": "ui-number-input",
|
|
502
509
|
"package": "@threadlabs/looma",
|
|
@@ -752,7 +759,7 @@
|
|
|
752
759
|
],
|
|
753
760
|
"schemaVersion": 1,
|
|
754
761
|
"package": "@threadlabs/looma",
|
|
755
|
-
"version": "0.52.
|
|
762
|
+
"version": "0.52.6",
|
|
756
763
|
"groups": [
|
|
757
764
|
{
|
|
758
765
|
"id": "layout",
|
|
@@ -24484,6 +24491,246 @@
|
|
|
24484
24491
|
}
|
|
24485
24492
|
]
|
|
24486
24493
|
},
|
|
24494
|
+
{
|
|
24495
|
+
"angularHost": "div",
|
|
24496
|
+
"tag": "ui-notice-stripe",
|
|
24497
|
+
"package": "@threadlabs/looma",
|
|
24498
|
+
"root": "div",
|
|
24499
|
+
"description": "A compact, full-width notification for announcements and service notices. The default slot carries the message and the actions slot carries links or buttons. Content wraps at narrow widths. Optional dismissal reports intent while the consumer owns visibility, persistence and scheduling.",
|
|
24500
|
+
"designTokens": {
|
|
24501
|
+
"sources": [
|
|
24502
|
+
"packages/looma/src/components/ui-notice-stripe/ui-notice-stripe.html"
|
|
24503
|
+
],
|
|
24504
|
+
"component": [],
|
|
24505
|
+
"shared": [
|
|
24506
|
+
{
|
|
24507
|
+
"name": "--ui-border-strong"
|
|
24508
|
+
},
|
|
24509
|
+
{
|
|
24510
|
+
"name": "--ui-border-width"
|
|
24511
|
+
},
|
|
24512
|
+
{
|
|
24513
|
+
"name": "--ui-danger-soft"
|
|
24514
|
+
},
|
|
24515
|
+
{
|
|
24516
|
+
"name": "--ui-danger-soft-border"
|
|
24517
|
+
},
|
|
24518
|
+
{
|
|
24519
|
+
"name": "--ui-danger-subtle-text"
|
|
24520
|
+
},
|
|
24521
|
+
{
|
|
24522
|
+
"name": "--ui-font-family-sans"
|
|
24523
|
+
},
|
|
24524
|
+
{
|
|
24525
|
+
"name": "--ui-font-normal"
|
|
24526
|
+
},
|
|
24527
|
+
{
|
|
24528
|
+
"name": "--ui-font-size-sm"
|
|
24529
|
+
},
|
|
24530
|
+
{
|
|
24531
|
+
"name": "--ui-info-soft"
|
|
24532
|
+
},
|
|
24533
|
+
{
|
|
24534
|
+
"name": "--ui-info-soft-border"
|
|
24535
|
+
},
|
|
24536
|
+
{
|
|
24537
|
+
"name": "--ui-info-subtle-text"
|
|
24538
|
+
},
|
|
24539
|
+
{
|
|
24540
|
+
"name": "--ui-line-height-md"
|
|
24541
|
+
},
|
|
24542
|
+
{
|
|
24543
|
+
"name": "--ui-space-1"
|
|
24544
|
+
},
|
|
24545
|
+
{
|
|
24546
|
+
"name": "--ui-space-2"
|
|
24547
|
+
},
|
|
24548
|
+
{
|
|
24549
|
+
"name": "--ui-space-3"
|
|
24550
|
+
},
|
|
24551
|
+
{
|
|
24552
|
+
"name": "--ui-success-soft"
|
|
24553
|
+
},
|
|
24554
|
+
{
|
|
24555
|
+
"name": "--ui-success-soft-border"
|
|
24556
|
+
},
|
|
24557
|
+
{
|
|
24558
|
+
"name": "--ui-success-subtle-text"
|
|
24559
|
+
},
|
|
24560
|
+
{
|
|
24561
|
+
"name": "--ui-surface-muted"
|
|
24562
|
+
},
|
|
24563
|
+
{
|
|
24564
|
+
"name": "--ui-text-primary"
|
|
24565
|
+
},
|
|
24566
|
+
{
|
|
24567
|
+
"name": "--ui-warning-soft"
|
|
24568
|
+
},
|
|
24569
|
+
{
|
|
24570
|
+
"name": "--ui-warning-soft-border"
|
|
24571
|
+
},
|
|
24572
|
+
{
|
|
24573
|
+
"name": "--ui-warning-subtle-text"
|
|
24574
|
+
}
|
|
24575
|
+
]
|
|
24576
|
+
},
|
|
24577
|
+
"attributes": [
|
|
24578
|
+
{
|
|
24579
|
+
"name": "dismiss-label",
|
|
24580
|
+
"property": "dismissLabel",
|
|
24581
|
+
"description": "Accessible name of the close control, including translated or message-specific wording.",
|
|
24582
|
+
"type": "string",
|
|
24583
|
+
"valueType": {
|
|
24584
|
+
"kind": "terminal",
|
|
24585
|
+
"name": "string"
|
|
24586
|
+
},
|
|
24587
|
+
"default": "Dismiss notification"
|
|
24588
|
+
},
|
|
24589
|
+
{
|
|
24590
|
+
"name": "dismissible",
|
|
24591
|
+
"property": "dismissible",
|
|
24592
|
+
"description": "Show a close control that requests dismissal. The consumer owns removing or hiding the stripe.",
|
|
24593
|
+
"type": "boolean",
|
|
24594
|
+
"valueType": {
|
|
24595
|
+
"kind": "terminal",
|
|
24596
|
+
"name": "boolean"
|
|
24597
|
+
},
|
|
24598
|
+
"default": false
|
|
24599
|
+
},
|
|
24600
|
+
{
|
|
24601
|
+
"name": "tone",
|
|
24602
|
+
"property": "tone",
|
|
24603
|
+
"description": "Semantic message tone. Danger uses alert semantics; other tones use a polite status.",
|
|
24604
|
+
"type": "keyword",
|
|
24605
|
+
"valueType": {
|
|
24606
|
+
"kind": "terminal",
|
|
24607
|
+
"name": "keyword"
|
|
24608
|
+
},
|
|
24609
|
+
"default": "info",
|
|
24610
|
+
"options": [
|
|
24611
|
+
"neutral",
|
|
24612
|
+
"info",
|
|
24613
|
+
"success",
|
|
24614
|
+
"warning",
|
|
24615
|
+
"danger"
|
|
24616
|
+
]
|
|
24617
|
+
}
|
|
24618
|
+
],
|
|
24619
|
+
"properties": [
|
|
24620
|
+
{
|
|
24621
|
+
"name": "dismissible",
|
|
24622
|
+
"description": "Show a close control that requests dismissal. The consumer owns removing or hiding the stripe.",
|
|
24623
|
+
"type": "boolean",
|
|
24624
|
+
"default": false
|
|
24625
|
+
},
|
|
24626
|
+
{
|
|
24627
|
+
"name": "dismissLabel",
|
|
24628
|
+
"description": "Accessible name of the close control, including translated or message-specific wording.",
|
|
24629
|
+
"type": "string",
|
|
24630
|
+
"default": "Dismiss notification"
|
|
24631
|
+
},
|
|
24632
|
+
{
|
|
24633
|
+
"name": "tone",
|
|
24634
|
+
"description": "Semantic message tone. Danger uses alert semantics; other tones use a polite status.",
|
|
24635
|
+
"type": "\"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\"",
|
|
24636
|
+
"default": "info",
|
|
24637
|
+
"options": [
|
|
24638
|
+
"neutral",
|
|
24639
|
+
"info",
|
|
24640
|
+
"success",
|
|
24641
|
+
"warning",
|
|
24642
|
+
"danger"
|
|
24643
|
+
]
|
|
24644
|
+
}
|
|
24645
|
+
],
|
|
24646
|
+
"events": [
|
|
24647
|
+
{
|
|
24648
|
+
"name": "dismiss",
|
|
24649
|
+
"detailType": "{ readonly reason: \"action\"; readonly trigger: \"keyboard\" | \"pointer\" | \"programmatic\" }",
|
|
24650
|
+
"detailSchema": "object",
|
|
24651
|
+
"fields": [
|
|
24652
|
+
{
|
|
24653
|
+
"path": "reason",
|
|
24654
|
+
"type": "keyword",
|
|
24655
|
+
"required": true,
|
|
24656
|
+
"values": [
|
|
24657
|
+
"action"
|
|
24658
|
+
]
|
|
24659
|
+
},
|
|
24660
|
+
{
|
|
24661
|
+
"path": "trigger",
|
|
24662
|
+
"type": "keyword",
|
|
24663
|
+
"required": true,
|
|
24664
|
+
"values": [
|
|
24665
|
+
"keyboard",
|
|
24666
|
+
"pointer",
|
|
24667
|
+
"programmatic"
|
|
24668
|
+
]
|
|
24669
|
+
}
|
|
24670
|
+
],
|
|
24671
|
+
"detailDocs": "Emitted when a toast item is dismissed from its region."
|
|
24672
|
+
}
|
|
24673
|
+
],
|
|
24674
|
+
"slots": [
|
|
24675
|
+
{
|
|
24676
|
+
"name": "default",
|
|
24677
|
+
"description": "Default child content."
|
|
24678
|
+
},
|
|
24679
|
+
{
|
|
24680
|
+
"name": "actions",
|
|
24681
|
+
"description": "Named content for the actions region."
|
|
24682
|
+
}
|
|
24683
|
+
],
|
|
24684
|
+
"summary": "Edge-to-edge announcements with optional actions and dismissal.",
|
|
24685
|
+
"group": "display",
|
|
24686
|
+
"id": "@threadlabs/looma/ui-notice-stripe",
|
|
24687
|
+
"title": "Notice Stripe",
|
|
24688
|
+
"resource": "@threadlabs/looma/components/ui-notice-stripe/ui-notice-stripe.html",
|
|
24689
|
+
"targets": [
|
|
24690
|
+
"html-next",
|
|
24691
|
+
"vue",
|
|
24692
|
+
"react",
|
|
24693
|
+
"preact",
|
|
24694
|
+
"svelte",
|
|
24695
|
+
"angular"
|
|
24696
|
+
],
|
|
24697
|
+
"examples": [
|
|
24698
|
+
{
|
|
24699
|
+
"id": "@threadlabs/looma/ui-notice-stripe/01-announcement",
|
|
24700
|
+
"name": "01-announcement",
|
|
24701
|
+
"title": "Announcement with action",
|
|
24702
|
+
"description": "A compact announcement keeps a related guide link at the trailing edge.",
|
|
24703
|
+
"markup": "<ui-notice-stripe>New documentation is available.<ui-button slot=\"actions\" variant=\"link\" size=\"sm\" href=\"#documentation\"\n >Read the guide</ui-button></ui-notice-stripe>",
|
|
24704
|
+
"resizable": false,
|
|
24705
|
+
"stretch": true,
|
|
24706
|
+
"bindings": "",
|
|
24707
|
+
"frameworks": {}
|
|
24708
|
+
},
|
|
24709
|
+
{
|
|
24710
|
+
"id": "@threadlabs/looma/ui-notice-stripe/02-service-notice",
|
|
24711
|
+
"name": "02-service-notice",
|
|
24712
|
+
"title": "Dismissible service notice",
|
|
24713
|
+
"description": "The application hides this maintenance notice after the close control requests dismissal.",
|
|
24714
|
+
"markup": "<ui-notice-stripe data-example-id=\"maintenance-notice\" tone=\"warning\" dismissible dismiss-label=\"Dismiss maintenance notice\">Scheduled maintenance starts at\n 22:00 UTC. Some actions may take longer during this time.<ui-button slot=\"actions\" variant=\"link\" size=\"sm\" href=\"#status\"\n >Service status</ui-button></ui-notice-stripe>",
|
|
24715
|
+
"resizable": false,
|
|
24716
|
+
"stretch": true,
|
|
24717
|
+
"bindings": "",
|
|
24718
|
+
"frameworks": {},
|
|
24719
|
+
"behavior": "@threadlabs/looma/docs/examples/ui-notice-stripe/examples/02-service-notice.behavior.js"
|
|
24720
|
+
},
|
|
24721
|
+
{
|
|
24722
|
+
"id": "@threadlabs/looma/ui-notice-stripe/03-tones",
|
|
24723
|
+
"name": "03-tones",
|
|
24724
|
+
"title": "Semantic tones",
|
|
24725
|
+
"description": "The shared semantic palette communicates information, status and urgency.",
|
|
24726
|
+
"markup": "<ui-stack gap=\"xs\">\n <ui-notice-stripe tone=\"neutral\">Neutral notice.</ui-notice-stripe>\n <ui-notice-stripe tone=\"info\">Info notice.</ui-notice-stripe>\n <ui-notice-stripe tone=\"success\">Success notice.</ui-notice-stripe>\n <ui-notice-stripe tone=\"warning\">Warning notice.</ui-notice-stripe>\n <ui-notice-stripe tone=\"danger\">Danger notice.</ui-notice-stripe>\n</ui-stack>",
|
|
24727
|
+
"resizable": false,
|
|
24728
|
+
"stretch": true,
|
|
24729
|
+
"bindings": "",
|
|
24730
|
+
"frameworks": {}
|
|
24731
|
+
}
|
|
24732
|
+
]
|
|
24733
|
+
},
|
|
24487
24734
|
{
|
|
24488
24735
|
"angularHost": "span",
|
|
24489
24736
|
"tag": "ui-number-input",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default function connect(root) {
|
|
2
|
+
const stripe = root.querySelector("[data-example-id=maintenance-notice]");
|
|
3
|
+
const dismiss = () => { if (stripe)
|
|
4
|
+
stripe.hidden = true; };
|
|
5
|
+
stripe?.addEventListener("dismiss", dismiss);
|
|
6
|
+
return () => stripe?.removeEventListener("dismiss", dismiss);
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* Generated by HTML Next 1.0.0-alpha.84. Do not edit. */
|
|
2
|
+
@supports (-moz-appearance: none) {
|
|
3
|
+
:where(:is([component]:not(template), [data-component]:not([component])), [data-slotted]) { --html-next-scope-owner: boundary; }
|
|
4
|
+
:where([data-slotted]:not(:is([component]:not(template), [data-component]:not([component])))) { --html-next-scope-owner: projected !important; }
|
|
5
|
+
}
|
|
6
|
+
@supports (-moz-appearance: none) {
|
|
7
|
+
:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])) { --html-next-scope-owner: "ui-notice-stripe" !important; }
|
|
8
|
+
}
|
|
9
|
+
@scope (:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component]))) to (:is([component]:not(template), [data-component]:not([component])), [data-slotted]) {
|
|
10
|
+
:scope:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component]))) {
|
|
11
|
+
--_ui-notice-stripe-surface: var(--ui-info-soft);
|
|
12
|
+
--_ui-notice-stripe-border: var(--ui-info-soft-border);
|
|
13
|
+
--_ui-surface-text: var(--ui-info-subtle-text);
|
|
14
|
+
display: flex !important;
|
|
15
|
+
align-items: center !important;
|
|
16
|
+
gap: var(--ui-space-2) !important;
|
|
17
|
+
box-sizing: border-box !important;
|
|
18
|
+
inline-size: 100%;
|
|
19
|
+
min-inline-size: 0;
|
|
20
|
+
min-block-size: 44px;
|
|
21
|
+
margin: 0 !important;
|
|
22
|
+
padding: var(--ui-space-1) var(--ui-space-3) !important;
|
|
23
|
+
border: 0;
|
|
24
|
+
border-block-end: var(--ui-border-width) solid var(--_ui-notice-stripe-border);
|
|
25
|
+
border-radius: 0;
|
|
26
|
+
background: var(--_ui-notice-stripe-surface);
|
|
27
|
+
color: var(--_ui-surface-text);
|
|
28
|
+
font-family: var(--ui-font-family-sans);
|
|
29
|
+
font-size: var(--ui-font-size-sm);
|
|
30
|
+
font-weight: var(--ui-font-normal);
|
|
31
|
+
line-height: var(--ui-line-height-md);
|
|
32
|
+
}
|
|
33
|
+
:scope:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=neutral"] {
|
|
34
|
+
--_ui-notice-stripe-surface: var(--ui-surface-muted);
|
|
35
|
+
--_ui-notice-stripe-border: var(--ui-border-strong);
|
|
36
|
+
--_ui-surface-text: var(--ui-text-primary);
|
|
37
|
+
}
|
|
38
|
+
:scope:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=success"] {
|
|
39
|
+
--_ui-notice-stripe-surface: var(--ui-success-soft);
|
|
40
|
+
--_ui-notice-stripe-border: var(--ui-success-soft-border);
|
|
41
|
+
--_ui-surface-text: var(--ui-success-subtle-text);
|
|
42
|
+
}
|
|
43
|
+
:scope:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=warning"] {
|
|
44
|
+
--_ui-notice-stripe-surface: var(--ui-warning-soft);
|
|
45
|
+
--_ui-notice-stripe-border: var(--ui-warning-soft-border);
|
|
46
|
+
--_ui-surface-text: var(--ui-warning-subtle-text);
|
|
47
|
+
}
|
|
48
|
+
:scope:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=danger"] {
|
|
49
|
+
--_ui-notice-stripe-surface: var(--ui-danger-soft);
|
|
50
|
+
--_ui-notice-stripe-border: var(--ui-danger-soft-border);
|
|
51
|
+
--_ui-surface-text: var(--ui-danger-subtle-text);
|
|
52
|
+
}
|
|
53
|
+
.content {
|
|
54
|
+
display: flex !important;
|
|
55
|
+
flex: 1;
|
|
56
|
+
flex-wrap: wrap !important;
|
|
57
|
+
align-items: center !important;
|
|
58
|
+
gap: var(--ui-space-1) var(--ui-space-3) !important;
|
|
59
|
+
min-inline-size: 0;
|
|
60
|
+
}
|
|
61
|
+
.message {
|
|
62
|
+
flex: 1 1 16rem;
|
|
63
|
+
min-inline-size: 0;
|
|
64
|
+
overflow-wrap: anywhere;
|
|
65
|
+
}
|
|
66
|
+
.actions {
|
|
67
|
+
display: flex !important;
|
|
68
|
+
flex-wrap: wrap !important;
|
|
69
|
+
align-items: center !important;
|
|
70
|
+
justify-content: flex-end !important;
|
|
71
|
+
gap: var(--ui-space-2) !important;
|
|
72
|
+
min-inline-size: 0;
|
|
73
|
+
max-inline-size: 100%;
|
|
74
|
+
overflow-wrap: anywhere;
|
|
75
|
+
margin-inline-start: auto !important;
|
|
76
|
+
}
|
|
77
|
+
.actions:empty {
|
|
78
|
+
display: none !important;
|
|
79
|
+
}
|
|
80
|
+
.dismiss {
|
|
81
|
+
flex: none;
|
|
82
|
+
}
|
|
83
|
+
:scope:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[hidden] {
|
|
84
|
+
display: none !important;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
@scope (:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component]))) to (:is([component]:not(template), [data-component]:not([component]))) {
|
|
88
|
+
.message :where([data-slotted], [data-slotted] *):is(a),
|
|
89
|
+
.actions :where([data-slotted], [data-slotted] *):is(a) {
|
|
90
|
+
color: inherit;
|
|
91
|
+
text-decoration: underline;
|
|
92
|
+
text-underline-offset: 0.18em;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
@scope ([data-slotted~="ui-notice-stripe"]:not(:is([component]:not(template), [data-component]:not([component])))) to (:is([component]:not(template), [data-component]:not([component])), [data-slotted]) {
|
|
96
|
+
:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component]))):where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-notice-stripe"]))) {
|
|
97
|
+
--_ui-notice-stripe-surface: var(--ui-info-soft);
|
|
98
|
+
--_ui-notice-stripe-border: var(--ui-info-soft-border);
|
|
99
|
+
--_ui-surface-text: var(--ui-info-subtle-text);
|
|
100
|
+
display: flex !important;
|
|
101
|
+
align-items: center !important;
|
|
102
|
+
gap: var(--ui-space-2) !important;
|
|
103
|
+
box-sizing: border-box !important;
|
|
104
|
+
inline-size: 100%;
|
|
105
|
+
min-inline-size: 0;
|
|
106
|
+
min-block-size: 44px;
|
|
107
|
+
margin: 0 !important;
|
|
108
|
+
padding: var(--ui-space-1) var(--ui-space-3) !important;
|
|
109
|
+
border: 0;
|
|
110
|
+
border-block-end: var(--ui-border-width) solid var(--_ui-notice-stripe-border);
|
|
111
|
+
border-radius: 0;
|
|
112
|
+
background: var(--_ui-notice-stripe-surface);
|
|
113
|
+
color: var(--_ui-surface-text);
|
|
114
|
+
font-family: var(--ui-font-family-sans);
|
|
115
|
+
font-size: var(--ui-font-size-sm);
|
|
116
|
+
font-weight: var(--ui-font-normal);
|
|
117
|
+
line-height: var(--ui-line-height-md);
|
|
118
|
+
}
|
|
119
|
+
:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=neutral"]:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-notice-stripe"]))) {
|
|
120
|
+
--_ui-notice-stripe-surface: var(--ui-surface-muted);
|
|
121
|
+
--_ui-notice-stripe-border: var(--ui-border-strong);
|
|
122
|
+
--_ui-surface-text: var(--ui-text-primary);
|
|
123
|
+
}
|
|
124
|
+
:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=success"]:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-notice-stripe"]))) {
|
|
125
|
+
--_ui-notice-stripe-surface: var(--ui-success-soft);
|
|
126
|
+
--_ui-notice-stripe-border: var(--ui-success-soft-border);
|
|
127
|
+
--_ui-surface-text: var(--ui-success-subtle-text);
|
|
128
|
+
}
|
|
129
|
+
:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=warning"]:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-notice-stripe"]))) {
|
|
130
|
+
--_ui-notice-stripe-surface: var(--ui-warning-soft);
|
|
131
|
+
--_ui-notice-stripe-border: var(--ui-warning-soft-border);
|
|
132
|
+
--_ui-surface-text: var(--ui-warning-subtle-text);
|
|
133
|
+
}
|
|
134
|
+
:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[data-ui-notice-stripe-state~="tone=danger"]:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-notice-stripe"]))) {
|
|
135
|
+
--_ui-notice-stripe-surface: var(--ui-danger-soft);
|
|
136
|
+
--_ui-notice-stripe-border: var(--ui-danger-soft-border);
|
|
137
|
+
--_ui-surface-text: var(--ui-danger-subtle-text);
|
|
138
|
+
}
|
|
139
|
+
.content:where(:scope, :scope *) {
|
|
140
|
+
display: flex !important;
|
|
141
|
+
flex: 1;
|
|
142
|
+
flex-wrap: wrap !important;
|
|
143
|
+
align-items: center !important;
|
|
144
|
+
gap: var(--ui-space-1) var(--ui-space-3) !important;
|
|
145
|
+
min-inline-size: 0;
|
|
146
|
+
}
|
|
147
|
+
.message:where(:scope, :scope *) {
|
|
148
|
+
flex: 1 1 16rem;
|
|
149
|
+
min-inline-size: 0;
|
|
150
|
+
overflow-wrap: anywhere;
|
|
151
|
+
}
|
|
152
|
+
.actions:where(:scope, :scope *) {
|
|
153
|
+
display: flex !important;
|
|
154
|
+
flex-wrap: wrap !important;
|
|
155
|
+
align-items: center !important;
|
|
156
|
+
justify-content: flex-end !important;
|
|
157
|
+
gap: var(--ui-space-2) !important;
|
|
158
|
+
min-inline-size: 0;
|
|
159
|
+
max-inline-size: 100%;
|
|
160
|
+
overflow-wrap: anywhere;
|
|
161
|
+
margin-inline-start: auto !important;
|
|
162
|
+
}
|
|
163
|
+
.actions:empty:where(:scope, :scope *) {
|
|
164
|
+
display: none !important;
|
|
165
|
+
}
|
|
166
|
+
.dismiss:where(:scope, :scope *) {
|
|
167
|
+
flex: none;
|
|
168
|
+
}
|
|
169
|
+
:where(:is([component~="ui-notice-stripe"]:not(template), [data-component~="ui-notice-stripe"]:not([component])))[hidden]:where(:scope, :not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]:not([data-slotted~="ui-notice-stripe"]))) {
|
|
170
|
+
display: none !important;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.84 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiNoticeStripeEventMap {
|
|
3
|
+
dismiss: CustomEvent<{ readonly reason: "action"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
4
|
+
}
|
|
5
|
+
export interface UiNoticeStripeElement extends HTMLDivElement {
|
|
6
|
+
addEventListener<K extends keyof UiNoticeStripeEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: UiNoticeStripeEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
7
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
8
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
9
|
+
removeEventListener<K extends keyof UiNoticeStripeEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: UiNoticeStripeEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
10
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UiNoticeStripeElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
11
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
12
|
+
}
|
|
13
|
+
export interface UiNoticeStripeProps {
|
|
14
|
+
dismissLabel?: string | null;
|
|
15
|
+
dismissible?: boolean | null;
|
|
16
|
+
tone?: "neutral" | "info" | "success" | "warning" | "danger" | null;
|
|
17
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
18
|
+
children?: readonly (string | Node)[];
|
|
19
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
20
|
+
}
|
|
21
|
+
export declare function createUiNoticeStripe(props?: UiNoticeStripeProps): UiNoticeStripeElement;
|
|
22
|
+
declare global {
|
|
23
|
+
interface ComponentTagMap {
|
|
24
|
+
"ui-notice-stripe": { element: UiNoticeStripeElement; props: Omit<UiNoticeStripeProps, "attributes" | "children" | "slots"> };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.84 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { attachGeneratedController, buildTemplate, clearRegion, readIndex, toAttribute, truthy, writeAttribute, dispatchDeclared, detailCheck, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, checkBoolean, checkConstrained, checkFormat, checkObject, checkString, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import * as controller from "../components/ui-notice-stripe/ui-notice-stripe.js";
|
|
4
|
+
import "../styles/ui-notice-stripe.css";
|
|
5
|
+
|
|
6
|
+
const T0 = ["",[],"\n ",["div",["class","content"],"\n ",["div",["class","message"],4],"\n ",["div",["class","actions"],4],"\n "],"\n ",1,"\n "];
|
|
7
|
+
const T1 = ["",[]];
|
|
8
|
+
const T2 = ["",[]];
|
|
9
|
+
const T3 = ["ui-icon-button",["class","dismiss","size","sm","variant","ghost"],["ui-icon",["name","x"]]];
|
|
10
|
+
let P0, P1, P2, P3;
|
|
11
|
+
const S = { n: [], t: [], f: import.meta.url, g: "ui-notice-stripe", d: { "dismiss": [detailCheck(checkObject([["reason", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["action"]}), false], ["trigger", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["keyboard","pointer","programmatic"]}), false]], false)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs };
|
|
12
|
+
const D = { g: "ui-notice-stripe", props: { "dismissLabel": { "required":false,"default":"Dismiss notification", c: checkString, t: "string", j: 0, m: "s" }, "dismissible": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "tone": { "required":false,"values":["neutral","info","success","warning","danger"],"default":"info", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
|
|
13
|
+
const C = (host) => activateModule(controller, host);
|
|
14
|
+
|
|
15
|
+
export function createUiNoticeStripe(options = {}, html) {
|
|
16
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
17
|
+
const element = document.createElement("div");
|
|
18
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
19
|
+
if (value === null || value === undefined || value === false) continue;
|
|
20
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
21
|
+
}
|
|
22
|
+
element.setAttribute("component", "ui-notice-stripe");
|
|
23
|
+
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
24
|
+
const v = [null, null, null];
|
|
25
|
+
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
26
|
+
const m1 = (d) => {
|
|
27
|
+
const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
|
|
28
|
+
const r = { n };
|
|
29
|
+
p1(r, -1, d);
|
|
30
|
+
return r;
|
|
31
|
+
};
|
|
32
|
+
const p1 = (r, c, d) => {
|
|
33
|
+
};
|
|
34
|
+
const m2 = (d) => {
|
|
35
|
+
const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
|
|
36
|
+
const r = { n };
|
|
37
|
+
p2(r, -1, d);
|
|
38
|
+
return r;
|
|
39
|
+
};
|
|
40
|
+
const p2 = (r, c, d) => {
|
|
41
|
+
};
|
|
42
|
+
const m3 = (d) => {
|
|
43
|
+
const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
|
|
44
|
+
const r = { n, v0: null };
|
|
45
|
+
p3(r, -1, d);
|
|
46
|
+
return r;
|
|
47
|
+
};
|
|
48
|
+
const p3 = (r, c, d) => {
|
|
49
|
+
if (c & 1) {
|
|
50
|
+
const x0 = v[0];
|
|
51
|
+
const s0 = toAttribute(x0, "label");
|
|
52
|
+
if (s0 !== r.v0) writeAttribute(r.n, "label", r.v0 = s0);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const p0 = (r, c, d) => {
|
|
56
|
+
if (c & 1073741828) {
|
|
57
|
+
const x0 = readIndex({ "neutral": "status", "info": "status", "success": "status", "warning": "status", "danger": "alert" }, v[2]);
|
|
58
|
+
const s0 = toAttribute(x0, "role");
|
|
59
|
+
if (s0 !== r.v0) writeAttribute(r.n, "role", r.v0 = s0);
|
|
60
|
+
}
|
|
61
|
+
if (c & 4) {
|
|
62
|
+
const x1 = hostState(["tone"], [v[2]]);
|
|
63
|
+
const s1 = x1;
|
|
64
|
+
if (s1 !== r.v1) writeAttribute(r.n, "data-ui-notice-stripe-state", (r.v1 = s1) === "" ? null : s1);
|
|
65
|
+
}
|
|
66
|
+
if (c & 2 && !(truthy(v[1])) !== !r.b2) {
|
|
67
|
+
if (r.b2) { r.b2 = undefined; clearRegion(r.a3, r.e2); }
|
|
68
|
+
else { r.b2 = m3(d); r.e2.before(r.b2.n); }
|
|
69
|
+
} else if (r.b2 !== undefined) p3(r.b2, c, d);
|
|
70
|
+
if (r.f0 === undefined) { r.f0 = 1; const at = fillSlot(r.a1, r.e0, "", J, false, undefined, d);
|
|
71
|
+
if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b0 = m1(d); at.before(r.b0.n); } }
|
|
72
|
+
else if (r.b0 !== undefined) p1(r.b0, c, d);
|
|
73
|
+
if (r.f1 === undefined) { r.f1 = 1; const at = fillSlot(r.a2, r.e1, "actions", J, false, undefined, d);
|
|
74
|
+
if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b1 = m2(d); at.before(r.b1.n); } }
|
|
75
|
+
else if (r.b1 !== undefined) p2(r.b1, c, d);
|
|
76
|
+
};
|
|
77
|
+
const t0 = element.firstChild.nextSibling;
|
|
78
|
+
const t1 = t0.firstChild.nextSibling;
|
|
79
|
+
const t2 = t1.firstChild;
|
|
80
|
+
const t3 = t1.nextSibling.nextSibling.firstChild;
|
|
81
|
+
const t4 = t0.nextSibling.nextSibling;
|
|
82
|
+
const R = { n: element, v0: undefined, v1: undefined, a1: t2, e0: t2.nextSibling, b0: undefined, f0: undefined, a2: t3, e1: t3.nextSibling, b1: undefined, f1: undefined, a3: t4, e2: t4.nextSibling, b2: undefined };
|
|
83
|
+
const I = { B };
|
|
84
|
+
const J = project(I, children, slots);
|
|
85
|
+
attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined, undefined, I);
|
|
86
|
+
manageProps(I);
|
|
87
|
+
return element;
|
|
88
|
+
}
|
|
89
|
+
defineComponent("ui-notice-stripe", createUiNoticeStripe, ["dismissLabel","dismissible","tone"]);
|
package/vanilla/index.js
CHANGED
|
@@ -69,6 +69,7 @@ export * from "./UiMenuGroup.js";
|
|
|
69
69
|
export * from "./UiMenuItem.js";
|
|
70
70
|
export * from "./UiMeter.js";
|
|
71
71
|
export * from "./UiNavItem.js";
|
|
72
|
+
export * from "./UiNoticeStripe.js";
|
|
72
73
|
export * from "./UiNumberInput.js";
|
|
73
74
|
export * from "./UiPageHeader.js";
|
|
74
75
|
export * from "./UiPagination.js";
|