@redseed/redseed-ui-tailwindcss 7.42.0 → 7.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,127 @@
1
+ /*
2
+ InlineEditableText — click-to-edit text that edits in place.
3
+
4
+ These rules are structural only: the component deliberately sets NO
5
+ typography — font/color/line-height are inherited from context. Do not
6
+ introduce colour/typography here.
7
+
8
+ Layout stability (must not shift the text on hover/edit/save/tick):
9
+ - reserved-width adornment slot: a min-width floor (em-based, scales with
10
+ the inherited font size) that affordance/spinner/tick share, so swapping
11
+ them never reflows the text yet a larger consumer icon can still breathe,
12
+ - opacity-only hover reveal (never display/width change), split on @media (hover: hover),
13
+ - inline-grid auto-grow sizer whose hidden ::after mirror carries data-value.
14
+ */
15
+ .rsui-inline-editable-text {
16
+ display: inline;
17
+ /* Read-only default: an inert label. Text stays selectable, but the cursor
18
+ is the arrow, not the browser's default text I-beam. The --editable
19
+ modifier below overrides this to a pointer. */
20
+ cursor: default;
21
+ }
22
+
23
+ .rsui-inline-editable-text--editable {
24
+ cursor: pointer;
25
+ }
26
+
27
+ /* Keyboard focus indicator for the role="button" editable control (WCAG 2.4.7).
28
+ outline (not box-shadow) so it follows inline text fragments if the value
29
+ wraps. Colour is inherited via currentColor to honour the no-colour rule. */
30
+ .rsui-inline-editable-text--editable:focus-visible {
31
+ outline: 2px solid currentColor;
32
+ outline-offset: 2px;
33
+ border-radius: 0.125em;
34
+ }
35
+
36
+ .rsui-inline-editable-text__value--placeholder {
37
+ /* Dim the placeholder while keeping the inherited text colour — no semantic
38
+ colour token fits without overriding the deliberately-inherited colour. */
39
+ opacity: 0.6;
40
+ }
41
+
42
+ .rsui-inline-editable-text__adornment {
43
+ display: inline-flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ /* em-based so the reserved slot scales with the inherited font size — a
47
+ heading gets a proportionally larger affordance, body text a smaller one,
48
+ matching the component's inherit-from-context typography.
49
+ min-width (not a hard width) reserves a comfortable floor so swapping
50
+ affordance/spinner/tick never shifts the text, while still letting a
51
+ larger icon from another consuming app breathe rather than be clipped. */
52
+ min-width: 1.5em;
53
+ margin-left: 0.5em;
54
+ vertical-align: middle;
55
+ }
56
+
57
+ /* The component owns icon sizing (RSUI convention — see ButtonSlot): the
58
+ consumer just drops an icon component into the slot, sized here in em so it
59
+ scales with the surrounding typography. A 0.85em icon inside the 1.5em-min
60
+ slot always keeps breathing room. No per-consumer width/height. */
61
+ .rsui-inline-editable-text__adornment svg {
62
+ width: 0.85em;
63
+ height: 0.85em;
64
+ }
65
+
66
+ /* Parent-surfaced failure message (optional #error slot). The one deliberate
67
+ colour exception — a failure signal needs the semantic error token, matching
68
+ the RSUI form-field error treatment (see rsui-form-field-slot__error). */
69
+ .rsui-inline-editable-text__error {
70
+ @apply text-sm text-text-error;
71
+ margin-left: 0.5em;
72
+ }
73
+
74
+ .rsui-inline-editable-text__sizer {
75
+ display: inline-grid;
76
+ max-width: 100%;
77
+ min-width: 0;
78
+ vertical-align: top;
79
+ }
80
+
81
+ .rsui-inline-editable-text__sizer::after,
82
+ .rsui-inline-editable-text__input {
83
+ grid-area: 1 / 1;
84
+ width: auto;
85
+ min-width: 0;
86
+ font: inherit;
87
+ color: inherit;
88
+ line-height: inherit;
89
+ white-space: normal;
90
+ overflow-wrap: break-word;
91
+ }
92
+
93
+ .rsui-inline-editable-text__sizer::after {
94
+ content: attr(data-value) " ";
95
+ visibility: hidden;
96
+ }
97
+
98
+ .rsui-inline-editable-text__input {
99
+ border: 0;
100
+ margin: 0;
101
+ padding: 0;
102
+ background: transparent;
103
+ outline: none;
104
+ resize: none;
105
+ overflow: hidden;
106
+ }
107
+
108
+ /*
109
+ On hover-capable devices the pencil affordance is calm — it fades in on
110
+ hover/focus and the value underlines, matching the meeting-title pattern.
111
+ On touch (no hover) the affordance stays visible as the only cue.
112
+ */
113
+ @media (hover: hover) {
114
+ .rsui-inline-editable-text__affordance {
115
+ opacity: 0;
116
+ transition: opacity 0.15s ease-in-out;
117
+ }
118
+
119
+ .rsui-inline-editable-text--editable:hover .rsui-inline-editable-text__affordance,
120
+ .rsui-inline-editable-text--editable:focus-within .rsui-inline-editable-text__affordance {
121
+ opacity: 1;
122
+ }
123
+
124
+ .rsui-inline-editable-text--editable:hover .rsui-inline-editable-text__value {
125
+ text-decoration: underline;
126
+ }
127
+ }
@@ -0,0 +1,51 @@
1
+ .rsui-pill {
2
+ /* Accent falls back to a neutral token when the consumer supplies no color. */
3
+ --rsui-pill-accent: var(--color-background-secondary-contrast);
4
+
5
+ @apply inline-flex items-center gap-2 w-fit h-fit shrink-0;
6
+ @apply rounded-full border border-border-secondary;
7
+ @apply px-3 py-1.5 select-none whitespace-nowrap cursor-pointer transition;
8
+ @apply text-sm font-medium leading-5;
9
+ @apply bg-background-primary text-text-secondary;
10
+
11
+ /* hover state */
12
+ @apply hover:bg-background-secondary;
13
+
14
+ /* focus state — mirrors button_slot (ring, cleared when disabled) */
15
+ @apply outline-hidden;
16
+ @apply focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-border-primary;
17
+ @apply disabled:focus-visible:ring-0;
18
+
19
+ /* disabled state */
20
+ @apply disabled:cursor-default disabled:bg-background-disabled disabled:text-text-disabled disabled:border-transparent;
21
+
22
+ & svg {
23
+ @apply size-5;
24
+ }
25
+ }
26
+
27
+ /* icon badge — solid accent fill with an on-color glyph */
28
+ .rsui-pill__icon {
29
+ @apply inline-flex items-center justify-center shrink-0 size-6 rounded-full;
30
+ @apply text-text-on-color;
31
+ background-color: var(--rsui-pill-accent);
32
+ }
33
+
34
+ /* selected — a single accent ring (the halo) with the resting border cleared so
35
+ it doesn't stack into a heavy double outline (which read near-black on a dark
36
+ accent). The tinted fill carries the accent colour, and the label switches to
37
+ the stronger text-primary — a hue-INDEPENDENT contrast cue so selection still
38
+ reads on a pale accent where the ring/tint wash out. Selection is therefore
39
+ never signalled by colour alone (text-contrast + aria-pressed carry it), and
40
+ the text-colour swap shifts no layout. */
41
+ .rsui-pill--selected {
42
+ @apply ring-2 ring-offset-0 text-text-primary;
43
+ --tw-ring-color: var(--rsui-pill-accent);
44
+ border-color: transparent;
45
+ background-color: color-mix(in srgb, var(--rsui-pill-accent) 16%, var(--color-background-primary));
46
+ }
47
+
48
+ /* disabled — neutralise the accent-driven badge fill */
49
+ .rsui-pill--disabled .rsui-pill__icon {
50
+ background-color: var(--color-background-disabled-contrast);
51
+ }
package/components.css CHANGED
@@ -60,6 +60,7 @@ Please be careful when adding new components and updating the order.
60
60
  @import './components/image_64by25.css';
61
61
  @import './components/image_9by16.css';
62
62
  @import './components/image_circle.css';
63
+ @import './components/inline_editable_text.css';
63
64
  @import './components/link_slot.css';
64
65
  @import './components/link_primary.css';
65
66
  @import './components/linked_list.css';
@@ -78,6 +79,7 @@ Please be careful when adding new components and updating the order.
78
79
  @import './components/pagination_item.css';
79
80
  @import './components/pagination_item_previous.css';
80
81
  @import './components/pagination_item_next.css';
82
+ @import './components/pill.css';
81
83
  @import './components/progress_bar.css';
82
84
  @import './components/progress_circle.css';
83
85
  @import './components/progress_tracker.css';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-tailwindcss",
3
- "version": "7.42.0",
3
+ "version": "7.44.0",
4
4
  "description": "RedSeed UI Tailwindcss",
5
5
  "main": "index.js",
6
6
  "style": "index.css",