@warp-ds/elements 2.10.0-next.3 → 2.10.0-next.5
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/custom-elements.json +77 -14
- package/dist/docs/affix/affix.md +2 -0
- package/dist/docs/affix/styling.md +1 -0
- package/dist/docs/alert/alert.md +2 -0
- package/dist/docs/alert/styling.md +1 -0
- package/dist/docs/attention/attention.md +2 -0
- package/dist/docs/attention/styling.md +1 -0
- package/dist/docs/badge/badge.md +2 -0
- package/dist/docs/badge/styling.md +1 -0
- package/dist/docs/box/box.md +22 -38
- package/dist/docs/box/examples.md +20 -38
- package/dist/docs/box/styling.md +1 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +8 -0
- package/dist/docs/breadcrumbs/examples.md +7 -1
- package/dist/docs/breadcrumbs/styling.md +1 -0
- package/dist/docs/button/button.md +73 -0
- package/dist/docs/button/styling.md +72 -0
- package/dist/docs/card/card.md +2 -0
- package/dist/docs/card/styling.md +1 -0
- package/dist/docs/checkbox/api.md +128 -0
- package/dist/docs/checkbox/checkbox.md +134 -0
- package/dist/docs/checkbox-group/accessibility.md +71 -0
- package/dist/docs/checkbox-group/api.md +79 -0
- package/dist/docs/checkbox-group/checkbox-group.md +492 -0
- package/dist/docs/checkbox-group/examples.md +105 -0
- package/dist/docs/checkbox-group/styling.md +132 -0
- package/dist/docs/checkbox-group/usage.md +95 -0
- package/dist/docs/combobox/combobox.md +2 -0
- package/dist/docs/combobox/styling.md +1 -0
- package/dist/docs/datepicker/accessibility.md +25 -0
- package/dist/docs/datepicker/api.md +22 -14
- package/dist/docs/datepicker/datepicker.md +208 -14
- package/dist/docs/datepicker/examples.md +75 -0
- package/dist/docs/datepicker/styling.md +1 -0
- package/dist/docs/datepicker/usage.md +84 -0
- package/dist/docs/expandable/api.md +20 -32
- package/dist/docs/expandable/examples.md +54 -0
- package/dist/docs/expandable/expandable.md +74 -32
- package/dist/docs/expandable/styling.md +1 -0
- package/dist/docs/icon/icon.md +2 -0
- package/dist/docs/icon/styling.md +1 -0
- package/dist/docs/link/link.md +2 -0
- package/dist/docs/link/styling.md +1 -0
- package/dist/docs/modal/modal.md +2 -0
- package/dist/docs/modal/styling.md +1 -0
- package/dist/docs/modal-footer/modal-footer.md +0 -6
- package/dist/docs/modal-header/modal-header.md +0 -6
- package/dist/docs/page-indicator/page-indicator.md +2 -0
- package/dist/docs/page-indicator/styling.md +1 -0
- package/dist/docs/pagination/pagination.md +2 -0
- package/dist/docs/pagination/styling.md +1 -0
- package/dist/docs/pill/pill.md +2 -0
- package/dist/docs/pill/styling.md +1 -0
- package/dist/docs/radio/radio.md +0 -6
- package/dist/docs/select/select.md +2 -0
- package/dist/docs/select/styling.md +1 -0
- package/dist/docs/slider/slider.md +2 -0
- package/dist/docs/slider/styling.md +1 -0
- package/dist/docs/slider-thumb/slider-thumb.md +2 -0
- package/dist/docs/slider-thumb/styling.md +1 -0
- package/dist/docs/step-indicator/step-indicator.md +2 -0
- package/dist/docs/step-indicator/styling.md +1 -0
- package/dist/docs/switch/styling.md +1 -0
- package/dist/docs/switch/switch.md +2 -0
- package/dist/docs/tabs/styling.md +1 -0
- package/dist/docs/tabs/tabs.md +2 -0
- package/dist/docs/textarea/styling.md +1 -0
- package/dist/docs/textarea/textarea.md +2 -0
- package/dist/docs/textfield/styling.md +1 -0
- package/dist/docs/textfield/textfield.md +2 -0
- package/dist/index.d.ts +164 -128
- package/dist/packages/affix/affix.hydration.test.js +1 -1
- package/dist/packages/alert/alert.hydration.test.js +1 -1
- package/dist/packages/attention/attention.hydration.test.js +1 -1
- package/dist/packages/attention/attention.js +397 -446
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/badge/badge.hydration.test.js +1 -1
- package/dist/packages/box/box.hydration.test.js +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.js +3 -2
- package/dist/packages/button/button.hydration.test.js +1 -1
- package/dist/packages/button/button.js +387 -436
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/button/button.stories.d.ts +29 -0
- package/dist/packages/button/button.stories.js +176 -2
- package/dist/packages/button/styles.d.ts +22 -1
- package/dist/packages/button/styles.js +390 -1
- package/dist/packages/card/card.hydration.test.js +1 -1
- package/dist/packages/checkbox/checkbox.d.ts +5 -3
- package/dist/packages/checkbox/checkbox.hydration.test.js +1 -1
- package/dist/packages/checkbox/checkbox.js +2 -2
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/checkbox/checkbox.react.stories.d.ts +1 -1
- package/dist/packages/checkbox/checkbox.stories.d.ts +2 -2
- package/dist/packages/checkbox/react.d.ts +2 -2
- package/dist/packages/checkbox-group/checkbox-group.d.ts +5 -3
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.js +1 -1
- package/dist/packages/checkbox-group/checkbox-group.js +6 -6
- package/dist/packages/checkbox-group/checkbox-group.js.map +3 -3
- package/dist/packages/checkbox-group/react.d.ts +3 -3
- package/dist/packages/datepicker/datepicker.d.ts +22 -30
- package/dist/packages/datepicker/datepicker.hydration.test.js +1 -1
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/expandable/expandable.d.ts +11 -32
- package/dist/packages/expandable/expandable.hydration.test.js +1 -1
- package/dist/packages/expandable/expandable.js.map +2 -2
- package/dist/packages/expandable/expandable.react.stories.d.ts +2 -2
- package/dist/packages/expandable/react.d.ts +1 -1
- package/dist/packages/icon/icon.hydration.test.js +1 -1
- package/dist/packages/link/link.hydration.test.js +1 -1
- package/dist/packages/link/link.js +420 -190
- package/dist/packages/link/link.js.map +4 -4
- package/dist/packages/link/styles.d.ts +5 -0
- package/dist/packages/link/styles.js +80 -0
- package/dist/packages/modal/modal.d.ts +1 -0
- package/dist/packages/modal/modal.hydration.test.js +1 -1
- package/dist/packages/modal/modal.js +4 -4
- package/dist/packages/modal/modal.js.map +2 -2
- package/dist/packages/page-indicator/page-indicator.hydration.test.js +1 -1
- package/dist/packages/pagination/pagination.hydration.test.js +1 -1
- package/dist/packages/pill/pill.hydration.test.js +1 -1
- package/dist/packages/radio/radio.hydration.test.js +1 -1
- package/dist/packages/radio/radio.js.map +1 -1
- package/dist/packages/radio-group/radio-group.a11y.test.js +6 -2
- package/dist/packages/radio-group/radio-group.hydration.test.js +6 -2
- package/dist/packages/radio-group/radio-group.js +2 -2
- package/dist/packages/radio-group/radio-group.js.map +4 -4
- package/dist/packages/select/select.a11y.test.js +6 -2
- package/dist/packages/select/select.hydration.test.js +1 -1
- package/dist/packages/select/select.test.js +4 -2
- package/dist/packages/slider/slider.hydration.test.js +7 -2
- package/dist/packages/slider/slider.js.map +1 -1
- package/dist/packages/slider/slider.react.stories.js +2 -2
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.js +1 -1
- package/dist/packages/step/step.hydration.test.js +1 -1
- package/dist/packages/step-indicator/step-indicator.hydration.test.js +1 -1
- package/dist/packages/switch/switch.hydration.test.js +1 -1
- package/dist/packages/tab/tab.hydration.test.js +1 -1
- package/dist/packages/tab-panel/tab-panel.hydration.test.js +1 -1
- package/dist/packages/tabs/tabs.a11y.test.js +1 -1
- package/dist/packages/tabs/tabs.hydration.test.js +1 -1
- package/dist/packages/tabs/tabs.test.js +3 -3
- package/dist/packages/textarea/textarea.hydration.test.js +1 -1
- package/dist/packages/textfield/textfield.hydration.test.js +1 -1
- package/dist/web-types.json +91 -28
- package/eik/index.js +115 -0
- package/package.json +7 -4
- package/dist/docs/modal-footer/accessibility.md +0 -1
- package/dist/docs/modal-footer/examples.md +0 -1
- package/dist/docs/modal-footer/usage.md +0 -1
- package/dist/docs/modal-header/accessibility.md +0 -1
- package/dist/docs/modal-header/examples.md +0 -1
- package/dist/docs/modal-header/usage.md +0 -1
- package/dist/docs/radio/accessibility.md +0 -1
- package/dist/docs/radio/examples.md +0 -1
- package/dist/docs/radio/usage.md +0 -1
- package/dist/packages/button/styles/w-button.styles.d.ts +0 -1
- package/dist/packages/button/styles/w-button.styles.js +0 -282
- package/dist/packages/link/styles/w-link.styles.d.ts +0 -1
- package/dist/packages/link/styles/w-link.styles.js +0 -213
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var e=(c,a,d,n)=>{for(var t=n>1?void 0:n?k(a,d):a,l=c.length-1,s;l>=0;l--)(s=c[l])&&(t=(n?s(a,d,t):s(t))||t);return n&&t&&x(a,d,t),t};import{html as z,LitElement as m,nothing as _}from"lit";import{property as o}from"lit/decorators.js";import{css as u}from"lit";var w=u`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -271,7 +271,7 @@ var h=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var e=(n,a,d,i
|
|
|
271
271
|
svg {
|
|
272
272
|
pointer-events: none;
|
|
273
273
|
}
|
|
274
|
-
`,
|
|
274
|
+
`,S=u`*, :before, :after {
|
|
275
275
|
--w-rotate: 0;
|
|
276
276
|
--w-rotate-x: 0;
|
|
277
277
|
--w-rotate-y: 0;
|
|
@@ -2437,226 +2437,456 @@ var h=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var e=(n,a,d,i
|
|
|
2437
2437
|
display: none
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
`;import{css as
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
);
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2440
|
+
`;import{css as y}from"lit";import{css as i}from"lit";var b=i`
|
|
2441
|
+
:host {
|
|
2442
|
+
display: inline-block;
|
|
2443
|
+
|
|
2444
|
+
/* Internal resolved vars (defaults) */
|
|
2445
|
+
--_bg: var(--w-c-button-bg, var(--w-s-color-background));
|
|
2446
|
+
--_bg-hover: var(--w-c-button-bg-hover, var(--w-s-color-background-hover));
|
|
2447
|
+
--_bg-active: var(--w-c-button-bg-active, var(--w-s-color-background-active));
|
|
2448
|
+
|
|
2449
|
+
--_color: var(--w-c-button-color, var(--w-s-color-text-link));
|
|
2450
|
+
--_color-hover: var(--w-c-button-color-hover, var(--_color));
|
|
2451
|
+
--_color-active: var(--w-c-button-color-active, var(--_color));
|
|
2452
|
+
|
|
2453
|
+
--_border-width: var(--w-c-button-border-width, 2px);
|
|
2454
|
+
--_border-color: var(--w-c-button-border-color, var(--w-s-color-border));
|
|
2455
|
+
--_border-color-hover: var(--w-c-button-border-color-hover, var(--w-s-color-border-hover));
|
|
2456
|
+
--_border-color-active: var(--w-c-button-border-color-active, var(--w-s-color-border-active));
|
|
2457
|
+
|
|
2458
|
+
--_radius: var(--w-c-button-radius, 8px);
|
|
2459
|
+
|
|
2460
|
+
--_font-size: var(--w-c-button-font-size, var(--w-font-size-m));
|
|
2461
|
+
--_line-height: var(--w-c-button-line-height, var(--w-line-height-m));
|
|
2462
|
+
--_font-weight: var(--w-c-button-font-weight, 700);
|
|
2463
|
+
|
|
2464
|
+
--_pad-x: var(--w-c-button-padding-x, 16px);
|
|
2465
|
+
--_pad-y: var(--w-c-button-padding-y, 13px);
|
|
2466
|
+
|
|
2467
|
+
--_outline-width: var(--w-c-button-outline-width, 2px);
|
|
2468
|
+
--_outline-color: var(--w-c-button-outline-color, var(--w-s-color-border-focus));
|
|
2469
|
+
--_outline-offset: var(--w-c-button-outline-offset, var(--w-outline-offset, 1px));
|
|
2470
|
+
|
|
2471
|
+
--_transition: var(
|
|
2472
|
+
--w-c-button-transition,
|
|
2473
|
+
color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2474
|
+
background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2475
|
+
border-color 150ms cubic-bezier(0.4, 0, 0.2, 1)
|
|
2451
2476
|
);
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
--
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
--
|
|
2463
|
-
--
|
|
2464
|
-
--
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2477
|
+
|
|
2478
|
+
/* Icon color for pill/icon-only variants (semantic; default dark grey icon) */
|
|
2479
|
+
--w-c-button-icon-color: var(--w-s-color-icon);
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
:host(:focus-visible) {
|
|
2483
|
+
outline: none;
|
|
2484
|
+
}
|
|
2485
|
+
`,v=i`
|
|
2486
|
+
:host([variant='primary']) {
|
|
2487
|
+
--w-c-button-bg: var(--w-s-color-background-primary);
|
|
2488
|
+
--w-c-button-bg-hover: var(--w-s-color-background-primary-hover);
|
|
2489
|
+
--w-c-button-bg-active: var(--w-s-color-background-primary-active);
|
|
2490
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2491
|
+
--w-c-button-border-width: 0px;
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
:host([variant='negative']) {
|
|
2495
|
+
--w-c-button-bg: var(--w-s-color-background-negative);
|
|
2496
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-hover);
|
|
2497
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-active);
|
|
2498
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2499
|
+
--w-c-button-border-width: 0px;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
:host([variant='negativeQuiet']) {
|
|
2503
|
+
--w-c-button-bg: transparent;
|
|
2504
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
2505
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-subtle-active);
|
|
2506
|
+
--w-c-button-color: var(--w-s-color-text-negative);
|
|
2507
|
+
--w-c-button-border-width: 0px;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
:host([variant='utility']) {
|
|
2511
|
+
--w-c-button-bg: var(--w-s-color-background);
|
|
2512
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2513
|
+
--w-c-button-radius: 4px;
|
|
2514
|
+
--w-c-button-border-width: 1px;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
:host([variant='utilityQuiet']) {
|
|
2518
|
+
--w-c-button-bg: transparent;
|
|
2519
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2520
|
+
--w-c-button-border-width: 0px;
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
:host([variant='quiet']) {
|
|
2524
|
+
--w-c-button-bg: transparent;
|
|
2525
|
+
--w-c-button-border-width: 0px;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
:host([variant='overlay']) {
|
|
2529
|
+
--w-c-button-bg: var(--w-s-color-background);
|
|
2530
|
+
--w-c-button-bg-hover: var(--w-s-color-background-hover);
|
|
2531
|
+
--w-c-button-bg-active: var(--w-s-color-background-active);
|
|
2532
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2533
|
+
--w-c-button-radius: 9999px;
|
|
2534
|
+
--w-c-button-border-width: 0px;
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
:host([variant='overlayInverted']) {
|
|
2538
|
+
--w-c-button-bg: var(--w-s-color-background-inverted);
|
|
2539
|
+
--w-c-button-bg-hover: var(--w-s-color-background-inverted-hover);
|
|
2540
|
+
--w-c-button-bg-active: var(--w-s-color-background-inverted-active);
|
|
2541
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2542
|
+
--w-c-button-radius: 9999px;
|
|
2543
|
+
--w-c-button-border-width: 0px;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
:host([variant='overlayQuiet']) {
|
|
2547
|
+
--w-c-button-bg: transparent;
|
|
2548
|
+
--w-c-button-bg-hover: var(--w-s-color-background-hover);
|
|
2549
|
+
--w-c-button-bg-active: var(--w-s-color-background-active);
|
|
2550
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2551
|
+
--w-c-button-radius: 9999px;
|
|
2552
|
+
--w-c-button-border-width: 0px;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
:host([variant='overlayInvertedQuiet']) {
|
|
2556
|
+
--w-c-button-bg: transparent;
|
|
2557
|
+
--w-c-button-bg-hover: var(--w-s-color-background-inverted-hover);
|
|
2558
|
+
--w-c-button-bg-active: var(--w-s-color-background-inverted-active);
|
|
2559
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2560
|
+
--w-c-button-radius: 9999px;
|
|
2561
|
+
--w-c-button-border-width: 0px;
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
:host([variant='link']) {
|
|
2565
|
+
--w-c-button-bg: transparent;
|
|
2566
|
+
--w-c-button-border-width: 0px;
|
|
2567
|
+
--w-c-button-padding-x: 0px;
|
|
2568
|
+
--w-c-button-padding-y: 0px;
|
|
2569
|
+
--w-c-button-font-weight: 400;
|
|
2570
|
+
|
|
2571
|
+
--w-c-button-bg-hover: transparent;
|
|
2572
|
+
--w-c-button-bg-active: transparent;
|
|
2573
|
+
|
|
2574
|
+
--w-c-button-color: var(--w-s-color-text-link);
|
|
2575
|
+
--w-c-button-color-hover: var(--w-s-color-text-link-hover, var(--w-c-button-color));
|
|
2576
|
+
--w-c-button-color-active: var(--w-s-color-text-link-active, var(--w-c-button-color));
|
|
2577
|
+
}
|
|
2578
|
+
`,g=i`
|
|
2579
|
+
:host([small]) {
|
|
2580
|
+
--w-c-button-padding-x: 12px;
|
|
2581
|
+
--w-c-button-padding-y: 8px;
|
|
2582
|
+
--w-c-button-font-size: var(--w-font-size-xs);
|
|
2583
|
+
--w-c-button-line-height: var(--w-line-height-xs);
|
|
2584
|
+
}
|
|
2585
|
+
`,p=i`
|
|
2586
|
+
:host([disabled]) {
|
|
2587
|
+
pointer-events: none;
|
|
2588
|
+
|
|
2589
|
+
--w-c-button-bg: var(--w-s-color-background-disabled);
|
|
2590
|
+
--w-c-button-bg-hover: var(--w-s-color-background-disabled);
|
|
2591
|
+
--w-c-button-bg-active: var(--w-s-color-background-disabled);
|
|
2592
|
+
|
|
2593
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2594
|
+
--w-c-button-border-width: 0px;
|
|
2595
|
+
}
|
|
2596
|
+
`,B=i`
|
|
2597
|
+
${b}
|
|
2598
|
+
|
|
2599
|
+
/* ============================================================
|
|
2600
|
+
* Base element (NATIVE button mode ONLY)
|
|
2601
|
+
* ============================================================ */
|
|
2602
|
+
button[part='base'] {
|
|
2468
2603
|
display: inline-flex;
|
|
2469
2604
|
justify-content: center;
|
|
2470
2605
|
align-items: center;
|
|
2471
2606
|
text-align: center;
|
|
2472
|
-
|
|
2607
|
+
|
|
2473
2608
|
cursor: pointer;
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
border-radius: var(--_border-radius);
|
|
2485
|
-
padding: calc(var(--_padding-y) - var(--_border-width))
|
|
2486
|
-
calc(var(--_padding-x) - var(--_border-width));
|
|
2609
|
+
|
|
2610
|
+
background-color: var(--_bg);
|
|
2611
|
+
color: var(--_color);
|
|
2612
|
+
|
|
2613
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
2614
|
+
border-radius: var(--_radius);
|
|
2615
|
+
|
|
2616
|
+
padding: calc(var(--_pad-y) - var(--_border-width))
|
|
2617
|
+
calc(var(--_pad-x) - var(--_border-width));
|
|
2618
|
+
|
|
2487
2619
|
font-size: var(--_font-size);
|
|
2488
2620
|
line-height: var(--_line-height);
|
|
2489
2621
|
font-weight: var(--_font-weight);
|
|
2622
|
+
|
|
2623
|
+
transition: var(--_transition);
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
/* Optional: helps avoid "grew a bit" from slot typography differences */
|
|
2627
|
+
button[part='base'] ::slotted(*) {
|
|
2628
|
+
line-height: inherit;
|
|
2490
2629
|
}
|
|
2491
2630
|
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2631
|
+
/* ============================================================
|
|
2632
|
+
* Link mode wrapper (w-link host carries part="base" in button.ts)
|
|
2633
|
+
* Keep it layout-only to avoid double chrome.
|
|
2634
|
+
* ============================================================ */
|
|
2635
|
+
:host > w-link[part='base'] {
|
|
2636
|
+
display: inline-block;
|
|
2637
|
+
padding: 0;
|
|
2638
|
+
border: 0;
|
|
2639
|
+
background: transparent;
|
|
2496
2640
|
}
|
|
2497
2641
|
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
color: var(--
|
|
2642
|
+
/* Hover / active (native button mode only) */
|
|
2643
|
+
:host(:not([disabled]):not([loading])) button[part='base']:hover {
|
|
2644
|
+
background-color: var(--_bg-hover);
|
|
2645
|
+
border-color: var(--_border-color-hover);
|
|
2646
|
+
color: var(--_color-hover);
|
|
2502
2647
|
}
|
|
2503
2648
|
|
|
2504
|
-
:host(:not([
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
:host([
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
}
|
|
2519
|
-
|
|
2520
|
-
:
|
|
2521
|
-
|
|
2522
|
-
--
|
|
2523
|
-
--
|
|
2524
|
-
--
|
|
2525
|
-
--
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
--
|
|
2531
|
-
--color: var(--w-s-color-text
|
|
2532
|
-
--
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
:host([variant=
|
|
2537
|
-
|
|
2538
|
-
--
|
|
2539
|
-
--
|
|
2540
|
-
--
|
|
2541
|
-
--
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
--
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
--background-active: var(--w-s-color-background-active);
|
|
2550
|
-
--color: var(--w-s-color-text);
|
|
2551
|
-
--color-hover: var(--w-s-color-text);
|
|
2552
|
-
--color-active: var(--w-s-color-text);
|
|
2553
|
-
--border-radius: var(--w-button-radius-utility, 4px);
|
|
2554
|
-
--border-width: 1px;
|
|
2555
|
-
}
|
|
2556
|
-
:host([variant="utilityQuiet"]),
|
|
2557
|
-
:host([quiet][variant="utility"]) /* deprecated, backwards compatibility */ {
|
|
2558
|
-
--background: transparent;
|
|
2559
|
-
--color: var(--w-s-color-text);
|
|
2560
|
-
--color-hover: var(--w-s-color-text);
|
|
2561
|
-
--color-active: var(--w-s-color-text);
|
|
2562
|
-
--border-width: 0px;
|
|
2563
|
-
}
|
|
2564
|
-
:host([variant="overlay"]) {
|
|
2565
|
-
--background: var(--w-color-background);
|
|
2566
|
-
--background-hover: var(--w-color-background-hover);
|
|
2567
|
-
--background-active: var(--w-color-background-active);
|
|
2568
|
-
--color: var(--w-s-color-text);
|
|
2569
|
-
--color-hover: var(--w-s-color-text);
|
|
2570
|
-
--color-active: var(--w-s-color-text);
|
|
2571
|
-
--border-radius: 9999px;
|
|
2572
|
-
--border-width: 0px;
|
|
2573
|
-
}
|
|
2574
|
-
:host([variant="overlayQuiet"]),
|
|
2575
|
-
:host([quiet][variant="overlay"]) /* deprecated, backwards compatibility */ {
|
|
2576
|
-
--background: transparent;
|
|
2577
|
-
--background-hover: var(--w-s-color-background-hover);
|
|
2578
|
-
--background-active: var(--w-s-color-background-active);
|
|
2579
|
-
--color: var(--w-s-color-text);
|
|
2580
|
-
--color-hover: var(--w-s-color-text);
|
|
2581
|
-
--color-active: var(--w-s-color-text);
|
|
2582
|
-
--border-radius: 9999px;
|
|
2583
|
-
--border-width: 0px;
|
|
2584
|
-
}
|
|
2585
|
-
:host([variant="overlayInverted"]) {
|
|
2586
|
-
--background: var(--w-s-color-background-inverted);
|
|
2587
|
-
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2588
|
-
--background-active: var(--w-s-color-background-inverted-active);
|
|
2589
|
-
--color: var(--w-s-color-text-inverted);
|
|
2590
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2591
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2592
|
-
--border-radius: 9999px;
|
|
2593
|
-
--border-width: 0px;
|
|
2594
|
-
}
|
|
2595
|
-
:host([variant="overlayInvertedQuiet"]),
|
|
2596
|
-
:host([quiet][variant="overlayInverted"]) /* deprecated, backwards compatibility */ {
|
|
2597
|
-
--background: transparent;
|
|
2598
|
-
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2599
|
-
--background-active: var(--w-s-color-background-inverted-active);
|
|
2600
|
-
--color: var(--w-s-color-text-inverted);
|
|
2601
|
-
--color-hover: var(--w-s-color-text-inverted);
|
|
2602
|
-
--color-active: var(--w-s-color-text-inverted);
|
|
2603
|
-
--border-radius: 9999px;
|
|
2604
|
-
--border-width: 0px;
|
|
2605
|
-
}
|
|
2606
|
-
|
|
2607
|
-
:host([variant="link"]) {
|
|
2608
|
-
--background: none;
|
|
2609
|
-
--background-hover: none;
|
|
2610
|
-
--background-active: none;
|
|
2611
|
-
--border-width: 0px;
|
|
2612
|
-
--font-weight: normal;
|
|
2649
|
+
:host(:not([disabled]):not([loading])) button[part='base']:active {
|
|
2650
|
+
background-color: var(--_bg-active);
|
|
2651
|
+
border-color: var(--_border-color-active);
|
|
2652
|
+
color: var(--_color-active);
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
:host(:focus-visible) button[part='base'] {
|
|
2656
|
+
outline: var(--_outline-width) solid var(--_outline-color);
|
|
2657
|
+
outline-offset: var(--_outline-offset);
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
/* ============================================================
|
|
2661
|
+
* Variants (shared + button-specific quiet mappings)
|
|
2662
|
+
* ============================================================ */
|
|
2663
|
+
${v}
|
|
2664
|
+
|
|
2665
|
+
/* Button-specific: quiet attribute backwards compatibility */
|
|
2666
|
+
:host([variant='negative'][quiet]) {
|
|
2667
|
+
--w-c-button-bg: transparent;
|
|
2668
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
2669
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-subtle-active);
|
|
2670
|
+
--w-c-button-color: var(--w-s-color-text-negative);
|
|
2671
|
+
--w-c-button-border-width: 0px;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
:host([variant='utility'][quiet]) {
|
|
2675
|
+
--w-c-button-bg: transparent;
|
|
2676
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2677
|
+
--w-c-button-border-width: 0px;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
/* Button-specific: pill variant */
|
|
2681
|
+
:host([variant='pill']) {
|
|
2682
|
+
--w-c-button-bg: transparent;
|
|
2683
|
+
--w-c-button-radius: 50%;
|
|
2684
|
+
--w-c-button-border-width: 0px;
|
|
2685
|
+
--w-c-button-padding-x: 14px;
|
|
2686
|
+
--w-c-button-padding-y: 14px;
|
|
2687
|
+
|
|
2688
|
+
/* pill uses semantic icon color (dark grey by default) */
|
|
2689
|
+
--w-c-button-color: var(--w-c-button-icon-color, var(--w-s-color-icon));
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
/* Button-specific: link variant element styles */
|
|
2693
|
+
:host([variant='link']) button[part='base'] {
|
|
2613
2694
|
display: inline;
|
|
2695
|
+
padding: 0;
|
|
2614
2696
|
}
|
|
2615
2697
|
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2698
|
+
:host([variant='link']:not([disabled]):not([loading])) button[part='base']:hover {
|
|
2699
|
+
text-decoration: underline;
|
|
2700
|
+
background-color: transparent;
|
|
2701
|
+
border-color: transparent;
|
|
2702
|
+
color: var(--w-c-button-color-hover);
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
/* ===== Size ===== */
|
|
2706
|
+
${g}
|
|
2707
|
+
|
|
2708
|
+
:host([small][variant='pill']) {
|
|
2709
|
+
--w-c-button-padding-x: 8px;
|
|
2710
|
+
--w-c-button-padding-y: 8px;
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
/* ===== Layout ===== */
|
|
2714
|
+
|
|
2715
|
+
:host([full-width]) button[part='base'],
|
|
2716
|
+
:host([full-width]) > w-link[part='base'] {
|
|
2717
|
+
width: 100%;
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
:host([icon-only]) button[part='base'] {
|
|
2721
|
+
aspect-ratio: 1 / 1;
|
|
2722
|
+
padding-left: calc(var(--w-c-button-padding-y) - var(--w-c-button-border-width, 0px));
|
|
2723
|
+
padding-right: calc(var(--w-c-button-padding-y) - var(--w-c-button-border-width, 0px));
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
/* ============================================================
|
|
2727
|
+
* STATE OVERRIDES (must be last so they win over variants)
|
|
2728
|
+
* Disabled first, Loading last (loading is disabled-like + visuals)
|
|
2729
|
+
*
|
|
2730
|
+
* IMPORTANT:
|
|
2731
|
+
* Some variant selectors are more specific (e.g. [variant='negative']:not([quiet])).
|
|
2732
|
+
* To ensure states always win, we match similar specificity via extra attribute selectors.
|
|
2733
|
+
* ============================================================ */
|
|
2734
|
+
|
|
2735
|
+
/* ===== Disabled ===== */
|
|
2736
|
+
${p}
|
|
2737
|
+
|
|
2738
|
+
/* Additional specificity for button to override quiet variants */
|
|
2739
|
+
:host([disabled][variant]),
|
|
2740
|
+
:host([disabled][quiet]) {
|
|
2741
|
+
--w-c-button-bg: var(--w-s-color-background-disabled);
|
|
2742
|
+
--w-c-button-bg-hover: var(--w-s-color-background-disabled);
|
|
2743
|
+
--w-c-button-bg-active: var(--w-s-color-background-disabled);
|
|
2744
|
+
|
|
2745
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2746
|
+
|
|
2747
|
+
--w-c-button-border-width: 0px;
|
|
2748
|
+
--w-c-button-border-color: transparent;
|
|
2749
|
+
--w-c-button-border-color-hover: transparent;
|
|
2750
|
+
--w-c-button-border-color-active: transparent;
|
|
2751
|
+
|
|
2752
|
+
--w-c-button-color-hover: var(--w-s-color-text-inverted);
|
|
2753
|
+
--w-c-button-color-active: var(--w-s-color-text-inverted);
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
/* ===== Loading (wins over everything) ===== */
|
|
2757
|
+
:host([loading]),
|
|
2758
|
+
:host([loading][variant]),
|
|
2759
|
+
:host([loading][quiet]) {
|
|
2631
2760
|
pointer-events: none;
|
|
2761
|
+
|
|
2762
|
+
/* Strong overrides so variants can't leak through */
|
|
2763
|
+
--w-c-button-bg: var(--w-s-color-background-subtle);
|
|
2764
|
+
--w-c-button-bg-hover: var(--w-s-color-background-subtle);
|
|
2765
|
+
--w-c-button-bg-active: var(--w-s-color-background-subtle);
|
|
2766
|
+
|
|
2767
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
2768
|
+
--w-c-button-color-hover: var(--w-s-color-text);
|
|
2769
|
+
--w-c-button-color-active: var(--w-s-color-text);
|
|
2770
|
+
|
|
2771
|
+
--w-c-button-border-width: 0px;
|
|
2772
|
+
--w-c-button-border-color: transparent;
|
|
2773
|
+
--w-c-button-border-color-hover: transparent;
|
|
2774
|
+
--w-c-button-border-color-active: transparent;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
/* Loading stripes (native button mode only) */
|
|
2778
|
+
:host([loading]) button[part='base'] {
|
|
2779
|
+
background-image: linear-gradient(
|
|
2780
|
+
135deg,
|
|
2781
|
+
rgba(0, 0, 0, 0.05) 25%,
|
|
2782
|
+
transparent 25%,
|
|
2783
|
+
transparent 50%,
|
|
2784
|
+
rgba(0, 0, 0, 0.05) 50%,
|
|
2785
|
+
rgba(0, 0, 0, 0.05) 75%,
|
|
2786
|
+
transparent 75%,
|
|
2787
|
+
transparent
|
|
2788
|
+
);
|
|
2789
|
+
background-size: 30px 30px;
|
|
2790
|
+
animation: animate-inprogress 3s linear infinite;
|
|
2632
2791
|
}
|
|
2633
2792
|
|
|
2634
|
-
|
|
2635
|
-
|
|
2793
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2794
|
+
:host([loading]) button[part='base'] {
|
|
2795
|
+
animation: none;
|
|
2796
|
+
}
|
|
2636
2797
|
}
|
|
2637
2798
|
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2799
|
+
@keyframes animate-inprogress {
|
|
2800
|
+
0% {
|
|
2801
|
+
background-position: 0 0;
|
|
2802
|
+
}
|
|
2803
|
+
100% {
|
|
2804
|
+
background-position: 60px 0;
|
|
2805
|
+
}
|
|
2644
2806
|
}
|
|
2807
|
+
`;var h=y`
|
|
2808
|
+
${b}
|
|
2645
2809
|
|
|
2646
|
-
/*
|
|
2647
|
-
|
|
2810
|
+
/* ============================================================
|
|
2811
|
+
* Link element (anchor with button styling)
|
|
2812
|
+
* ============================================================ */
|
|
2813
|
+
a[part='base'] {
|
|
2814
|
+
display: inline-flex;
|
|
2815
|
+
justify-content: center;
|
|
2816
|
+
align-items: center;
|
|
2817
|
+
text-align: center;
|
|
2818
|
+
|
|
2819
|
+
cursor: pointer;
|
|
2820
|
+
text-decoration: none;
|
|
2821
|
+
|
|
2822
|
+
background-color: var(--_bg);
|
|
2823
|
+
color: var(--_color);
|
|
2824
|
+
|
|
2825
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
2826
|
+
border-radius: var(--_radius);
|
|
2827
|
+
|
|
2828
|
+
padding: calc(var(--_pad-y) - var(--_border-width))
|
|
2829
|
+
calc(var(--_pad-x) - var(--_border-width));
|
|
2830
|
+
|
|
2831
|
+
font-size: var(--_font-size);
|
|
2832
|
+
line-height: var(--_line-height);
|
|
2833
|
+
font-weight: var(--_font-weight);
|
|
2834
|
+
|
|
2835
|
+
transition: var(--_transition);
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
:host(:not([disabled])) a[part='base']:hover {
|
|
2839
|
+
background-color: var(--_bg-hover);
|
|
2840
|
+
border-color: var(--_border-color-hover);
|
|
2841
|
+
color: var(--_color-hover);
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
:host(:not([disabled])) a[part='base']:active {
|
|
2845
|
+
background-color: var(--_bg-active);
|
|
2846
|
+
border-color: var(--_border-color-active);
|
|
2847
|
+
color: var(--_color-active);
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
:host(:focus-visible) a[part='base'] {
|
|
2851
|
+
outline: var(--_outline-width) solid var(--_outline-color);
|
|
2852
|
+
outline-offset: var(--_outline-offset);
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
/* ===== Variants (shared from button) ===== */
|
|
2856
|
+
${v}
|
|
2857
|
+
|
|
2858
|
+
/* Link-specific: link variant element styles */
|
|
2859
|
+
:host([variant='link']) a[part='base'] {
|
|
2860
|
+
display: inline;
|
|
2861
|
+
padding: 0;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
:host([variant='link']:not([disabled])) a[part='base']:hover {
|
|
2865
|
+
text-decoration: underline;
|
|
2866
|
+
background-color: transparent;
|
|
2867
|
+
border-color: transparent;
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
/* ===== Sizes (shared from button) ===== */
|
|
2871
|
+
${g}
|
|
2872
|
+
|
|
2873
|
+
/* ===== Layout ===== */
|
|
2874
|
+
:host([full-width]) a[part='base'] {
|
|
2648
2875
|
width: 100%;
|
|
2649
|
-
max-width: 100%;
|
|
2650
2876
|
}
|
|
2651
|
-
|
|
2652
|
-
|
|
2877
|
+
|
|
2878
|
+
/* ===== Disabled (shared from button) ===== */
|
|
2879
|
+
${p}
|
|
2880
|
+
`;var f=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],r=class extends m{constructor(){super(...arguments);this.autofocus=!1;this.small=!1;this.disabled=!1;this.fullWidth=!1}connectedCallback(){if(super.connectedCallback(),this.variant&&!f.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2881
|
+
${f.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){return z`
|
|
2653
2882
|
<a
|
|
2654
2883
|
href="${this.href}"
|
|
2884
|
+
part="base"
|
|
2655
2885
|
target="${this.target}"
|
|
2656
|
-
rel="${this.target==="_blank"?this.rel||"noopener":
|
|
2886
|
+
rel="${this.target==="_blank"?this.rel||"noopener":_}"
|
|
2657
2887
|
tabindex="0"
|
|
2658
2888
|
>
|
|
2659
2889
|
<slot></slot>
|
|
2660
2890
|
</a>
|
|
2661
|
-
`}};r.shadowRootOptions={...
|
|
2891
|
+
`}};r.shadowRootOptions={...m.shadowRootOptions,delegatesFocus:!0},r.styles=[w,h],e([o({type:Boolean,reflect:!0})],r.prototype,"autofocus",2),e([o({reflect:!0})],r.prototype,"variant",2),e([o({type:Boolean,reflect:!0})],r.prototype,"small",2),e([o({reflect:!0})],r.prototype,"href",2),e([o({type:Boolean,reflect:!0})],r.prototype,"disabled",2),e([o({reflect:!0})],r.prototype,"target",2),e([o({reflect:!0})],r.prototype,"rel",2),e([o({attribute:"full-width",type:Boolean,reflect:!0})],r.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",r);export{r as WarpLink};
|
|
2662
2892
|
//# sourceMappingURL=link.js.map
|