nitro-web 0.0.32 → 0.0.33

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/index.ts CHANGED
@@ -48,7 +48,6 @@ export { FieldCurrency, type FieldCurrencyProps } from '../components/partials/f
48
48
  export { FieldDate, type FieldDateProps } from '../components/partials/form/field-date'
49
49
  export { Location } from '../components/partials/form/location'
50
50
  export { Select, getSelectStyle } from '../components/partials/form/select'
51
- export { Toggle } from '../components/partials/form/toggle'
52
51
 
53
52
  // Component Other
54
53
  export { IsFirstRender } from '../components/partials/is-first-render'
@@ -87,8 +87,8 @@ export function Calendar({ mode='single', onChange, value, numberOfMonths, month
87
87
  months: `${d.months} flex-nowrap`,
88
88
  month_caption: `${d.month_caption} text-2xs pl-2`,
89
89
  caption_label: `${d.caption_label} z-auto`,
90
- button_previous: `${d.button_previous} size-8`,// [&:hover>svg]:fill-primary-dark`,
91
- button_next: `${d.button_next} size-8`,// [&:hover>svg]:fill-primary-dark`,
90
+ button_previous: `${d.button_previous} size-8`,// [&:hover>svg]:fill-input-border-focus`,
91
+ button_next: `${d.button_next} size-8`,// [&:hover>svg]:fill-input-border-focus`,
92
92
  chevron: `${d.chevron} fill-black size-[18px]`,
93
93
 
94
94
  // Days
@@ -98,12 +98,12 @@ export function Calendar({ mode='single', onChange, value, numberOfMonths, month
98
98
 
99
99
  // States
100
100
  focused: `${d.focused} [&>button]:bg-gray-200 [&>button]:border-gray-200`,
101
- range_start: `${d.range_start} [&>button]:!bg-primary-dark [&>button]:!border-primary-dark`,
102
- range_end: `${d.range_end} [&>button]:!bg-primary-dark [&>button]:!border-primary-dark`,
101
+ range_start: `${d.range_start} [&>button]:!bg-input-border-focus [&>button]:!border-input-border-focus`,
102
+ range_end: `${d.range_end} [&>button]:!bg-input-border-focus [&>button]:!border-input-border-focus`,
103
103
  selected: `${d.selected} font-normal `
104
104
  + '[&:not(.rangemiddle)>button]:!text-white '
105
- + '[&:not(.rangemiddle)>button]:!bg-primary-dark '
106
- + '[&:not(.rangemiddle)>button]:!border-primary-dark ',
105
+ + '[&:not(.rangemiddle)>button]:!bg-input-border-focus '
106
+ + '[&:not(.rangemiddle)>button]:!border-input-border-focus ',
107
107
  },
108
108
  }
109
109
 
@@ -10,6 +10,7 @@ import {
10
10
  ArrowLeftCircleIcon,
11
11
  PaintBrushIcon,
12
12
  } from '@heroicons/react/24/outline'
13
+
13
14
  const sidebarWidth = 'lg:w-80'
14
15
 
15
16
  export type SidebarProps = {
@@ -1,27 +1,15 @@
1
1
  type TopbarProps = {
2
2
  title: React.ReactNode
3
3
  subtitle?: React.ReactNode
4
- submenu?: React.ReactNode
5
- btns?: React.ReactNode
6
4
  className?: string
7
5
  }
8
6
 
9
- export function Topbar({ title, subtitle, submenu, btns, className }: TopbarProps) {
7
+ export function Topbar({ title, subtitle, className }: TopbarProps) {
10
8
  return (
11
- <div class={`flex justify-between items-end mb-6 nitro-topbar ${className||''}`}>
12
- <div class="flex flex-col min-h-12">
13
- { subtitle && <div class="py-2 text-sm">{subtitle}</div>}
14
- <div class="flex items-center py-2">
15
- <h1 class="h1 mb-0">{title}</h1>
16
- </div>
17
- {
18
- submenu &&
19
- <div class="pt-2 text-large weight-500">{submenu}</div>
20
- }
21
- </div>
22
- <div class="">
23
- {btns}
24
- </div>
9
+ <div class={`flex flex-col min-h-12 gap-0.5 mb-6 nitro-topbar ${className||''}`}>
10
+ <div class="text-2xl font-bold">{title}</div>
11
+ { subtitle && <div class="text-sm text-muted-foreground">{subtitle}</div>}
12
+ {/* { submenu && <div class="pt-2 text-large weight-500">{submenu}</div> } */}
25
13
  </div>
26
14
  )
27
15
  }
@@ -42,7 +42,13 @@ export function Checkbox({ name, id, size='sm', subtext, text, type='checkbox',
42
42
  id={id}
43
43
  name={name}
44
44
  type={type}
45
- className={`${type === 'radio' ? 'rounded-full' : 'rounded'} col-start-1 row-start-1 appearance-none border border-gray-300 bg-white checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto`}
45
+ className={
46
+ `${type === 'radio' ? 'rounded-full' : 'rounded'} col-start-1 row-start-1 appearance-none border border-gray-300 bg-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto ` +
47
+ // Default
48
+ 'checked:border-blue-600 checked:bg-blue-600 indeterminate:border-blue-600 indeterminate:bg-blue-600 focus-visible:outline-blue-600 ' +
49
+ // Variable-selected color defined?
50
+ 'checked:!border-variable-selected checked:!bg-variable-selected indeterminate:!border-variable-selected indeterminate:!bg-variable-selected focus-visible:!outline-variable-selected'
51
+ }
46
52
  />
47
53
  <svg
48
54
  fill="none"
@@ -89,7 +95,15 @@ export function Checkbox({ name, id, size='sm', subtext, text, type='checkbox',
89
95
  />
90
96
  <label
91
97
  for={id}
92
- className={`col-start-1 row-start-1 relative ${_size.toggleWidth} ${_size.toggleHeight} bg-gray-200 peer-focus-visible:outline-none peer-focus-visible:ring-4 peer-focus-visible:ring-blue-300 dark:peer-focus-visible:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full ${_size.toggleAfterSize} after:transition-all dark:border-gray-600 peer-checked:bg-blue-600`}
98
+ className={
99
+ `col-start-1 row-start-1 relative ${_size.toggleWidth} ${_size.toggleHeight} bg-gray-200 peer-focus-visible:outline-none peer-focus-visible:ring-4 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full ${_size.toggleAfterSize} after:transition-all ` +
100
+ // Default
101
+ 'peer-focus-visible:ring-blue-300 peer-checked:bg-blue-600 ' +
102
+ // Variable-selected color defined?
103
+ 'peer-focus-visible:!ring-variable-selected peer-checked:!bg-variable-selected '
104
+ // Dark mode not used yet...
105
+ // 'dark:peer-focus-visible:ring-blue-800 dark:bg-gray-700 dark:border-gray-600 '
106
+ }
93
107
  />
94
108
  </div>
95
109
  }
@@ -179,7 +179,7 @@ function TimePicker({ date, onChange }: TimePickerProps) {
179
179
  key={item}
180
180
  className={
181
181
  'size-[33px] rounded-full flex justify-center items-center group-hover:bg-gray-100 '
182
- + (item === currentValue ? '!bg-primary-dark text-white' : '')
182
+ + (item === currentValue ? '!bg-input-border-focus text-white' : '')
183
183
  }
184
184
  onClick={() => handleTimeChange(type, item)}
185
185
  >
@@ -143,7 +143,9 @@ function getInputClasses({ error, Icon, iconPos, type }: { error: Error, Icon?:
143
143
  `block ${py} col-start-1 row-start-1 w-full rounded-md bg-white text-sm leading-[1.65] outline outline-1 -outline-offset-1 ` +
144
144
  'placeholder:text-input-placeholder focus:outline focus:outline-2 focus:-outline-offset-2 ' +
145
145
  (iconPos == 'right' && Icon ? `${pl} ${prWithIcon} ` : (Icon ? `${plWithIcon} ${pr} ` : `${pl} ${pr} `)) +
146
- (error ? 'text-red-900 outline-danger focus:outline-danger ' : 'text-input outline-input-border focus:outline-primary ') +
146
+ (error
147
+ ? 'text-red-900 outline-danger focus:outline-danger '
148
+ : 'text-input outline-input-border focus:outline-input-border-focus ') +
147
149
  (iconPos == 'right' ? 'justify-self-start ' : 'justify-self-end ') +
148
150
  'nitro-input'
149
151
  )
@@ -238,7 +238,7 @@ const selectStyles = {
238
238
  // Input container
239
239
  control: {
240
240
  base: 'rounded-md bg-white hover:cursor-pointer text-sm leading-[1.65] outline outline-1 -outline-offset-1 outline-input-border',
241
- focus: 'outline-2 -outline-offset-2 outline-primary',
241
+ focus: 'outline-2 -outline-offset-2 outline-input-border-focus',
242
242
  error: 'outline-danger',
243
243
  },
244
244
  valueContainer: 'py-2 px-3 py-input-y px-input-x gap-1',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro-web",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
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 🚀",
@@ -1,54 +0,0 @@
1
- type ToggleProps = {
2
- className?: string
3
- id?: string
4
- name: string
5
- subtext?: string
6
- text?: string
7
- type?: 'checkbox'
8
- }
9
-
10
- export function Toggle({ name, id, subtext, text, type='checkbox', ...props }: ToggleProps) {
11
- id = id || name
12
- // https://tailwindui.com/components/application-ui/forms/checkboxes#component-744ed4fa65ba36b925701eb4da5c6e31
13
- return (
14
- <div className={`mt-2.5 mb-6 mt-input-before mb-input-after flex gap-3 nitro-toggle ${props.className || ''}`}>
15
- <div className="flex h-6 shrink-0 items-center">
16
- <div className="group grid size-4 grid-cols-1">
17
- <input
18
- {...props}
19
- id={id}
20
- name={name}
21
- type={type}
22
- className="col-start-1 row-start-1 appearance-none rounded border border-gray-300 bg-white checked:border-indigo-600 checked:bg-indigo-600 indeterminate:border-indigo-600 indeterminate:bg-indigo-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto"
23
- />
24
- <svg
25
- fill="none"
26
- viewBox="0 0 14 14"
27
- className="pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-[:disabled]:stroke-gray-950/25"
28
- >
29
- <path
30
- d="M3 8L6 11L11 3.5"
31
- strokeWidth={2}
32
- strokeLinecap="round"
33
- strokeLinejoin="round"
34
- className="opacity-0 group-has-[:checked]:opacity-100"
35
- />
36
- <path
37
- d="M3 7H11"
38
- strokeWidth={2}
39
- strokeLinecap="round"
40
- strokeLinejoin="round"
41
- className="opacity-0 group-has-[:indeterminate]:opacity-100"
42
- />
43
- </svg>
44
- </div>
45
- </div>
46
- {text && <div className="text-sm/6">
47
- <label for={id}>
48
- <span className="font-medium text-gray-900">{text}</span>
49
- <span className="ml-2 text-gray-500">{subtext}</span>
50
- </label>
51
- </div>}
52
- </div>
53
- )
54
- }