Skip to content

Commit 19bc81c

Browse files
committed
Merge branch '4-dev' into ui4/buttons
2 parents d6690c0 + 9d378af commit 19bc81c

File tree

120 files changed

+1612
-718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1612
-718
lines changed

agents.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ Don't implement a component if the Figma MCP is not available and fails and aler
1818
- Use clean CSS and convert the variables to Tailwind CSS `@apply` statements where possible.
1919
- add the new component to the `src/input.css` file.
2020
- use the BEMCSS methodology for the component classes.
21+
- when the width and height are the same, use the `size-` class instead of `width-` and `height-`.
22+
- don't use `left`/`right` modifiers as we need to support RTL. Use `start`/`end` instead. Same for short names like `ml`, `mr`, `pl`, `pr`, `left`, `right`, etc.
2123

2224
#### Figma
2325

2426
- check the components and see if they use other components. If so, use the existing components.
2527

26-
2728
#### SVGs
2829
- use `svg` helper to render the SVGs.
2930
- use the `helpers.svg` helper to render the SVGs only in view components, never in lookbook previews.
@@ -42,3 +43,15 @@ Don't implement a component if the Figma MCP is not available and fails and aler
4243
- use `yarn`, not npm
4344

4445
#### Files
46+
## Javascript
47+
48+
We use StimulusJS for the javascript.
49+
Aboid writing inline script tags in the HTML unless instructed so or mentioned some kind of "temporary" or "quick" solution .
50+
51+
## HTML Structure
52+
53+
When toggling the visibility of some html elements, use the `hidden` HTML attribute instead of the `hidden` class.
54+
55+
## Ruby on Rails
56+
57+
Whenever possible use the `partial:` keyword when rendering partials unless needed otherwise.

app/assets/stylesheets/application.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
--shadow-modal: " 0px 24px 32px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04)";
4242

4343
--breakpoint-xs: 30rem;
44+
45+
/* Tiny text size originally added for discreet information */
46+
--text-tiny: 0.625rem;
4447
}
4548

4649
@plugin '@tailwindcss/forms';
@@ -103,12 +106,15 @@
103106
@import "./css/components/ui/badge.css";
104107
@import "./css/components/ui/radio_button.css";
105108

109+
@import "./css/components/field-wrapper.css";
106110
@import "./css/components/avatar.css";
107111
@import "./css/components/breadcrumbs.css";
108112
@import "./css/components/button.css";
109113
@import "./css/components/color_scheme_switcher.css";
110114
@import "./css/components/discreet_information.css";
111115
@import "./css/components/tooltip.css";
116+
@import "./css/components/modal.css";
117+
@import "./css/css-animations.css";
112118

113119
html,
114120
body {
@@ -164,6 +170,10 @@
164170
display: none;
165171
}
166172

173+
body.modal-open {
174+
@apply overflow-hidden;
175+
}
176+
167177
trix-editor {
168178
max-height: 320px !important;
169179
overflow-y: auto;
@@ -194,6 +204,18 @@
194204
.selected-row {
195205
@apply bg-neutral-100!;
196206
}
207+
208+
.container-large {
209+
@apply 2xl:container 2xl:mx-auto;
210+
}
211+
212+
.container-small {
213+
@apply 2xl:px-0 2xl:max-w-196 2xl:mx-auto;
214+
}
215+
216+
.container-full-width {
217+
@apply w-full;
218+
}
197219
}
198220

199221
.loading-spinner {

app/assets/stylesheets/css/components/avatar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,5 @@
124124
}
125125

126126
.cado-avatar--tiny .cado-avatar__initials {
127-
@apply text-xs leading-4;
127+
@apply text-tiny leading-4;
128128
}

app/assets/stylesheets/css/components/color_scheme_switcher.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,37 @@
6868
.color-scheme-switcher__text {
6969
@apply text-xs font-medium px-1;
7070
}
71+
72+
/* Accent color dropdown */
73+
.color-scheme-switcher__accent-wrapper {
74+
@apply relative;
75+
}
76+
77+
.color-scheme-switcher__accent-panel {
78+
@apply absolute top-full mt-2 end-0 z-40;
79+
@apply rounded-lg bg-white dark:bg-neutral-800;
80+
@apply border border-neutral-200 dark:border-neutral-700;
81+
@apply shadow-lg p-2 min-w-[160px];
82+
animation: css-animate-slide-down 0.15s ease-out;
83+
}
84+
85+
.color-scheme-switcher__accent-options {
86+
@apply grid grid-cols-3 gap-2;
87+
}
88+
89+
.color-scheme-switcher__accent-option {
90+
@apply flex items-center justify-center p-1;
91+
@apply rounded-md transition-all duration-150;
92+
@apply hover:bg-neutral-100 dark:hover:bg-neutral-700;
93+
@apply focus:outline-none focus:ring-2 focus:ring-primary-400 focus:ring-offset-1;
94+
@apply border-0 bg-transparent cursor-pointer;
95+
}
96+
97+
.color-scheme-switcher__accent-preview {
98+
@apply size-6 rounded-full border-2 border-white dark:border-neutral-600 shadow-sm;
99+
}
100+
101+
.color-scheme-switcher__accent-preview--neutral {
102+
@apply bg-neutral-400 dark:bg-neutral-500;
103+
background-image: linear-gradient(135deg, transparent 45%, white 45%, white 55%, transparent 55%);
104+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.field-wrapper {
2+
@apply relative flex flex-col grow leading-tight size-auto w-full md:flex-row md:items-center py-2 min-h-15 w-full grow-0 text-ellipsis overflow-scroll;
3+
}
4+
5+
.field-wrapper__label {
6+
@apply flex self-start items-center shrink-0 w-full px-4 font-medium text-content text-sm md:w-60 pt-3;
7+
}
8+
9+
.field-wrapper__help {
10+
@apply text-content-secondary mt-2 text-sm;
11+
}
12+
13+
.field-wrapper__label-help {
14+
/* pb-3 offsets the pt of the label */
15+
@apply text-content-secondary text-xs leading-none font-normal pb-3;
16+
}
17+
18+
.field-wrapper__error {
19+
@apply text-danger mt-2 text-sm;
20+
}
21+
22+
.field-wrapper__content {
23+
@apply flex-1 flex flex-row px-4;
24+
}
25+
26+
.field-wrapper__content-wrapper {
27+
@apply w-full md:w-8/12;
28+
}
29+
30+
.field-wrapper--full-width {
31+
.field-wrapper__content-wrapper {
32+
@apply w-full;
33+
}
34+
}
35+
36+
/* Stacked modifier */
37+
.all-fields-stacked .field-wrapper,
38+
.field-wrapper.field-wrapper--stacked {
39+
@apply md:flex-col md:items-start gap-y-1 py-3;
40+
41+
.field-wrapper__label {
42+
@apply md:w-full min-h-0 pt-0;
43+
}
44+
45+
.field-wrapper__label-help {
46+
@apply pb-0;
47+
}
48+
49+
.field-wrapper__content {
50+
@apply pt-0 px-4 w-full;
51+
}
52+
}

0 commit comments

Comments
 (0)