nitro-web 0.0.30 → 0.0.32
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 +4 -4
- package/components/dashboard/dashboard.tsx +7 -6
- package/components/partials/element/accordion.tsx +1 -1
- package/components/partials/element/avatar.tsx +1 -1
- package/components/partials/element/button.tsx +5 -5
- package/components/partials/element/calendar.tsx +1 -1
- package/components/partials/element/dropdown.tsx +1 -0
- package/components/partials/element/github-link.tsx +1 -1
- package/components/partials/element/initials.tsx +1 -0
- package/components/partials/element/message.tsx +1 -1
- package/components/partials/element/modal.tsx +1 -1
- package/components/partials/element/sidebar.tsx +1 -1
- package/components/partials/element/tooltip.tsx +1 -1
- package/components/partials/element/topbar.tsx +1 -1
- package/components/partials/form/checkbox.tsx +1 -1
- package/components/partials/form/drop.tsx +1 -1
- package/components/partials/form/{input-currency.tsx → field-currency.tsx} +1 -1
- package/components/partials/form/{input.tsx → field.tsx} +13 -9
- package/components/partials/form/form-error.tsx +1 -1
- package/components/partials/form/select.tsx +3 -3
- package/components/partials/form/toggle.tsx +1 -1
- package/components/partials/styleguide.tsx +6 -6
- package/components/settings/settings-business.tsx +4 -4
- package/components/settings/settings-team--member.tsx +4 -6
- package/components/settings/settings-team.tsx +3 -3
- package/package.json +1 -1
- /package/client/css/{fonts.css → fonts-inter.css} +0 -0
- /package/components/partials/form/{input-color.tsx → field-color.tsx} +0 -0
- /package/components/partials/form/{input-date.tsx → field-date.tsx} +0 -0
package/client/index.ts
CHANGED
|
@@ -42,10 +42,10 @@ export { Checkbox } from '../components/partials/form/checkbox'
|
|
|
42
42
|
export { Drop } from '../components/partials/form/drop'
|
|
43
43
|
export { DropHandler } from '../components/partials/form/drop-handler'
|
|
44
44
|
export { FormError } from '../components/partials/form/form-error'
|
|
45
|
-
export { Field } from '../components/partials/form/
|
|
46
|
-
export { FieldColor, type FieldColorProps } from '../components/partials/form/
|
|
47
|
-
export { FieldCurrency, type FieldCurrencyProps } from '../components/partials/form/
|
|
48
|
-
export { FieldDate, type FieldDateProps } from '../components/partials/form/
|
|
45
|
+
export { Field } from '../components/partials/form/field'
|
|
46
|
+
export { FieldColor, type FieldColorProps } from '../components/partials/form/field-color'
|
|
47
|
+
export { FieldCurrency, type FieldCurrencyProps } from '../components/partials/form/field-currency'
|
|
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
51
|
export { Toggle } from '../components/partials/form/toggle'
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { css, theme } from 'twin.macro'
|
|
2
|
+
import { injectedConfig } from 'nitro-web'
|
|
2
3
|
|
|
3
|
-
export function Dashboard(
|
|
4
|
+
export function Dashboard() {
|
|
4
5
|
const [store] = useTracked()
|
|
5
|
-
const textColor = store.apiAvailable ? 'text-green-700' :
|
|
6
|
-
const fillColor = store.apiAvailable ? 'fill-green-500' :
|
|
7
|
-
const bgColor = store.apiAvailable ? 'bg-green-100' :
|
|
6
|
+
const textColor = store.apiAvailable ? 'text-green-700' : injectedConfig.isStatic ? 'text-gray-700' : 'text-pink-700'
|
|
7
|
+
const fillColor = store.apiAvailable ? 'fill-green-500' : injectedConfig.isStatic ? 'fill-gray-500' : 'fill-pink-500'
|
|
8
|
+
const bgColor = store.apiAvailable ? 'bg-green-100' : injectedConfig.isStatic ? 'bg-[#eeeeee]' : 'bg-pink-100'
|
|
8
9
|
|
|
9
10
|
return (
|
|
10
11
|
<div css={style}>
|
|
@@ -17,7 +18,7 @@ export function Dashboard({ config }: { config: { isStatic?: boolean } }) {
|
|
|
17
18
|
<svg viewBox="0 0 6 6" aria-hidden="true" className={`size-1.5 ${fillColor}`}>
|
|
18
19
|
<circle r={3} cx={3} cy={3} />
|
|
19
20
|
</svg>
|
|
20
|
-
{ store.apiAvailable ? 'API Available' : `API Unavailable${
|
|
21
|
+
{ store.apiAvailable ? 'API Available' : `API Unavailable${injectedConfig.isStatic ? ' (Static Example)' : ''}` }
|
|
21
22
|
</span>
|
|
22
23
|
</p>
|
|
23
24
|
</div>
|
|
@@ -26,6 +27,6 @@ export function Dashboard({ config }: { config: { isStatic?: boolean } }) {
|
|
|
26
27
|
|
|
27
28
|
const style = css`
|
|
28
29
|
.example-usage-of-tailwind-variable {
|
|
29
|
-
color: ${theme('colors.
|
|
30
|
+
color: ${theme('colors.primary')};
|
|
30
31
|
}
|
|
31
32
|
`
|
|
@@ -80,7 +80,7 @@ export function Accordion({ children, className, expanded, onChange }: Accordion
|
|
|
80
80
|
return (
|
|
81
81
|
<div
|
|
82
82
|
ref={el}
|
|
83
|
-
class={['accordion', className, state ? 'is-expanded' : ''].filter(o => o).join(' ')}
|
|
83
|
+
class={['accordion', className, state ? 'is-expanded' : ''].filter(o => o).join(' nitro-accordion')}
|
|
84
84
|
onClick={onClick}
|
|
85
85
|
css={style}
|
|
86
86
|
>
|
|
@@ -13,7 +13,7 @@ type AvatarProps = {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function Avatar({ awsUrl, isRound, user, showPlaceholderImage, className }: AvatarProps) {
|
|
16
|
-
const classes = 'rounded-full w-[30px] h-[30px] object-cover transition-all duration-150 ease ' + (className || '')
|
|
16
|
+
const classes = 'rounded-full w-[30px] h-[30px] object-cover transition-all duration-150 ease nitro-avatar ' + (className || '')
|
|
17
17
|
|
|
18
18
|
function getInitials(user: User) {
|
|
19
19
|
const text = (user.firstName ? [user.firstName, user.lastName] : (user?.name||'').split(' ')).map((o) => o?.charAt(0))
|
|
@@ -41,10 +41,10 @@ export function Button({
|
|
|
41
41
|
|
|
42
42
|
// Button sizes
|
|
43
43
|
const sizes = {
|
|
44
|
-
xs: 'px-2 py-1 text-xs rounded',
|
|
45
|
-
sm: 'px-2.5 py-1.5 text-sm rounded-md',
|
|
46
|
-
md: 'px-3 py-2 text-sm rounded-md',
|
|
47
|
-
lg: 'px-3.5 py-2.5 text-sm rounded-md',
|
|
44
|
+
xs: 'px-2 py-1 px-button-x-xs py-button-y-xs text-xs rounded',
|
|
45
|
+
sm: 'px-2.5 py-1.5 px-button-x-sm py-button-y-sm text-sm rounded-md',
|
|
46
|
+
md: 'px-3 py-2 px-button-x py-button-y text-sm rounded-md',
|
|
47
|
+
lg: 'px-3.5 py-2.5 px-button-x-lg py-button-y-lg text-sm rounded-md',
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const contentLayout = `w-full gap-x-1.5 ${iconPosition == 'none' ? '' : 'inline-flex items-center justify-center'}`
|
|
@@ -57,7 +57,7 @@ export function Button({
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
|
-
<button class={twMerge(`${base} ${colors[color]} ${sizes[size]} ${contentLayout} ${loading} ${className||''}`)} {...props}>
|
|
60
|
+
<button class={twMerge(`${base} ${colors[color]} ${sizes[size]} ${contentLayout} ${loading} nitro-button ${className||''}`)} {...props}>
|
|
61
61
|
{IconLeft && getIcon(IconLeft)}
|
|
62
62
|
{IconLeftEnd && getIcon(IconLeftEnd)}
|
|
63
63
|
<span class={`${iconPosition == 'leftEnd' || iconPosition == 'rightEnd' ? 'flex-1' : ''}`}>{children}</span>
|
|
@@ -83,7 +83,7 @@ export function Calendar({ mode='single', onChange, value, numberOfMonths, month
|
|
|
83
83
|
range_middle: `${d.range_middle} rangemiddle`,
|
|
84
84
|
},
|
|
85
85
|
classNames: {
|
|
86
|
-
root: `${d.root} flex`,
|
|
86
|
+
root: `${d.root} flex nitro-calendar`,
|
|
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`,
|
|
@@ -91,6 +91,7 @@ export const Dropdown = forwardRef(function Dropdown({
|
|
|
91
91
|
(isHoverable ? ' is-hoverable' : '') +
|
|
92
92
|
(isActive ? ' is-active' : '') +
|
|
93
93
|
(!animate ? ' no-animation' : '') +
|
|
94
|
+
' nitro-dropdown' +
|
|
94
95
|
(className ? ` ${className}` : '')
|
|
95
96
|
}
|
|
96
97
|
onClick={(e) => e.stopPropagation()} // required for dropdowns inside row links
|
|
@@ -20,6 +20,7 @@ export function Initials({ icon, isBig, isMedium, isSmall, isRound, className }:
|
|
|
20
20
|
(isSmall ? ' is-small' : '') +
|
|
21
21
|
(isRound ? ' is-round' : '') +
|
|
22
22
|
(icon ? '' : ' is-empty') +
|
|
23
|
+
' nitro-initials' +
|
|
23
24
|
(className ? ' ' + className : '')
|
|
24
25
|
}
|
|
25
26
|
style={icon ? {backgroundColor: icon?.hex + '15', color: icon?.hex} : {}}
|
|
@@ -82,7 +82,7 @@ export function Message() {
|
|
|
82
82
|
{/* Global notification live region, render this permanently at the end of the document */}
|
|
83
83
|
<div
|
|
84
84
|
aria-live="assertive"
|
|
85
|
-
className="pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-20"
|
|
85
|
+
className="pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-20 nitro-message"
|
|
86
86
|
>
|
|
87
87
|
<div className="flex w-full flex-col items-center space-y-4 sm:items-end">
|
|
88
88
|
{/* Notification panel, dynamically insert this into the live region when it needs to be displayed */}
|
|
@@ -64,7 +64,7 @@ export function Modal({ show, setShow, children, maxWidth, minHeight, dismissabl
|
|
|
64
64
|
return (
|
|
65
65
|
<div
|
|
66
66
|
onClick={(e) => e.stopPropagation()}
|
|
67
|
-
class={`fixed top-0 w-[100vw] h-[100vh] z-[700] ${_state.root}`}
|
|
67
|
+
class={`fixed top-0 w-[100vw] h-[100vh] z-[700] nitro-modal ${_state.root}`}
|
|
68
68
|
>
|
|
69
69
|
<div class={`!absolute inset-0 box-content bg-gray-500/70 transition-opacity ${_state.bg}`}></div>
|
|
70
70
|
<div class={`relative h-[100vh] overflow-y-auto transition-[opacity,transform] ${_state.container}`}>
|
|
@@ -27,7 +27,7 @@ export function Sidebar({ Logo, menu, links }: SidebarProps) {
|
|
|
27
27
|
return (
|
|
28
28
|
<>
|
|
29
29
|
{/* mobile sidebar opened */}
|
|
30
|
-
<Dialog open={sidebarOpen} onClose={setSidebarOpen} className="relative z-50 lg:hidden">
|
|
30
|
+
<Dialog open={sidebarOpen} onClose={setSidebarOpen} className="relative z-50 lg:hidden nitro-sidebar">
|
|
31
31
|
<DialogBackdrop
|
|
32
32
|
transition
|
|
33
33
|
className="fixed inset-0 bg-gray-900/80 transition-opacity duration-300 ease-linear data-[closed]:opacity-0"
|
|
@@ -11,7 +11,7 @@ type TooltipProps = {
|
|
|
11
11
|
|
|
12
12
|
export function Tooltip({ text, children, className, classNamePopup, isSmall }: TooltipProps) {
|
|
13
13
|
return (
|
|
14
|
-
<div class={`${className} relative inline-block align-middle`} css={style}>
|
|
14
|
+
<div class={`${className} relative inline-block align-middle nitro-tooltip`} css={style}>
|
|
15
15
|
{
|
|
16
16
|
text
|
|
17
17
|
? <>
|
|
@@ -8,7 +8,7 @@ type TopbarProps = {
|
|
|
8
8
|
|
|
9
9
|
export function Topbar({ title, subtitle, submenu, btns, className }: TopbarProps) {
|
|
10
10
|
return (
|
|
11
|
-
<div class={`flex justify-between items-end mb-6 ${className||''}`}>
|
|
11
|
+
<div class={`flex justify-between items-end mb-6 nitro-topbar ${className||''}`}>
|
|
12
12
|
<div class="flex flex-col min-h-12">
|
|
13
13
|
{ subtitle && <div class="py-2 text-sm">{subtitle}</div>}
|
|
14
14
|
<div class="flex items-center py-2">
|
|
@@ -32,7 +32,7 @@ export function Checkbox({ name, id, size='sm', subtext, text, type='checkbox',
|
|
|
32
32
|
const _size = sizeMap[size]
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<div className={`mt-input-before mb-input-after flex gap-3 ${props.className || ''}`}>
|
|
35
|
+
<div className={`mt-2.5 mb-6 mt-input-before mb-input-after flex gap-3 nitro-checkbox ${props.className || ''}`}>
|
|
36
36
|
<div className="flex shrink-0 mt-[2px]">
|
|
37
37
|
{
|
|
38
38
|
type !== 'toggle'
|
|
@@ -99,7 +99,7 @@ export function Drop({ awsUrl, className, id, name, onChange, multiple, state, .
|
|
|
99
99
|
// }
|
|
100
100
|
|
|
101
101
|
return (
|
|
102
|
-
<div class={`mt-input-before mb-input-after ${className || ''}`}>
|
|
102
|
+
<div class={`mt-2.5 mb-6 mt-input-before mb-input-after nitro-field nitro-drop ${className || ''}`}>
|
|
103
103
|
<input
|
|
104
104
|
{...props}
|
|
105
105
|
id={inputId}
|
|
@@ -148,7 +148,7 @@ export function FieldCurrency({ config, currency='nzd', onChange, value, default
|
|
|
148
148
|
defaultValue={defaultValue}
|
|
149
149
|
/>
|
|
150
150
|
<span
|
|
151
|
-
class={`absolute top-[1px] bottom-0 left-3 inline-flex items-center select-none text-gray-500 text-sm sm:text-sm/6 ${dollars !== null && settings.prefix == '$' ? 'text-
|
|
151
|
+
class={`absolute top-[1px] bottom-0 left-3 inline-flex items-center select-none text-gray-500 text-sm sm:text-sm/6 ${dollars !== null && settings.prefix == '$' ? 'text-foreground' : ''}`}
|
|
152
152
|
>
|
|
153
153
|
{settings.prefix || settings.suffix}
|
|
154
154
|
</span>
|
|
@@ -46,7 +46,7 @@ export function Field({ state, icon, iconPos: ip, ...props }: FieldProps) {
|
|
|
46
46
|
const iconPos = ip == 'left' || (type == 'color' && !ip) ? 'left' : 'right'
|
|
47
47
|
|
|
48
48
|
if (!props.name) {
|
|
49
|
-
throw new Error('
|
|
49
|
+
throw new Error('Field component requires a `name` prop')
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// Input type
|
|
@@ -58,7 +58,7 @@ export function Field({ state, icon, iconPos: ip, ...props }: FieldProps) {
|
|
|
58
58
|
if (props.value) value = props.value as string
|
|
59
59
|
else if (typeof state == 'object') value = util.deepFind(state, props.name) ?? ''
|
|
60
60
|
|
|
61
|
-
// Errors: find any that match this
|
|
61
|
+
// Errors: find any that match this field path
|
|
62
62
|
for (const item of (state?.errors || [])) {
|
|
63
63
|
if (util.isRegex(props.name) && (item.title || '').match(props.name)) error = item
|
|
64
64
|
else if (item.title == props.name) error = item
|
|
@@ -126,22 +126,26 @@ export function Field({ state, icon, iconPos: ip, ...props }: FieldProps) {
|
|
|
126
126
|
|
|
127
127
|
function FieldContainer({ children, className, error }: { children: React.ReactNode, className?: string, error?: Error }) {
|
|
128
128
|
return (
|
|
129
|
-
<div css={style} className={`mt-input-before mb-input-after grid grid-cols-1 ${className || ''}`}>
|
|
129
|
+
<div css={style} className={`mt-2.5 mb-6 mt-input-before mb-input-after grid grid-cols-1 nitro-field ${className || ''}`}>
|
|
130
130
|
{children}
|
|
131
|
-
{error && <div class="mt-1.5 text-xs text-danger">{error.detail}</div>}
|
|
131
|
+
{error && <div class="mt-1.5 text-xs text-danger nitro-error">{error.detail}</div>}
|
|
132
132
|
</div>
|
|
133
133
|
)
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
function getInputClasses({ error, Icon, iconPos, type }: { error: Error, Icon?: React.ReactNode, iconPos: string, type?: string }) {
|
|
137
|
-
const
|
|
138
|
-
const
|
|
137
|
+
const pl = 'pl-3 pl-input-x'
|
|
138
|
+
const pr = 'pr-3 pr-input-x'
|
|
139
|
+
const py = 'py-2 py-input-y'
|
|
140
|
+
const plWithIcon = type == 'color' ? 'pl-9' : 'pl-8' // was sm:pl-8 pl-8, etc
|
|
141
|
+
const prWithIcon = type == 'color' ? 'pr-9' : 'pr-8'
|
|
139
142
|
return (
|
|
140
|
-
|
|
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 ` +
|
|
141
144
|
'placeholder:text-input-placeholder focus:outline focus:outline-2 focus:-outline-offset-2 ' +
|
|
142
|
-
(iconPos == 'right' && Icon ? `${
|
|
145
|
+
(iconPos == 'right' && Icon ? `${pl} ${prWithIcon} ` : (Icon ? `${plWithIcon} ${pr} ` : `${pl} ${pr} `)) +
|
|
143
146
|
(error ? 'text-red-900 outline-danger focus:outline-danger ' : 'text-input outline-input-border focus:outline-primary ') +
|
|
144
|
-
(iconPos == 'right' ? 'justify-self-start ' : 'justify-self-end ')
|
|
147
|
+
(iconPos == 'right' ? 'justify-self-start ' : 'justify-self-end ') +
|
|
148
|
+
'nitro-input'
|
|
145
149
|
)
|
|
146
150
|
}
|
|
147
151
|
|
|
@@ -18,7 +18,7 @@ export function FormError({ state, fields, className }: FormError) {
|
|
|
18
18
|
return (
|
|
19
19
|
<>
|
|
20
20
|
{error ? (
|
|
21
|
-
<div class={`text-danger mt-1 text-sm ${className||''}`}>
|
|
21
|
+
<div class={`text-danger mt-1 text-sm nitro-error ${className||''}`}>
|
|
22
22
|
{error.detail}
|
|
23
23
|
</div>
|
|
24
24
|
) : null}
|
|
@@ -58,7 +58,7 @@ export function Select({ inputId, minMenuWidth, name, prefix='', onChange, optio
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
|
-
<div css={style} class="mt-input-before mb-input-after">
|
|
61
|
+
<div css={style} class="mt-2.5 mb-6 mt-input-before mb-input-after nitro-select">
|
|
62
62
|
<ReactSelect
|
|
63
63
|
/**
|
|
64
64
|
* react-select prop quick reference (https://react-select.com/props#api):
|
|
@@ -241,7 +241,7 @@ const selectStyles = {
|
|
|
241
241
|
focus: 'outline-2 -outline-offset-2 outline-primary',
|
|
242
242
|
error: 'outline-danger',
|
|
243
243
|
},
|
|
244
|
-
valueContainer: 'py-2 px-3 gap-1',
|
|
244
|
+
valueContainer: 'py-2 px-3 py-input-y px-input-x gap-1',
|
|
245
245
|
// Input container objects
|
|
246
246
|
input: {
|
|
247
247
|
base: 'text-input',
|
|
@@ -249,7 +249,7 @@ const selectStyles = {
|
|
|
249
249
|
},
|
|
250
250
|
multiValue: 'bg-primary text-white rounded items-center pl-2 pr-1.5 gap-1.5',
|
|
251
251
|
multiValueLabel: '',
|
|
252
|
-
multiValueRemove: 'border border-black/10 bg-clip-content bg-white rounded-md text-
|
|
252
|
+
multiValueRemove: 'border border-black/10 bg-clip-content bg-white rounded-md text-foreground hover:bg-red-50',
|
|
253
253
|
placeholder: 'text-input-placeholder',
|
|
254
254
|
singleValue: {
|
|
255
255
|
base: 'text-input',
|
|
@@ -11,7 +11,7 @@ export function Toggle({ name, id, subtext, text, type='checkbox', ...props }: T
|
|
|
11
11
|
id = id || name
|
|
12
12
|
// https://tailwindui.com/components/application-ui/forms/checkboxes#component-744ed4fa65ba36b925701eb4da5c6e31
|
|
13
13
|
return (
|
|
14
|
-
<div className={`mt-input-before mb-input-after flex gap-3 ${props.className || ''}`}>
|
|
14
|
+
<div className={`mt-2.5 mb-6 mt-input-before mb-input-after flex gap-3 nitro-toggle ${props.className || ''}`}>
|
|
15
15
|
<div className="flex h-6 shrink-0 items-center">
|
|
16
16
|
<div className="group grid size-4 grid-cols-1">
|
|
17
17
|
<input
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Drop, Dropdown, Field, Select, Button, Checkbox, GithubLink, Modal, Calendar, injectedConfig } from 'nitro-web'
|
|
2
2
|
import { getCountryOptions, getCurrencyOptions, ucFirst } from 'nitro-web/util'
|
|
3
3
|
import { CheckIcon } from '@heroicons/react/20/solid'
|
|
4
|
-
import { Config } from 'nitro-web/types'
|
|
5
4
|
|
|
6
|
-
export function Styleguide(
|
|
5
|
+
export function Styleguide() {
|
|
7
6
|
const [customerSearch, setCustomerSearch] = useState('')
|
|
8
7
|
const [showModal1, setShowModal1] = useState(false)
|
|
9
8
|
const [state, setState] = useState({
|
|
@@ -167,7 +166,7 @@ export function Styleguide({ config }: { config: Config }) {
|
|
|
167
166
|
name="country"
|
|
168
167
|
type="country"
|
|
169
168
|
state={state}
|
|
170
|
-
options={useMemo(() => getCountryOptions(
|
|
169
|
+
options={useMemo(() => getCountryOptions(injectedConfig.countries), [])}
|
|
171
170
|
onChange={onInputChange}
|
|
172
171
|
/>
|
|
173
172
|
</div>
|
|
@@ -204,7 +203,7 @@ export function Styleguide({ config }: { config: Config }) {
|
|
|
204
203
|
<Select
|
|
205
204
|
name="currency"
|
|
206
205
|
state={state}
|
|
207
|
-
options={useMemo(() => getCurrencyOptions(
|
|
206
|
+
options={useMemo(() => getCurrencyOptions(injectedConfig.currencies), [])}
|
|
208
207
|
onChange={onInputChange}
|
|
209
208
|
/>
|
|
210
209
|
</div>
|
|
@@ -249,7 +248,8 @@ export function Styleguide({ config }: { config: Config }) {
|
|
|
249
248
|
</div>
|
|
250
249
|
<div>
|
|
251
250
|
<label for="amount">Amount ({state.amount})</label>
|
|
252
|
-
<Field name="amount" type="currency" state={state} currency={state.currency || 'nzd'} onChange={onInputChange}
|
|
251
|
+
<Field name="amount" type="currency" state={state} currency={state.currency || 'nzd'} onChange={onInputChange}
|
|
252
|
+
config={injectedConfig} />
|
|
253
253
|
</div>
|
|
254
254
|
</div>
|
|
255
255
|
|
|
@@ -273,7 +273,7 @@ export function Styleguide({ config }: { config: Config }) {
|
|
|
273
273
|
<div class="grid grid-cols-3 gap-x-6 mb-4">
|
|
274
274
|
<div>
|
|
275
275
|
<label for="avatar">Avatar</label>
|
|
276
|
-
<Drop class="is-small" name="avatar" state={state} onChange={onInputChange} awsUrl={
|
|
276
|
+
<Drop class="is-small" name="avatar" state={state} onChange={onInputChange} awsUrl={injectedConfig.awsUrl} />
|
|
277
277
|
</div>
|
|
278
278
|
<div>
|
|
279
279
|
<label for="calendar">Calendar</label>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
////// look at the select type error below
|
|
5
5
|
import * as util from 'nitro-web/util'
|
|
6
6
|
import SvgTick from 'nitro-web/client/imgs/icons/tick.svg'
|
|
7
|
-
import { Button, Field, Select, Topbar, Tabbar } from 'nitro-web'
|
|
7
|
+
import { Button, Field, Select, Topbar, Tabbar, injectedConfig } from 'nitro-web'
|
|
8
8
|
|
|
9
|
-
export function SettingsBusiness(
|
|
9
|
+
export function SettingsBusiness() {
|
|
10
10
|
const isLoading = useState(false)
|
|
11
11
|
const [{ user }, setStore] = sharedStore.useTracked()
|
|
12
12
|
const [state, setState] = useState(() => {
|
|
@@ -64,7 +64,7 @@ export function SettingsBusiness({ config }) {
|
|
|
64
64
|
name="business.country"
|
|
65
65
|
type="country"
|
|
66
66
|
state={state}
|
|
67
|
-
options={useMemo(() => util.getCountryOptions(
|
|
67
|
+
options={useMemo(() => util.getCountryOptions(injectedConfig.countries), [])}
|
|
68
68
|
onChange={onChange.bind(setState)}
|
|
69
69
|
/>
|
|
70
70
|
</div>
|
|
@@ -74,7 +74,7 @@ export function SettingsBusiness({ config }) {
|
|
|
74
74
|
name="business.currency"
|
|
75
75
|
type="country"
|
|
76
76
|
state={state}
|
|
77
|
-
options={useMemo(() => util.getCurrencyOptions(
|
|
77
|
+
options={useMemo(() => util.getCurrencyOptions(injectedConfig.currencies), [])}
|
|
78
78
|
onChange={onChange.bind(setState)}
|
|
79
79
|
/>
|
|
80
80
|
</div>
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
// todo: finish tailwind conversion
|
|
3
|
-
import { Button, FormError, Field, Modal, Select } from 'nitro-web'
|
|
3
|
+
import { Button, FormError, Field, Modal, Select, injectedConfig } from 'nitro-web'
|
|
4
4
|
import SvgTick from 'nitro-web/client/imgs/icons/tick.svg'
|
|
5
|
-
import { Config } from 'nitro-web/types'
|
|
6
5
|
|
|
7
6
|
type SettingsTeamMemberProps = {
|
|
8
7
|
showModal: boolean
|
|
9
8
|
setShowModal: (showModal: boolean) => void
|
|
10
|
-
config?: Config
|
|
11
9
|
}
|
|
12
10
|
|
|
13
|
-
export function SettingsTeamMember ({ showModal, setShowModal
|
|
11
|
+
export function SettingsTeamMember ({ showModal, setShowModal }: SettingsTeamMemberProps) {
|
|
14
12
|
// @param {object} showModal - user
|
|
15
13
|
const [{ user }] = sharedStore.useTracked()
|
|
16
14
|
const [isLoading] = useState(false)
|
|
@@ -34,7 +32,7 @@ export function SettingsTeamMember ({ showModal, setShowModal, config }: Setting
|
|
|
34
32
|
<Modal show={showModal} setShow={setShowModal} class="p-modal">
|
|
35
33
|
|
|
36
34
|
<h2 class="h2"><em>Add</em> Team Member</h2>
|
|
37
|
-
<p class="subtitle">Invite a new team member to collaborate with you on {
|
|
35
|
+
<p class="subtitle">Invite a new team member to collaborate with you on {injectedConfig?.name || 'Nitro'}.</p>
|
|
38
36
|
|
|
39
37
|
<form class="form" onSubmit={onSubmit}>
|
|
40
38
|
<div class="cols cols-6 cols-gap-2-5">
|
|
@@ -89,7 +87,7 @@ export function SettingsTeamMember ({ showModal, setShowModal, config }: Setting
|
|
|
89
87
|
<Field
|
|
90
88
|
name="message"
|
|
91
89
|
type="textarea"
|
|
92
|
-
placeholder={`${user.firstName} is inviting you to collaborate on ${
|
|
90
|
+
placeholder={`${user.firstName} is inviting you to collaborate on ${injectedConfig?.name || 'Nitro'}.`}
|
|
93
91
|
state={state} onChange={onChange.bind(setState)}
|
|
94
92
|
/>
|
|
95
93
|
</div>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// todo: finish tailwind conversion
|
|
3
3
|
import * as util from 'nitro-web/util'
|
|
4
4
|
import SvgPlus from 'nitro-web/client/imgs/icons/plus.svg'
|
|
5
|
-
import { Button, Table, Avatar, Tabbar, Topbar, SettingsTeamMember } from 'nitro-web'
|
|
5
|
+
import { Button, Table, Avatar, Tabbar, Topbar, SettingsTeamMember, injectedConfig } from 'nitro-web'
|
|
6
6
|
|
|
7
|
-
export function SettingsTeam(
|
|
7
|
+
export function SettingsTeam() {
|
|
8
8
|
const isLoading = useState(false)
|
|
9
9
|
const [showModal, setShowModal] = useState()
|
|
10
10
|
const [{ user }] = sharedStore.useTracked()
|
|
@@ -48,7 +48,7 @@ export function SettingsTeam({ config }) {
|
|
|
48
48
|
key: user._id,
|
|
49
49
|
name: (
|
|
50
50
|
<>
|
|
51
|
-
<Avatar awsUrl={
|
|
51
|
+
<Avatar awsUrl={injectedConfig.awsUrl} user={user} isRound={true} class="mt--1 mb--1" />
|
|
52
52
|
<b>{util.ucFirst(user.name)}</b>
|
|
53
53
|
{user.status != 'invited' && <span class="text-grey">(Invitation pending)</span>}
|
|
54
54
|
</>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
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 🚀",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|