@warp-ds/elements 2.2.0-next.22 → 2.2.0-next.24

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.
Files changed (41) hide show
  1. package/dist/custom-elements.json +32 -24
  2. package/dist/index.d.ts +3 -0
  3. package/dist/packages/attention/index.js +7 -7
  4. package/dist/packages/attention/index.js.map +3 -3
  5. package/dist/packages/button/index.js +3 -3
  6. package/dist/packages/button/index.js.map +3 -3
  7. package/dist/packages/dead-toggle/dead-toggle.react.stories.d.ts +1 -1
  8. package/dist/packages/dead-toggle/index.d.ts +1 -0
  9. package/dist/packages/dead-toggle/index.js +109 -48
  10. package/dist/packages/dead-toggle/index.js.map +4 -4
  11. package/dist/packages/expandable/index.js +1 -1
  12. package/dist/packages/expandable/index.js.map +2 -2
  13. package/dist/packages/modal/index.js +2 -2
  14. package/dist/packages/modal/index.js.map +1 -1
  15. package/dist/packages/modal/modal-header.js +2 -2
  16. package/dist/packages/modal/modal-header.js.map +1 -1
  17. package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +2 -0
  18. package/dist/packages/rip-and-tear-checkbox/checkbox.js +2559 -127
  19. package/dist/packages/rip-and-tear-checkbox/checkbox.js.map +4 -4
  20. package/dist/packages/rip-and-tear-checkbox/index.js +2559 -127
  21. package/dist/packages/rip-and-tear-checkbox/index.js.map +4 -4
  22. package/dist/packages/rip-and-tear-checkbox/styles.d.ts +0 -1
  23. package/dist/packages/rip-and-tear-checkbox/styles.js +0 -116
  24. package/dist/packages/rip-and-tear-radio/index.js +2529 -150
  25. package/dist/packages/rip-and-tear-radio/index.js.map +4 -4
  26. package/dist/packages/rip-and-tear-radio/radio-group-styles.js +0 -1
  27. package/dist/packages/rip-and-tear-radio/radio-group-styles.js.map +2 -2
  28. package/dist/packages/rip-and-tear-radio/radio-group.js +2529 -150
  29. package/dist/packages/rip-and-tear-radio/radio-group.js.map +4 -4
  30. package/dist/packages/rip-and-tear-radio/radio-styles.d.ts +0 -1
  31. package/dist/packages/rip-and-tear-radio/radio-styles.js +0 -169
  32. package/dist/packages/rip-and-tear-radio/radio-styles.js.map +4 -4
  33. package/dist/packages/rip-and-tear-radio/radio.js +2517 -137
  34. package/dist/packages/rip-and-tear-radio/radio.js.map +4 -4
  35. package/dist/packages/rip-and-tear-radio/radio.stories.js +2530 -151
  36. package/dist/packages/rip-and-tear-radio/radio.stories.js.map +4 -4
  37. package/dist/packages/toggle-styles.d.ts +1 -0
  38. package/dist/packages/toggle-styles.js +109 -0
  39. package/dist/vscode.html-custom-data.json +2 -1
  40. package/dist/web-types.json +7 -2
  41. package/package.json +1 -1
@@ -0,0 +1,109 @@
1
+ import { css } from 'lit';
2
+ export const toggleStyles = css `
3
+ [part~='label'] {
4
+ display: block;
5
+ font-size: var(--w-font-size-m);
6
+ line-height: var(--w-line-height-m);
7
+ user-select: none;
8
+ cursor: pointer;
9
+ }
10
+ .wrapper {
11
+ display: grid;
12
+ grid-template-columns: 2rem max-content;
13
+ gap: 8px;
14
+ padding: 0.2rem 0;
15
+ }
16
+ .hide-toggle {
17
+ position: absolute;
18
+ padding: 0;
19
+ margin: 0;
20
+ opacity: 0;
21
+ pointer-events: none;
22
+ inset: 0;
23
+ }
24
+ .control {
25
+ display: block;
26
+ border-width: 1px;
27
+ transition-property: all;
28
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
29
+ transition-duration: 150ms;
30
+ cursor: pointer;
31
+ appearance: none;
32
+ user-select: none;
33
+ flex-shrink: 0;
34
+ height: 2rem;
35
+ width: 2rem;
36
+ background-color: var(--w-s-color-background);
37
+ border-color: var(--w-s-color-border);
38
+ color: var(--w-s-color-icon-inverted);
39
+ font-weight: 700;
40
+ text-align: center;
41
+ line-height: var(--w-line-height-xs);
42
+ font-size: var(--w-font-size-m);
43
+ }
44
+ .checkbox {
45
+ position: relative;
46
+ }
47
+ :host([type='checkbox']) .control {
48
+ border-radius: 2px;
49
+ }
50
+ .checkbox:has(:checked, :indeterminate),
51
+ :host([type='checkbox'][checked]) .control,
52
+ :host([type='checkbox'][indeterminate]) .control {
53
+ background-color: var(--w-s-color-background-primary);
54
+ border-color: var(--w-s-color-border-primary);
55
+ }
56
+ .checkbox:has(:checked),
57
+ :host([type='checkbox'][checked]) .control {
58
+ background-image: var(--w-icon-toggle-checked);
59
+ background-position: center;
60
+ }
61
+ :host([type='radio']) .control,
62
+ :host([role='radio']) .control {
63
+ border-radius: 50%;
64
+ }
65
+ :host([type='radio'][checked]) .control,
66
+ /* :state is newly available, so we set an attribute in radio for compat */
67
+ :host([role='radio'][checked-ui]) .control,
68
+ :host([role='radio']:state(checked)) .control {
69
+ border-color: var(--w-s-color-border-selected);
70
+ border-width: 0.6rem;
71
+ }
72
+ .checkbox:has(:invalid),
73
+ :host([invalid]) .control {
74
+ border-color: var(--w-s-color-border-negative) !important;
75
+ }
76
+ /* handles invalid checkbox state inside w-checkbox */
77
+ .checkbox:has(:checked, :indeterminate):has(:invalid),
78
+ /* allows invalid to be set on the w-checkbox element */
79
+ :host([invalid]) .checkbox:has(:checked, :indeterminate),
80
+ :host([type='checkbox'][invalid][checked]) .control,
81
+ :host([type='checkbox'][invalid][indeterminate]) .control {
82
+ background-color: var(--w-s-color-background-negative);
83
+ }
84
+
85
+ :host(:focus-visible) {
86
+ outline: none;
87
+ }
88
+ .checkbox:has(> input:focus-visible:not(:disabled)),
89
+ :host(:focus-visible) .control {
90
+ outline: 2px solid var(--w-s-color-border-focus);
91
+ outline-offset: var(--w-outline-offset, 1px);
92
+ }
93
+
94
+ :host([type='radio'][disabled]) .control,
95
+ /* :state is newly available, so we set an attribute in radio for compat */
96
+ :host([role='radio'][disabled-ui]) .control,
97
+ :host([role='radio']:state(disabled)) .control,
98
+ :host([type='checkbox'][disabled]) .control,
99
+ .checkbox:has(> input:disabled) {
100
+ border-color: var(--w-s-color-border-disabled);
101
+ background-color: var(--w-s-color-background-disabled-subtle);
102
+ }
103
+
104
+ :host([type='checkbox'][disabled][checked]) .control,
105
+ :host([type='checkbox'][disabled][indeterminate]) .control,
106
+ .checkbox:has(:checked, :indeterminate):has(> input:disabled) {
107
+ background-color: var(--w-s-color-background-disabled);
108
+ }
109
+ `;
@@ -306,7 +306,8 @@
306
306
  },
307
307
  { "name": "checked", "values": [] },
308
308
  { "name": "indeterminate", "values": [] },
309
- { "name": "invalid", "values": [] }
309
+ { "name": "invalid", "values": [] },
310
+ { "name": "disabled", "values": [] }
310
311
  ],
311
312
  "references": []
312
313
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@warp-ds/elements",
4
- "version": "2.2.0-next.21",
4
+ "version": "2.2.0-next.23",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -629,6 +629,10 @@
629
629
  {
630
630
  "name": "invalid",
631
631
  "value": { "type": "boolean", "default": "false" }
632
+ },
633
+ {
634
+ "name": "disabled",
635
+ "value": { "type": "boolean", "default": "false" }
632
636
  }
633
637
  ],
634
638
  "events": [],
@@ -637,7 +641,8 @@
637
641
  { "name": "type", "type": "'radio' | 'checkbox'" },
638
642
  { "name": "checked", "type": "boolean" },
639
643
  { "name": "indeterminate", "type": "boolean" },
640
- { "name": "invalid", "type": "boolean" }
644
+ { "name": "invalid", "type": "boolean" },
645
+ { "name": "disabled", "type": "boolean" }
641
646
  ],
642
647
  "events": []
643
648
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@warp-ds/elements",
3
3
  "type": "module",
4
- "version": "2.2.0-next.22",
4
+ "version": "2.2.0-next.24",
5
5
  "packageManager": "pnpm@10.19.0",
6
6
  "description": "Custom elements for Warp",
7
7
  "exports": {