nitro-web 0.0.30 → 0.0.31

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.
@@ -1,10 +1,11 @@
1
1
  import { css, theme } from 'twin.macro'
2
+ import { injectedConfig } from 'nitro-web'
2
3
 
3
- export function Dashboard({ config }: { config: { isStatic?: boolean } }) {
4
+ export function Dashboard() {
4
5
  const [store] = useTracked()
5
- const textColor = store.apiAvailable ? 'text-green-700' : config.isStatic ? 'text-gray-700' : 'text-pink-700'
6
- const fillColor = store.apiAvailable ? 'fill-green-500' : config.isStatic ? 'fill-gray-500' : 'fill-pink-500'
7
- const bgColor = store.apiAvailable ? 'bg-green-100' : config.isStatic ? 'bg-[#eeeeee]' : 'bg-pink-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${config.isStatic ? ' (Static Example)' : ''}` }
21
+ { store.apiAvailable ? 'API Available' : `API Unavailable${injectedConfig.isStatic ? ' (Static Example)' : ''}` }
21
22
  </span>
22
23
  </p>
23
24
  </div>
@@ -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({ config }: { config: Config }) {
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(config.countries), [])}
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(config.currencies), [])}
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} config={config} />
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={config.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({ config }) {
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(config.countries), [])}
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(config.currencies), [])}
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, config }: SettingsTeamMemberProps) {
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 {config?.name || 'Nitro'}.</p>
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 ${config?.name || 'Nitro'}.`}
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({ config }) {
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={config.awsUrl} user={user} isRound={true} class="mt--1 mb--1" />
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.30",
3
+ "version": "0.0.31",
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 🚀",