nitro-web 0.3.12 → 0.3.14
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/client/css/components.css +1 -1
- package/client/imgs/github.svg +3 -3
- package/components/dashboard/dashboard.tsx +2 -2
- package/components/partials/element/calendar.tsx +1 -1
- package/components/partials/element/github-link.tsx +1 -1
- package/components/partials/element/sidebar.tsx +2 -2
- package/components/partials/element/timepicker.tsx +2 -2
- package/components/partials/form/checkbox.tsx +2 -2
- package/components/partials/form/field-date.tsx +2 -2
- package/components/partials/form/field.tsx +1 -1
- package/components/partials/form/select.tsx +5 -5
- package/components/partials/styleguide.tsx +45 -30
- package/package.json +1 -1
- package/tailwind.js +8 -2
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
@layer base {
|
|
16
16
|
.border-bottom-with-space {
|
|
17
|
-
@apply relative mb-[6px] after:content-[""] after:absolute after:bottom-[-4px] after:left-0 after:h-[1px] after:w-full after:bg-
|
|
17
|
+
@apply relative mb-[6px] after:content-[""] after:absolute after:bottom-[-4px] after:left-0 after:h-[1px] after:w-full after:bg-border;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
package/client/imgs/github.svg
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
viewBox="0 0 250 250"
|
|
5
5
|
xmlns="http://www.w3.org/2000/svg"
|
|
6
6
|
>
|
|
7
|
-
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" fill="
|
|
7
|
+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" fill="currentColor" />
|
|
8
8
|
<path
|
|
9
9
|
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3
|
|
10
10
|
123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
|
|
11
|
-
fill="
|
|
11
|
+
fill="rgb(var(--background))"
|
|
12
12
|
className="octo-arm"
|
|
13
13
|
style="transform-origin: 130px 106px"
|
|
14
14
|
/>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9
|
|
19
19
|
C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9
|
|
20
20
|
156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
|
|
21
|
-
fill="
|
|
21
|
+
fill="rgb(var(--background))"
|
|
22
22
|
className="octo-body"
|
|
23
23
|
/>
|
|
24
24
|
</svg>
|
|
@@ -3,9 +3,9 @@ import { injectedConfig } from 'nitro-web'
|
|
|
3
3
|
|
|
4
4
|
export function Dashboard() {
|
|
5
5
|
const [store] = useTracked()
|
|
6
|
-
const textColor = store.apiAvailable ? 'text-green-700' : injectedConfig.isStatic ? 'text-foreground' : 'text-pink-700'
|
|
6
|
+
const textColor = store.apiAvailable ? 'text-green-700 dark:text-green-400' : injectedConfig.isStatic ? 'text-foreground/85' : 'text-pink-700 dark:text-pink-400'
|
|
7
7
|
const fillColor = store.apiAvailable ? 'fill-green-500' : injectedConfig.isStatic ? 'fill-muted-foreground' : 'fill-pink-500'
|
|
8
|
-
const bgColor = store.apiAvailable ? 'bg-green-100' : injectedConfig.isStatic ? 'bg-
|
|
8
|
+
const bgColor = store.apiAvailable ? 'bg-green-100 dark:bg-green-500/15' : injectedConfig.isStatic ? 'bg-foreground/[0.07]' : 'bg-pink-100 dark:bg-pink-500/15'
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<div css={style}>
|
|
@@ -124,7 +124,7 @@ export function Calendar({ value, numberOfMonths, month: monthProp, className, p
|
|
|
124
124
|
day_button: `${d.day_button} ${dayButtonClassName}`,
|
|
125
125
|
|
|
126
126
|
// States
|
|
127
|
-
focused: `${d.focused} [&>button]:bg-
|
|
127
|
+
focused: `${d.focused} [&>button]:bg-border [&>button]:border-border`,
|
|
128
128
|
range_start: `${d.range_start} [&>button]:!bg-input-border-focus [&>button]:!border-input-border-focus`,
|
|
129
129
|
range_end: `${d.range_end} [&>button]:!bg-input-border-focus [&>button]:!border-input-border-focus`,
|
|
130
130
|
selected: `${d.selected} font-normal `
|
|
@@ -9,7 +9,7 @@ export function GithubLink({ filename }: { filename: string }) {
|
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
// <a href={link}>Go to Github</a>
|
|
12
|
-
<a href={link} className="fixed top-0 right-0 nitro-github">
|
|
12
|
+
<a href={link} className="fixed top-0 right-0 nitro-github text-foreground">
|
|
13
13
|
<GithubIcon />
|
|
14
14
|
</a>
|
|
15
15
|
)
|
|
@@ -119,7 +119,7 @@ function SidebarContents ({ Logo, menu, links, themeToggle }: SidebarProps) {
|
|
|
119
119
|
className={classNames(
|
|
120
120
|
isActive(item)
|
|
121
121
|
? 'bg-muted text-primary-text'
|
|
122
|
-
: 'text-foreground/
|
|
122
|
+
: 'text-foreground/85 hover:bg-muted hover:text-primary-text',
|
|
123
123
|
'group flex gap-x-3 items-center rounded-md p-2 text-md/6 font-semibold'
|
|
124
124
|
)}
|
|
125
125
|
>
|
|
@@ -147,7 +147,7 @@ function SidebarContents ({ Logo, menu, links, themeToggle }: SidebarProps) {
|
|
|
147
147
|
className={classNames(
|
|
148
148
|
isActive(team)
|
|
149
149
|
? 'bg-muted text-primary-text'
|
|
150
|
-
: 'text-foreground/
|
|
150
|
+
: 'text-foreground/85 hover:bg-muted hover:text-primary-text',
|
|
151
151
|
'group flex gap-x-3 rounded-md p-2 text-md/6 font-semibold'
|
|
152
152
|
)}
|
|
153
153
|
>
|
|
@@ -117,7 +117,7 @@ export function TimePicker({ value, onChange, className, tz, referenceTimestamp
|
|
|
117
117
|
<div
|
|
118
118
|
key={i}
|
|
119
119
|
ref={refs[type]}
|
|
120
|
-
className="w-[60px] relative overflow-hidden hover:overflow-y-auto border-l border-
|
|
120
|
+
className="w-[60px] relative overflow-hidden hover:overflow-y-auto border-l border-accent sm-scrollbar first:border-l-0"
|
|
121
121
|
>
|
|
122
122
|
<div className="w-[60px] absolute flex flex-col items-center py-2">
|
|
123
123
|
{/* using absolute since the scrollbar takes up space */}
|
|
@@ -133,7 +133,7 @@ export function TimePicker({ value, onChange, className, tz, referenceTimestamp
|
|
|
133
133
|
<button
|
|
134
134
|
key={item}
|
|
135
135
|
className={
|
|
136
|
-
`${dayButtonClassName} rounded-full flex justify-center items-center group-hover:bg-
|
|
136
|
+
`${dayButtonClassName} rounded-full flex justify-center items-center group-hover:bg-accent `
|
|
137
137
|
+ (item === currentValue ? '!bg-input-border-focus text-white' : '')
|
|
138
138
|
}
|
|
139
139
|
>
|
|
@@ -75,7 +75,7 @@ export function Checkbox({
|
|
|
75
75
|
checked={value}
|
|
76
76
|
className={
|
|
77
77
|
twMerge(
|
|
78
|
-
`${type === 'radio' ? 'rounded-full' : 'rounded'} appearance-none border border-input-border bg-input-bg forced-colors:appearance-auto disabled:border-input-border disabled:bg-
|
|
78
|
+
`${type === 'radio' ? 'rounded-full' : 'rounded'} appearance-none border border-input-border bg-input-bg forced-colors:appearance-auto disabled:border-input-border disabled:bg-input-disabled-bg disabled:checked:bg-input-disabled-bg focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ` +
|
|
79
79
|
// Variable-selected theme colors (was .*-blue-600)
|
|
80
80
|
'checked:border-variable-selected checked:bg-variable-selected indeterminate:border-variable-selected indeterminate:bg-variable-selected focus-visible:outline-variable-selected ' +
|
|
81
81
|
// Dark mode not used yet... dark:focus-visible:outline-blue-800
|
|
@@ -131,7 +131,7 @@ export function Checkbox({
|
|
|
131
131
|
style={{ width: toggleWidth, height: toggleHeight }}
|
|
132
132
|
className={
|
|
133
133
|
twMerge(
|
|
134
|
-
'block bg-
|
|
134
|
+
'block bg-border rounded-full transition-colors peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 p-2 ' +
|
|
135
135
|
// Variable-selected theme colors (was .*-blue-600)
|
|
136
136
|
'peer-checked:bg-variable-selected peer-focus-visible:outline-variable-selected ' +
|
|
137
137
|
labelClassName
|
|
@@ -217,7 +217,7 @@ export function FieldDate({
|
|
|
217
217
|
// useffect in the timepicker will use the previous `value`
|
|
218
218
|
value={getStringValue(props.value, props.defaultValue)}
|
|
219
219
|
onChange={onChange<Timestamp>}
|
|
220
|
-
className={`border-l border-
|
|
220
|
+
className={`border-l border-accent ${props.mode == 'single' ? 'min-h-[0]' : ''}`}
|
|
221
221
|
referenceTimestamp={referenceTimestamp}
|
|
222
222
|
tz={tz}
|
|
223
223
|
// _data={{ name: props.name }}
|
|
@@ -226,7 +226,7 @@ export function FieldDate({
|
|
|
226
226
|
</div>
|
|
227
227
|
{
|
|
228
228
|
props.mode == 'time' &&
|
|
229
|
-
<div className="flex justify-between p-2 border-t border-
|
|
229
|
+
<div className="flex justify-between p-2 border-t border-accent">
|
|
230
230
|
<Button color="secondary" size="xs" onClick={() => onNowClick()}>Now</Button>
|
|
231
231
|
<Button color="primary" size="xs" onClick={() => dropdownRef.current?.setIsActive(false)}>Done</Button>
|
|
232
232
|
</div>
|
|
@@ -196,7 +196,7 @@ function getInputClasses({ error, Icon, iconPos, type }: { error?: Error, Icon?:
|
|
|
196
196
|
(type == 'file'
|
|
197
197
|
? 'file:inline-flex file:shrink-0 file:cursor-pointer file:items-center file:justify-center ' +
|
|
198
198
|
'file:rounded file:border-0 file:bg-transparent file:py-[0.1em] file:my-[-0.1em] file:px-[0.4em] file:ml-[-0.4em] file:mr-[0.7em] file:text-input-base file:font-medium file:text-input ' +
|
|
199
|
-
'file:outline-none file:bg-
|
|
199
|
+
'file:outline-none file:bg-accent hover:file:bg-border '
|
|
200
200
|
: ''
|
|
201
201
|
) +
|
|
202
202
|
'nitro-input'
|
|
@@ -449,7 +449,7 @@ function LimitedValueContainer({ chips, rest, maxLines, ...props }:
|
|
|
449
449
|
<div ref={lastRow} class="w-full min-w-0 flex flex-nowrap items-center gap-1 overflow-hidden [&>*]:shrink-0">
|
|
450
450
|
{chips.slice(split.upper, split.upper + split.last)}
|
|
451
451
|
{hidden > 0 && (
|
|
452
|
-
<span class="self-stretch flex items-center rounded bg-
|
|
452
|
+
<span class="self-stretch flex items-center rounded bg-accent text-muted-foreground text-xs px-1.5 whitespace-nowrap">
|
|
453
453
|
+{hidden}
|
|
454
454
|
</span>
|
|
455
455
|
)}
|
|
@@ -555,7 +555,7 @@ const selectClassNames = {
|
|
|
555
555
|
},
|
|
556
556
|
multiValue: 'bg-primary text-white rounded items-center pl-2 pr-1.5 gap-1.5',
|
|
557
557
|
multiValueLabel: 'text-xs',
|
|
558
|
-
multiValueRemove: 'border border-
|
|
558
|
+
multiValueRemove: 'border border-black/10 bg-clip-content bg-white rounded-md text-black hover:bg-red-50', // fixed colours, sits on the primary chip
|
|
559
559
|
placeholder: 'text-input-placeholder truncate',
|
|
560
560
|
singleValue: {
|
|
561
561
|
base: 'text-input !overflow-visible min-w-0 flex items-center',
|
|
@@ -564,9 +564,9 @@ const selectClassNames = {
|
|
|
564
564
|
},
|
|
565
565
|
// Icon indicators
|
|
566
566
|
clearIndicator: 'text-muted-foreground p-1 rounded-md hover:bg-red-50 hover:text-danger-foreground ml-[-0.8em]',
|
|
567
|
-
dropdownIndicator: 'p-1 hover:bg-
|
|
567
|
+
dropdownIndicator: 'p-1 hover:bg-accent text-muted-foreground rounded-md hover:text-foreground',
|
|
568
568
|
indicatorsContainer: 'p-1 pl-0 pr-2 gap-1 relative', // relative so the hitbox goes over the control
|
|
569
|
-
indicatorSeparator: 'py-0.5 before:content-[""] before:block before:bg-
|
|
569
|
+
indicatorSeparator: 'py-0.5 before:content-[""] before:block before:bg-accent before:w-px before:h-full',
|
|
570
570
|
// Dropdown menu
|
|
571
571
|
menu: 'mt-1.5 border border-dropdown-ul-border bg-surface rounded-md text-input-base overflow-hidden shadow-dropdown-ul',
|
|
572
572
|
groupHeading: 'ml-3 mt-2 mb-1 text-muted-foreground text-input-base',
|
|
@@ -574,7 +574,7 @@ const selectClassNames = {
|
|
|
574
574
|
option: {
|
|
575
575
|
base: 'relative px-3 py-2 !flex items-center gap-2 cursor-default',
|
|
576
576
|
hover: 'bg-muted',
|
|
577
|
-
selected: '!bg-
|
|
577
|
+
selected: '!bg-accent text-dropdown-selected-foreground',
|
|
578
578
|
},
|
|
579
579
|
// Nitro specific
|
|
580
580
|
flag: 'align-middle text-[1.2em] leading-[1em] mr-1.5 flex-shrink-0',
|
|
@@ -13,7 +13,6 @@ const allGroups = [
|
|
|
13
13
|
'Links',
|
|
14
14
|
'Dropdowns',
|
|
15
15
|
'Filters',
|
|
16
|
-
'Theme',
|
|
17
16
|
'Button Colors & Sizes',
|
|
18
17
|
'Button Icons',
|
|
19
18
|
'Loading Elements',
|
|
@@ -23,6 +22,7 @@ const allGroups = [
|
|
|
23
22
|
'Date Inputs',
|
|
24
23
|
'File Inputs & Calendar & Time',
|
|
25
24
|
'Tables',
|
|
25
|
+
'Theme',
|
|
26
26
|
'Modals & Notifications',
|
|
27
27
|
'Custom Components',
|
|
28
28
|
] as const
|
|
@@ -35,6 +35,21 @@ const statusColors = function(status: string) {
|
|
|
35
35
|
}[status]
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
// Section heading with an id, click to jump to it (works with hash routing too)
|
|
39
|
+
function Heading({ children }: { children: string }) {
|
|
40
|
+
const id = children.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '')
|
|
41
|
+
const jump = (e: React.MouseEvent) => {
|
|
42
|
+
e.preventDefault()
|
|
43
|
+
document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' })
|
|
44
|
+
}
|
|
45
|
+
return (
|
|
46
|
+
<h2 id={id} class="h3 group relative scroll-mt-4">
|
|
47
|
+
<a href={`#${id}`} onClick={jump} class="absolute -left-4 inset-y-0 flex items-center text-base text-foreground opacity-0 group-hover:opacity-100">#</a>
|
|
48
|
+
<a href={`#${id}`} onClick={jump}>{children}</a>
|
|
49
|
+
</h2>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
38
53
|
type StyleguideProps = {
|
|
39
54
|
className?: string
|
|
40
55
|
elements?: { Button?: typeof ButtonNitro }
|
|
@@ -268,7 +283,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
268
283
|
|
|
269
284
|
{visibleGroups.includes('Links') && (
|
|
270
285
|
<div>
|
|
271
|
-
<
|
|
286
|
+
<Heading>Links</Heading>
|
|
272
287
|
<div class="mb-6">
|
|
273
288
|
<a class="mr-2" href="#">Default</a>
|
|
274
289
|
<a class="underline1 is-active mr-2" href="#">Underline1</a>
|
|
@@ -279,7 +294,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
279
294
|
|
|
280
295
|
{visibleGroups.includes('Dropdowns') && (
|
|
281
296
|
<div>
|
|
282
|
-
<
|
|
297
|
+
<Heading>Dropdowns</Heading>
|
|
283
298
|
<div class="flex flex-wrap gap-x-6 gap-y-4 mb-6">
|
|
284
299
|
<div>
|
|
285
300
|
<Dropdown options={options} minWidth="250px">
|
|
@@ -313,7 +328,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
313
328
|
|
|
314
329
|
{visibleGroups.includes('Filters') && (
|
|
315
330
|
<div>
|
|
316
|
-
<
|
|
331
|
+
<Heading>Filters</Heading>
|
|
317
332
|
<div class="flex flex-wrap gap-x-6 gap-y-4 mb-6">
|
|
318
333
|
{/* Filter dropdown */}
|
|
319
334
|
<Filters
|
|
@@ -341,25 +356,9 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
341
356
|
</div>
|
|
342
357
|
)}
|
|
343
358
|
|
|
344
|
-
{visibleGroups.includes('Theme') && (
|
|
345
|
-
<div>
|
|
346
|
-
<h2 class="h3">Theme</h2>
|
|
347
|
-
<div class="flex flex-wrap gap-2 mb-6">
|
|
348
|
-
{['background', 'foreground', 'surface', 'muted', 'muted-foreground', 'border', 'input-bg', 'overlay'].map(token => (
|
|
349
|
-
<div
|
|
350
|
-
key={token}
|
|
351
|
-
class={`w-28 h-8 rounded-md border flex items-center px-2 text-xs bg-${token} ${token.match(/foreground|overlay/) ? 'text-background' : ''}`}
|
|
352
|
-
>
|
|
353
|
-
{token}
|
|
354
|
-
</div>
|
|
355
|
-
))}
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
358
|
-
)}
|
|
359
|
-
|
|
360
359
|
{visibleGroups.includes('Button Colors & Sizes') && (
|
|
361
360
|
<div>
|
|
362
|
-
<
|
|
361
|
+
<Heading>Button Colors & Sizes</Heading>
|
|
363
362
|
<div class="flex flex-wrap gap-x-6 gap-y-4 mb-6">
|
|
364
363
|
{/* Colors */}
|
|
365
364
|
<div><Button color="primary">primary (default)</Button></div>
|
|
@@ -383,7 +382,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
383
382
|
|
|
384
383
|
{visibleGroups.includes('Button Icons') && (
|
|
385
384
|
<div>
|
|
386
|
-
<
|
|
385
|
+
<Heading>Button Icons</Heading>
|
|
387
386
|
<div class="flex flex-wrap gap-x-6 gap-y-4 mb-6">
|
|
388
387
|
{/* Icons */}
|
|
389
388
|
<div><Button IconLeft={<Check size={19} className="-my-5" />}>IconLeft</Button></div>
|
|
@@ -403,7 +402,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
403
402
|
|
|
404
403
|
{visibleGroups.includes('Loading Elements') && (
|
|
405
404
|
<div>
|
|
406
|
-
<
|
|
405
|
+
<Heading>Loading Elements</Heading>
|
|
407
406
|
<div class="flex flex-wrap gap-x-6 gap-y-4 items-center mb-6">
|
|
408
407
|
<div><Spinner /></div>
|
|
409
408
|
<div><Spinner className="border-secondary" /></div>
|
|
@@ -415,7 +414,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
415
414
|
|
|
416
415
|
{visibleGroups.includes('Varients') && (
|
|
417
416
|
<div>
|
|
418
|
-
<
|
|
417
|
+
<Heading>Varients</Heading>
|
|
419
418
|
<div class="grid grid-cols-3 gap-x-6">
|
|
420
419
|
<div>
|
|
421
420
|
<label for="input2">Toggles</label>
|
|
@@ -441,7 +440,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
441
440
|
|
|
442
441
|
{visibleGroups.includes('Selects') && (
|
|
443
442
|
<div>
|
|
444
|
-
<
|
|
443
|
+
<Heading>Selects</Heading>
|
|
445
444
|
<div class="flex gap-x-6">
|
|
446
445
|
<div class="flex-1">
|
|
447
446
|
<label for="action">Default</label>
|
|
@@ -622,7 +621,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
622
621
|
|
|
623
622
|
{visibleGroups.includes('Inputs') && (
|
|
624
623
|
<div>
|
|
625
|
-
<
|
|
624
|
+
<Heading>Inputs</Heading>
|
|
626
625
|
<div class="grid grid-cols-3 gap-x-6">
|
|
627
626
|
<div>
|
|
628
627
|
<label for="firstName">First Name</label>
|
|
@@ -694,7 +693,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
694
693
|
|
|
695
694
|
{visibleGroups.includes('Date Inputs') && (
|
|
696
695
|
<div>
|
|
697
|
-
<
|
|
696
|
+
<Heading>Date Inputs</Heading>
|
|
698
697
|
<div class="grid grid-cols-1 gap-x-6 sm:grid-cols-3">
|
|
699
698
|
<div>
|
|
700
699
|
<label for="dateTime">Date with time</label>
|
|
@@ -745,7 +744,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
745
744
|
|
|
746
745
|
{visibleGroups.includes('File Inputs & Calendar & Time') && (
|
|
747
746
|
<div>
|
|
748
|
-
<
|
|
747
|
+
<Heading>File Inputs & Calendar & Time</Heading>
|
|
749
748
|
<div class="grid grid-cols-3 gap-x-6">
|
|
750
749
|
<div>
|
|
751
750
|
<label for="avatar">Avatar</label>
|
|
@@ -783,7 +782,7 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
783
782
|
{visibleGroups.includes('Tables') && (
|
|
784
783
|
<div>
|
|
785
784
|
<div class="flex justify-between items-start">
|
|
786
|
-
<
|
|
785
|
+
<Heading>Tables</Heading>
|
|
787
786
|
<Field
|
|
788
787
|
name="tableFilter"
|
|
789
788
|
type="search"
|
|
@@ -856,10 +855,26 @@ export function Styleguide({ className, elements, children, currencies, groups }
|
|
|
856
855
|
</div>
|
|
857
856
|
)}
|
|
858
857
|
|
|
858
|
+
{visibleGroups.includes('Theme') && (
|
|
859
|
+
<div>
|
|
860
|
+
<Heading>Theme</Heading>
|
|
861
|
+
<div class="flex flex-wrap gap-2 mb-6">
|
|
862
|
+
{['background', 'foreground', 'surface', 'muted', 'muted-foreground', 'border', 'input-bg', 'overlay'].map(token => (
|
|
863
|
+
<div
|
|
864
|
+
key={token}
|
|
865
|
+
class={`w-28 h-8 rounded-md border flex items-center px-2 text-xs bg-${token} ${token.match(/foreground|overlay/) ? 'text-background' : ''}`}
|
|
866
|
+
>
|
|
867
|
+
{token}
|
|
868
|
+
</div>
|
|
869
|
+
))}
|
|
870
|
+
</div>
|
|
871
|
+
</div>
|
|
872
|
+
)}
|
|
873
|
+
|
|
859
874
|
{visibleGroups.includes('Modals & Notifications') && (
|
|
860
875
|
<React.Fragment>
|
|
861
876
|
<div>
|
|
862
|
-
<
|
|
877
|
+
<Heading>Modals & Notifications</Heading>
|
|
863
878
|
<div class="flex flex-wrap gap-x-6 gap-y-4 mb-6">
|
|
864
879
|
<Button color="primary" onClick={() => setShowModal1(true)}>Modal (default)</Button>
|
|
865
880
|
<Button color="danger" onClick={() => setStore((s) => ({ ...s, message: { text: 'Error.', type: 'error' }}))}>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|
package/tailwind.js
CHANGED
|
@@ -11,10 +11,13 @@ export const themeDefaults = {
|
|
|
11
11
|
'background': '#fdfdfd',
|
|
12
12
|
'foreground': '#111827', // gray-900
|
|
13
13
|
'surface': '#ffffff', // cards, sidebar, dropdowns, modals
|
|
14
|
-
'muted': '#f9fafb', // hover rows
|
|
14
|
+
'muted': '#f9fafb', // hover rows (gray-50)
|
|
15
|
+
'accent': '#f3f4f6', // selected options, chips, a step above muted (gray-100)
|
|
15
16
|
'muted-foreground': '#6b7280', // gray-500
|
|
16
|
-
'border': '#
|
|
17
|
+
'border': '#e7e7e7', // lines
|
|
17
18
|
'input-border': '#d1d5db', // gray-300
|
|
19
|
+
'input-placeholder': '#9ca3af', // gray-400
|
|
20
|
+
'input-disabled': '#9ca3af',
|
|
18
21
|
'input-bg': '#ffffff',
|
|
19
22
|
'input-disabled-bg': '#f3f4f6', // gray-100
|
|
20
23
|
'overlay': '#6b7280', // used with opacity, e.g. bg-overlay/70
|
|
@@ -26,9 +29,12 @@ export const themeDefaults = {
|
|
|
26
29
|
'foreground': '#fafafa', // zinc-50
|
|
27
30
|
'surface': '#18181b', // zinc-900
|
|
28
31
|
'muted': '#27272a', // zinc-800
|
|
32
|
+
'accent': '#303035',
|
|
29
33
|
'muted-foreground': '#a1a1aa', // zinc-400
|
|
30
34
|
'border': '#3a3a40',
|
|
31
35
|
'input-border': '#3a3a40',
|
|
36
|
+
'input-placeholder': '#71717a', // zinc-500
|
|
37
|
+
'input-disabled': '#71717a',
|
|
32
38
|
'input-bg': '#1c1c1f',
|
|
33
39
|
'input-disabled-bg': '#27272a',
|
|
34
40
|
'overlay': '#000000',
|