@star-insure/sdk 5.0.0 → 5.0.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@star-insure/sdk",
3
3
  "description": "The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.",
4
4
  "author": "alexclark_nz",
5
- "version": "5.0.0",
5
+ "version": "5.0.2",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -31,7 +31,7 @@ export default function Button({
31
31
  : 'font-black inline-flex items-center gap-3 justify-center text-white text-center px-5 py-2 rounded-md min-w-[120px] transition-all hover:brightness-110';
32
32
 
33
33
  const statusClass =
34
- (status === 'primary' && 'bg-primary') ||
34
+ (status === 'primary' && 'bg-accent') ||
35
35
  (status === 'danger' && 'bg-red-500') ||
36
36
  (status === 'warning' && 'bg-yellow-400') ||
37
37
  (status === 'info' && 'bg-blue-400') ||
@@ -38,7 +38,7 @@ export default function Modal({ children, isActive = false, onClose, title, widt
38
38
  leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
39
39
  >
40
40
  <div className={`${className} w-full align-start inline-block bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-7xl sm:p-6 ${width}`}>
41
- <div className={`flex gap-4 mb-4 text-secondary ${title ? 'border-b-2 border-secondary pb-4' : ''}`}>
41
+ <div className={`flex gap-4 mb-4 text-primary ${title ? 'border-b-2 border-primary pb-4' : ''}`}>
42
42
  {title && <h3 className="font-black text-lg">{title}</h3>}
43
43
  <button type="button" onClick={onClose} className="ml-auto transition-all hover:opacity-50">
44
44
  <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
@@ -8,10 +8,10 @@ export default function ToastItem({ _id = '', message, status = 'default' }: Toa
8
8
 
9
9
  const defaultClasses = 'w-full min-w-[250px] p-4 shadow flex justify-between items-center font-black rounded-md not:';
10
10
 
11
- const statusClasses = status === 'success' && 'bg-primary text-white'
11
+ const statusClasses = status === 'success' && 'bg-accent text-white'
12
12
  || status === 'error' && 'bg-red-500 text-white'
13
13
  || status === 'warning' && 'bg-yellow-400 text-white'
14
- || 'bg-white text-secondary';
14
+ || 'bg-white text-primary';
15
15
 
16
16
  const classes = `${defaultClasses} ${statusClasses}`;
17
17
 
@@ -30,7 +30,7 @@ export function BackButton({ back, className }: { back?: string | boolean; class
30
30
  }, [breadcrumbs]);
31
31
 
32
32
  return (
33
- <Link href={backUrl || '/'} className={cn(className, 'flex items-center justify-center text-back-button-text hover:text-primary transition-all')}>
33
+ <Link href={backUrl || '/'} className={cn(className, 'flex items-center justify-center text-primary hover:text-accent transition-all')}>
34
34
  <HiArrowLeft className="h-5 w-5 stroke-[1.25]" />
35
35
  </Link>
36
36
  );
@@ -198,9 +198,9 @@ export function FilterItem({ filter }: { filter: FilterOption, path?: string })
198
198
  <div
199
199
  onClick={() => handleClick()}
200
200
  className={cn(
201
- 'flex rounded-2xl border hover:cursor-pointer hover:border-primary bg-gray-600 px-2 py-1 items-center justify-between shrink-0 gap-2 text-xs text-white hover:bg-primary transition-colors',
201
+ 'flex rounded-2xl border hover:cursor-pointer hover:border-accent bg-gray-600 px-2 py-1 items-center justify-between shrink-0 gap-2 text-xs text-white hover:bg-accent transition-colors',
202
202
  {
203
- '!bg-primary border-primary': hasFilters,
203
+ '!bg-accent border-accent': hasFilters,
204
204
  }
205
205
  )}>
206
206
  <p className="whitespace-nowrap">{filter.label}</p>
@@ -155,21 +155,21 @@ export default function PageHeader({
155
155
  return (
156
156
  <section className={cn('col-span-full flex items-center gap-2 max-w-full rounded-lg bg-white p-2 shadow', className)}>
157
157
  {back && (
158
- <BackButton back={back} className="bg-back-button-background h-[60px] w-[60px] rounded" />
158
+ <BackButton back={back} className="bg-primary-100 h-[60px] w-[60px] rounded" />
159
159
  )}
160
160
 
161
- <div className={cn('w-full grid grid-cols-[auto_1fr_auto_auto] h-[60px] rounded bg-page-header-background p-3 gap-4', innerClassName)}>
161
+ <div className={cn('w-full grid grid-cols-[auto_1fr_auto_auto] h-[60px] rounded bg-primary-100 p-3 gap-4', innerClassName)}>
162
162
  <button
163
163
  type="button"
164
164
  disabled={!search}
165
165
  onClick={() => setSearchActive(true)}
166
- className={cn('mr-auto flex items-center gap-4 transition-colors pr-6 pl-1 disabled:opacity-100 text-page-header-text', {
167
- 'hover:text-primary': search && !isSearchActive,
166
+ className={cn('mr-auto flex items-center gap-4 transition-colors pr-6 pl-1 disabled:opacity-100 text-primary', {
167
+ 'hover:text-accent': search && !isSearchActive,
168
168
  }
169
169
  )}>
170
170
  {search && <SearchBar search={search} active={isSearchActive} onActive={setSearchActive} placeholder={`Search ${title}...`} focusSearchShortcut={focusSearchShortcut} />}
171
171
 
172
- {!isSearchActive && <h1 className="text-base text-page-header-text font-black">{title}</h1>}
172
+ {!isSearchActive && <h1 className="text-base text-primary font-black">{title}</h1>}
173
173
  </button>
174
174
 
175
175
  <div className="flex items-center ml-auto gap-2 h-full min-w-0 max-w-full">
@@ -189,7 +189,7 @@ export default function PageHeader({
189
189
  </div>
190
190
 
191
191
  {filteredActions.length > 0 && (
192
- <div className="flex items-center gap-3 bg-page-header-background">
192
+ <div className="flex items-center gap-3 bg-primary-100">
193
193
  {filterOptions.length > 0 && <div className="w-[1px] h-full bg-gray-300" />}
194
194
  <nav className="flex items-center gap-2">
195
195
  {filteredActions.map((action) => (
@@ -86,7 +86,7 @@ export default function SearchBar({ search, active, onActive, placeholder, focus
86
86
  title="Open Search Bar"
87
87
  type="button"
88
88
  onClick={() => onActive(true)}
89
- className="flex items-center justify-center rounded-full hover:text-primary p-1 hover:bg-gray-100"
89
+ className="flex items-center justify-center rounded-full hover:text-accent p-1 hover:bg-gray-100"
90
90
  >
91
91
  <HiMagnifyingGlass className="h-5 w-5 stroke-[1.25]" />
92
92
  </button>
@@ -94,7 +94,7 @@ export default function SearchBar({ search, active, onActive, placeholder, focus
94
94
  {active && (
95
95
  <form
96
96
  onSubmit={handleSearch}
97
- className="group flex items-center gap-2 rounded-full bg-white pr-4 pl-1 shadow transition-all focus-within:outline-none focus-within:ring-1 focus-within:ring-primary"
97
+ className="group flex items-center gap-2 rounded-full bg-white pr-4 pl-1 shadow transition-all focus-within:outline-none focus-within:ring-1 focus-within:ring-accent"
98
98
  >
99
99
  <input
100
100
  type="text"
@@ -28,7 +28,7 @@ export default function MoneyField({ value = 0, onChange, name = 'value', id = '
28
28
  const displayValue = formatMoney(value, 0);
29
29
 
30
30
  return (
31
- <div className={`${className} flex items-center gap-2 pl-4 rounded-md border border-gray-300 transition-all focus-within:border-primary focus-within:outline-none focus-within:ring focus-within:ring-primary focus-within:ring-opacity-50`}>
31
+ <div className={`${className} flex items-center gap-2 pl-4 rounded-md border border-gray-300 transition-all focus-within:border-accent focus-within:outline-none focus-within:ring focus-within:ring-accent focus-within:ring-opacity-50`}>
32
32
  <span className="font-bold pr-2">$</span>
33
33
  <input
34
34
  type="text"
@@ -228,7 +228,7 @@ export default function RegistrationSearchField({
228
228
  type="button"
229
229
  onClick={handleSearch}
230
230
  disabled={status === 'processing'}
231
- className={cn(searchBtnClassName, "bg-primary px-4 py-3 rounded-md transition-all")}
231
+ className={cn(searchBtnClassName, "bg-accent px-4 py-3 rounded-md transition-all")}
232
232
  >
233
233
  <span className="sr-only">Search</span>
234
234
  <svg
@@ -8,7 +8,7 @@ export default function Table({ children, ...props }: Props) {
8
8
  return (
9
9
  <div className="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8 text-sm">
10
10
  <div className="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
11
- <div className="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
11
+ <div className="overflow-hidden shadow ring-1 ring-gray-300 ring-opacity-5 md:rounded-lg">
12
12
  <table {...props} className="min-w-full divide-y divide-gray-300">
13
13
  {children}
14
14
  </table>
@@ -8,7 +8,7 @@ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSe
8
8
 
9
9
  export default function TableHead({ children, className, ...props }: Props) {
10
10
  return (
11
- <thead {...props} className={cn(className, 'px-3 py-4 text-sm text-white bg-table-header-background')}>
11
+ <thead {...props} className={cn(className, 'px-3 py-4 text-sm text-white bg-gray-600')}>
12
12
  {children}
13
13
  </thead>
14
14
  )
@@ -8,7 +8,7 @@ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRo
8
8
  }
9
9
 
10
10
  export default function TableRow({ children, className = '', onClick = () => {}, ...props }: Props) {
11
- const bgClass = className.includes('bg') ? '' : 'bg-white even:bg-table-row-alternative-background'
11
+ const bgClass = className.includes('bg') ? '' : 'bg-white even:bg-gray-50'
12
12
 
13
13
  return (
14
14
  <tr {...props} className={cn(className, bgClass, 'hover:bg-gray-100')} onClick={(e) => onClick(e)}>
@@ -15,29 +15,71 @@ module.exports = {
15
15
  },
16
16
  extend: {
17
17
  colors: {
18
- primary: 'var(--primary-color)',
19
- 'primary-300': 'var(--primary-300-color)',
20
- 'primary-100': 'var(--primary-100-color)',
21
- 'primary-700': 'var(--primary-700-color)',
22
- secondary: 'var(--secondary-color)',
23
- 'page-background': 'var(--page-background-color)',
24
- 'footer-background': 'var(--footer-background-color)',
25
- 'page-header-background': 'var(--page-header-background-color)',
26
- 'page-header-text': 'var(--page-header-text-color)',
27
- 'back-button-background': 'var(--back-button-background-color)',
28
- 'back-button-text': 'var(--back-button-text-color)',
29
- 'section-title': 'var(--section-title-color)',
30
- 'sub-section-title': 'var(--sub-section-title-color)',
31
- 'section-separator': 'var(--section-separator-color)',
32
- 'section-header-background': 'var(--section-header-background-color)',
33
- 'section-header-text': 'var(--section-header-text-color)',
34
- 'card-subtitle': 'var(--card-subtitle-color)',
35
- 'card-alternative-background': 'var(--card-alternative-background-color)',
36
- 'table-header-background': 'var(--table-header-background-color)',
37
- 'table-header-text': 'var(--table-header-text-color)',
38
- 'table-row-alternative-background': 'var(--table-row-alternative-background-color)',
39
- 'gray-600': '#8a8c8e',
40
- 'gray-700': '#666',
18
+ primary: {
19
+ DEFAULT: 'rgb(var(--primary-color))',
20
+ 100: 'rgb(var(--primary-100-color))',
21
+ },
22
+
23
+ secondary: {
24
+ DEFAULT: 'rgb(var(--secondary-color))',
25
+ },
26
+
27
+ tertiary: {
28
+ DEFAULT: 'rgb(var(--tertiary-color))',
29
+ },
30
+
31
+ accent: {
32
+ DEFAULT: 'rgb(var(--accent-color))',
33
+ 100: 'rgb(var(--accent-100-color))',
34
+ 300: 'rgb(var(--accent-300-color))',
35
+ 500: 'rgb(var(--accent-500-color))',
36
+ 700: 'rgb(var(--accent-700-color))',
37
+ },
38
+
39
+ light: 'rgb(var(--light-color))',
40
+ dark: 'rgb(var(--dark-color))',
41
+ black: 'rgb(var(--black-color))',
42
+ white: 'rgb(var(--white-color))',
43
+
44
+ gray: {
45
+ DEFAULT: 'rgb(var(--gray-color))',
46
+ 50: 'rgb(var(--gray-50-color))',
47
+ 100: 'rgb(var(--gray-100-color))',
48
+ 200: 'rgb(var(--gray-200-color))',
49
+ 300: 'rgb(var(--gray-300-color))',
50
+ 400: 'rgb(var(--gray-400-color))',
51
+ 500: 'rgb(var(--gray-500-color))',
52
+ 600: 'rgb(var(--gray-600-color))',
53
+ 700: 'rgb(var(--gray-700-color))',
54
+ 800: 'rgb(var(--gray-800-color))',
55
+ 900: 'rgb(var(--gray-900-color))',
56
+ },
57
+
58
+ red: {
59
+ DEFAULT: 'rgb(var(--red-color))',
60
+ 50: 'rgb(var(--red-50-color))',
61
+ 100: 'rgb(var(--red-100-color))',
62
+ 200: 'rgb(var(--red-200-color))',
63
+ 300: 'rgb(var(--red-300-color))',
64
+ 400: 'rgb(var(--red-400-color))',
65
+ 500: 'rgb(var(--red-500-color))',
66
+ 600: 'rgb(var(--red-600-color))',
67
+ },
68
+
69
+ yellow: {
70
+ DEFAULT: 'rgb(var(--yellow-color))',
71
+ 50: 'rgb(var(--yellow-50-color))',
72
+ 100: 'rgb(var(--yellow-100-color))',
73
+ 200: 'rgb(var(--yellow-200-color))',
74
+ 300: 'rgb(var(--yellow-300-color))',
75
+ 400: 'rgb(var(--yellow-400-color))',
76
+ 500: 'rgb(var(--yellow-500-color))',
77
+ 600: 'rgb(var(--yellow-600-color))',
78
+ },
79
+
80
+ danger: 'rgb(var(--danger-color))',
81
+ warning: 'rgb(var(--warning-color))',
82
+ info: 'rgb(var(--info-color))',
41
83
  },
42
84
  transitionDuration: {
43
85
  DEFAULT: '300ms',
package/src/theme.css CHANGED
@@ -1,30 +1,53 @@
1
1
  :root {
2
- --primary-color: #6fc7b6;
3
- --primary-300-color: #b8e1d9;
4
- --primary-100-color: #f2f9f8;
5
- --primary-700-color: #48aa97;
2
+ --primary-color: 43 56 68;
3
+ --primary-100-color: 243 244 246;
6
4
 
7
- --secondary-color: #2b3844;
5
+ --secondary-color: 102 102 102;
8
6
 
9
- --page-background-color: #f9fafb;
10
- --footer-background-color: #e5e7eb;
7
+ --tertiary-color: 239 235 229;
11
8
 
12
- --page-header-background-color: #f3f4f6;
13
- --page-header-text-color: rgb(102, 102, 102);
14
- --back-button-background-color: #f3f4f6;
15
- --back-button-text-color: rgb(102, 102, 102);
9
+ --accent-color: 132 197 182;
10
+ --accent-100-color: 242 249 248;
11
+ --accent-300-color: 184 225 217;
12
+ --accent-500-color: 132 197 182;
13
+ --accent-700-color: 72 170 151;
16
14
 
17
- --section-title-color: #6b7280;
18
- --sub-section-title-color: rgb(102, 102, 102);
19
- --section-separator-color: rgb(107, 114, 128);
15
+ --light-color: 249 250 251;
16
+ --dark-color: 102 102 102;
17
+ --black-color: 0 0 0;
18
+ --white-color: 255 255 255;
20
19
 
21
- --section-header-background-color: #f3f4f6;
22
- --section-header-text-color: rgb(102, 102, 102);
20
+ --gray-color: 102 102 102;
21
+ --gray-50-color: 249 250 251;
22
+ --gray-100-color: 243 244 246;
23
+ --gray-200-color: 229 231 235;
24
+ --gray-300-color: 209 213 219;
25
+ --gray-400-color: 156 163 175;
26
+ --gray-500-color: 107 114 128;
27
+ --gray-600-color: 138 140 142;
28
+ --gray-700-color: 102 102 102;
29
+ --gray-800-color: 31 41 55;
30
+ --gray-900-color: 17 24 39;
23
31
 
24
- --card-subtitle-color: #2B3844;
25
- --card-alternative-background-color: rgba(102, 102, 102, 0.07);
32
+ --red-color: 239 68 68;
33
+ --red-50-color: 254 242 242;
34
+ --red-100-color: 254 226 226;
35
+ --red-200-color: 254 202 202;
36
+ --red-300-color: 252 165 165;
37
+ --red-400-color: 248 113 113;
38
+ --red-500-color: 239 68 68;
39
+ --red-600-color: 220 38 38;
26
40
 
27
- --table-header-background-color: #8a8c8e;
28
- --table-header-text-color: #FFFFFF;
29
- --table-row-alternative-background-color: #f9fafb;
41
+ --yellow-color: 250 204 21;
42
+ --yellow-50-color: 254 252 232;
43
+ --yellow-100-color: 245 249 195;
44
+ --yellow-200-color: 254 240 138;
45
+ --yellow-300-color: 253 224 71;
46
+ --yellow-400-color: 250 204 21;
47
+ --yellow-500-color: 234 179 8;
48
+ --yellow-600-color: 202 138 4;
49
+
50
+ --danger-color: 239 68 68;
51
+ --warning-color: 250 204 21;
52
+ --info-color: 96 165 250;
30
53
  }