@rileybathurst/paddle 1.3.9 → 1.4.0

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rileybathurst/paddle",
3
3
  "private": false,
4
- "version": "1.3.9",
4
+ "version": "1.4.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -25,13 +25,13 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@biomejs/biome": "2.0.2",
28
- "@chromatic-com/storybook": "^4.0.0",
28
+ "@chromatic-com/storybook": "^4.0.1",
29
29
  "@faker-js/faker": "^9.8.0",
30
- "@storybook/addon-a11y": "^9.0.13",
31
- "@storybook/addon-docs": "^9.0.11",
32
- "@storybook/addon-links": "^9.0.11",
33
- "@storybook/addon-themes": "^9.0.11",
34
- "@storybook/react-vite": "^9.0.11",
30
+ "@storybook/addon-a11y": "^9.1.0",
31
+ "@storybook/addon-docs": "^9.1.0",
32
+ "@storybook/addon-links": "^9.1.0",
33
+ "@storybook/addon-themes": "^9.1.0",
34
+ "@storybook/react-vite": "^9.1.0",
35
35
  "@types/react": "^19.1.6",
36
36
  "@types/react-dom": "^19.1.6",
37
37
  "@typescript-eslint/eslint-plugin": "^8.33.1",
@@ -40,8 +40,8 @@
40
40
  "eslint": "^9.28.0",
41
41
  "eslint-plugin-react-hooks": "^5.2.0",
42
42
  "eslint-plugin-react-refresh": "^0.4.20",
43
- "eslint-plugin-storybook": "^9.0.11",
44
- "storybook": "^9.0.11",
43
+ "eslint-plugin-storybook": "^9.1.0",
44
+ "storybook": "^9.1.0",
45
45
  "typescript": "^5.8.3",
46
46
  "vite": "^6.3.5"
47
47
  },
@@ -0,0 +1,267 @@
1
+ // ! this is not ready
2
+
3
+ import React, { useState } from 'react';
4
+
5
+ import Time from "../../components/time";
6
+ import BookNow from '../../components/peek/book-now';
7
+ import { PaddleTime } from './paddle-time';
8
+ import { PaddleBookNow } from './paddle-book-now';
9
+
10
+ const Option = (props) => {
11
+ if (props.name === props.current) {
12
+ return (
13
+ <option selected key={props.key}>{props.name}</option>
14
+ )
15
+ }
16
+
17
+ if (props.name === props.other) {
18
+ return (
19
+ <option disabled key={props.key}>{props.name}</option>
20
+ )
21
+ }
22
+
23
+ return (
24
+ <option key={props.key}>{props.name}</option>
25
+ )
26
+ }
27
+
28
+ const first = (e) => {
29
+ setTour1(e.target.value);
30
+ return null;
31
+ }
32
+
33
+ const second = (e) => {
34
+ setTour2(e.target.value);
35
+ return null;
36
+ }
37
+
38
+ const Details1 = (props) => {
39
+ props.set.forEach(element => {
40
+ if (element.name === props.show) {
41
+ setLink1(element.slug);
42
+ setSport1(element.sport);
43
+ setDuration1(element.duration);
44
+ setStart1(element.start);
45
+ setFinish1(element.finish);
46
+ setFitness1(element.fitness);
47
+ setLocation1(element.location);
48
+ setExcerpt1(element.excerpt);
49
+ setMinimum1(element.minimum);
50
+ setPrice1(element.price);
51
+ setPeeks1(element.peek);
52
+ }
53
+ });
54
+ return null;
55
+ }
56
+
57
+ const Details2 = (props) => {
58
+ props.set.forEach(element => {
59
+ if (element.name === props.show) {
60
+ setLink2(element.slug);
61
+ setSport2(element.sport);
62
+ setDuration2(element.duration);
63
+ setStart2(element.start);
64
+ setFinish2(element.finish);
65
+ setFitness2(element.fitness);
66
+ setLocation2(element.location);
67
+ setExcerpt2(element.excerpt);
68
+ setMinimum2(element.minimum);
69
+ setPrice2(element.price);
70
+ setPeeks2(element.peek);
71
+ }
72
+ });
73
+ return null;
74
+ }
75
+
76
+ const CompareDetails = ({ key, title, link, sport, duration, start, finish, fitness, location, excerpt, minimum, price, peeks }) => {
77
+ return (
78
+ <section>
79
+ {/* <select
80
+ name="tour1"
81
+ id={key}
82
+ className="comparesheet_select"
83
+ aria-label="Select first tour or lesson"
84
+ >
85
+ {Array.from({ length: faker.number.int({ min: 1, max: 10 }) }).map(() => (
86
+ <option
87
+ key={faker.string.uuid()}
88
+ value={faker.food.dish()}
89
+ >
90
+ {faker.food.dish()}
91
+ </option>
92
+ ))}
93
+ </select> */}
94
+ <h2 className="kilimanjaro">
95
+ <a href={link}>{title}</a>
96
+ </h2>
97
+
98
+ <h4 className="capitalize">{sport}</h4>
99
+
100
+ <p>
101
+ <PaddleTime
102
+ start={start}
103
+ finish={finish}
104
+ duration={duration}
105
+ timeframe={timeframe}
106
+ />
107
+ </p>
108
+
109
+ <p className="capitalize">
110
+ {fitness} <span className="show-below__vulture">&nbsp;fitness</span>
111
+ </p>
112
+
113
+ <p>
114
+ <span className="show-below__vulture">Starts at&nbsp;</span>
115
+ {location}
116
+ </p>
117
+ <p>{excerpt}</p>
118
+ <p>
119
+ {minimum} <span className="show-below__vulture">&nbsp;people minimum</span>
120
+ </p>
121
+ <p>
122
+ ${price}
123
+ </p>
124
+
125
+ <PaddleBookNow
126
+ peek_base={peeks1}
127
+ strapiLocaleName={strapiLocaleName}
128
+ specificLink={peeks1}
129
+ />
130
+ </section >
131
+ )
132
+ }
133
+
134
+ type PaddleCompareTypes = {
135
+ tours: {
136
+ id: number;
137
+ name: string;
138
+ slug: string;
139
+ sport: string;
140
+ duration?: string;
141
+ timeframe?: string;
142
+ start?: string;
143
+ finish?: string;
144
+ fitness?: string;
145
+ location: string;
146
+ excerpt: string;
147
+ minimum: number;
148
+ price: number;
149
+ peek?: string;
150
+ }[];
151
+ strapiLocaleName: string;
152
+ peek_base: string;
153
+ };
154
+ export const PaddleCompare = ({ tours, strapiLocaleName, peek_base }: PaddleCompareTypes) => {
155
+
156
+ const [id1, setID1] = useState(tours[0].id);
157
+ const [id2, setID2] = useState(tours[1].id);
158
+
159
+ const [tour1, setTour1] = useState(tours[0].name);
160
+ const [tour2, setTour2] = useState(tours[1].name);
161
+
162
+ const [link1, setLink1] = useState(tours[0].slug);
163
+ const [link2, setLink2] = useState(tours[1].slug);
164
+
165
+ const [sport1, setSport1] = useState(tours[0].sport);
166
+ const [sport2, setSport2] = useState(tours[1].sport);
167
+
168
+ const [duration1, setDuration1] = useState(tours[0].duration || 'not set');
169
+ const [duration2, setDuration2] = useState(tours[1].duration || 'not set');
170
+
171
+ const [start1, setStart1] = useState(tours[0].start || 'not set');
172
+ const [start2, setStart2] = useState(tours[1].start || 'not set');
173
+
174
+ const [finish1, setFinish1] = useState(tours[0].finish || 'not set');
175
+ const [finish2, setFinish2] = useState(tours[1].finish || 'not set');
176
+
177
+ const [excerpt1, setExcerpt1] = useState(tours[0].excerpt || 'not set');
178
+ const [excerpt2, setExcerpt2] = useState(tours[1].excerpt || 'not set');
179
+
180
+ const [minimum1, setMinimum1] = useState(tours[0].minimum || 0);
181
+ const [minimum2, setMinimum2] = useState(tours[1].minimum || 0);
182
+
183
+ const [price1, setPrice1] = useState(tours[0].price || 0);
184
+ const [price2, setPrice2] = useState(tours[1].price || 0);
185
+
186
+ const [peeks1, setPeeks1] = useState(tours[0].peek || 'not set');
187
+ const [peeks2, setPeeks2] = useState(tours[1].peek || 'not set');
188
+
189
+ const [fitness1, setFitness1] = useState(tours[0].fitness || 'fitness');
190
+ const [fitness2, setFitness2] = useState(tours[1].fitness || 'fitness');
191
+
192
+ return (
193
+ <>
194
+ <div className='comparesheet'>
195
+ <div className='comparesheet_titles'>
196
+ <div className="comparesheet__transparent">Compare</div>
197
+ <h3 className='kilimanjaro comparesheet_freeze'>
198
+ Tour or<br />
199
+ Lesson
200
+ </h3>
201
+ <p>Sport</p>
202
+ <p>Time</p>
203
+ <p>Fitness</p>
204
+ <p>Location</p>
205
+ <p>About</p>
206
+ <p>Minimum People</p>
207
+ <p>Price</p>
208
+ <p className='button-drop'>Book Now</p>
209
+ </div>
210
+
211
+ <select
212
+ name="tour1"
213
+ // id={id1}
214
+ className="comparesheet_select"
215
+ aria-label="Select first tour or lesson"
216
+ >
217
+ {tours.map((tour) => (
218
+ <option
219
+ key={tour.id}
220
+ value={tour.id}
221
+ >
222
+ {tour.name}
223
+ </option>
224
+ ))}
225
+ </select>
226
+
227
+ <CompareDetails
228
+ key={id1}
229
+ title={tour1}
230
+ link={link1}
231
+ sport={sport1}
232
+ duration={duration1}
233
+ timeframe={timeframe1}
234
+ start={start1}
235
+ finish={finish1}
236
+ location={strapiLocaleName}
237
+ excerpt={excerpt1}
238
+ minimum={minimum1}
239
+ price={price1}
240
+ peeks={peeks1}
241
+ fitness={fitness1}
242
+ strapiLocaleName={strapiLocaleName}
243
+ peek_base={peek_base}
244
+ />
245
+ <CompareDetails
246
+ key={id2}
247
+ title={tour2}
248
+ link={link2}
249
+ sport={sport2}
250
+ duration={duration2}
251
+ timeframe={timeframe2}
252
+ start={start2}
253
+ finish={finish2}
254
+ location={strapiLocaleName}
255
+ excerpt={excerpt2}
256
+ minimum={minimum2}
257
+ price={price2}
258
+ peeks={peeks2}
259
+ fitness={fitness2}
260
+ strapiLocaleName={strapiLocaleName}
261
+ peek_base={peek_base}
262
+ />
263
+
264
+ </div>
265
+ </>
266
+ )
267
+ }
@@ -1,61 +1,53 @@
1
1
  import * as React from "react"
2
- import SVG from 'react-inlinesvg';
3
- import { PaddleBookNow } from "./paddle-book-now"
4
2
  import { Link } from "gatsby"
5
3
  import type { paddlePricingChartTypes } from "./types/paddle-pricing-chart-types";
6
4
 
7
5
  const LineBreaker = ({ text }: { text: string; }) => {
8
- const regex = /[- ]/g;
9
- const newStr = text.replace(regex, "<br />$&");
10
- // console.log(newStr);
6
+ // Split the text by hyphens and spaces, keeping the delimiters
7
+ const parts = text.split(/([- ])/g);
11
8
 
12
9
  return (
13
- <h4 dangerouslySetInnerHTML={{ __html: newStr }} />
10
+ <h4>
11
+ {parts.map((part) =>
12
+ part === '-' || part === ' ' ? <br key={part} /> : part
13
+ )}
14
+ </h4>
14
15
  );
15
16
  }
16
17
 
17
- export const PaddlePricingChart = ({ rentalRates, rentalAddons, book, peek_base, strapiLocaleName }: paddlePricingChartTypes) => {
18
+ export const PaddlePricingChart = ({ rentalRates, rentalAddons }: paddlePricingChartTypes) => {
18
19
  return (
19
- <>
20
- <div className="charts">
21
- <div className="pricing-chart">
22
- <div className="row row-header">
23
- <h2 className="kilimanjaro"><Link to="/rentals">Rental<br />Rates</Link></h2>
24
- <p>1 Hour</p>
25
- <p><span>3 Hours</span></p>
26
- <p><span>Full Day</span></p>
27
- </div>
20
+ <div className="pricing-chart">
21
+ <div className="column">
22
+ <h4 className="title">
23
+ <Link to="/rentals">Rental<br />Rates</Link>
24
+ </h4>
25
+ <p>1 Hour</p>
26
+ <p>3 Hours</p>
27
+ <p>Full Day</p>
28
+ </div>
28
29
 
29
- {rentalRates.nodes.map((rate) => (
30
- <div key={rate.id} className="row">
31
- <LineBreaker text={rate.item} />
32
- <p>{rate.oneHour}</p>
33
- <p>{rate.threeHour}</p>
34
- <p>{rate.fullDay}</p>
35
- </div>
36
- ))}
30
+ {rentalRates.nodes.map((rate) => (
31
+ <div key={rate.id} className="column">
32
+ <LineBreaker text={rate.item} />
33
+ <p>{rate.oneHour}</p>
34
+ <p>{rate.threeHour}</p>
35
+ <p>{rate.fullDay}</p>
37
36
  </div>
37
+ ))}
38
38
 
39
- {rentalAddons.nodes.length > 0 ? (
40
- <div className="pricing-chart">
41
- {rentalAddons.nodes.map((addon) => (
42
- <React.Fragment key={addon.id}>
43
- <p>{addon.name}</p>
44
- <p>+{addon.single}</p>
45
- <p>+{addon.double}</p>
46
- <p>+{addon.sup}</p>
47
- </React.Fragment>
48
- ))}
49
- </div>
50
- ) : null}
51
- </div>
52
-
53
- {book ? (
54
- <PaddleBookNow
55
- peek_base={peek_base}
56
- strapiLocaleName={strapiLocaleName}
57
- />
39
+ {rentalAddons && rentalAddons.nodes.length > 0 ? (
40
+ <div className="column">
41
+ {rentalAddons.nodes.map((addon) => (
42
+ <React.Fragment key={addon.id}>
43
+ <p>{addon.name}</p>
44
+ <p>+{addon.single}</p>
45
+ <p>+{addon.double}</p>
46
+ <p>+{addon.sup}</p>
47
+ </React.Fragment>
48
+ ))}
49
+ </div>
58
50
  ) : null}
59
- </>
51
+ </div>
60
52
  )
61
53
  }
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import Markdown from "react-markdown";
2
3
 
3
4
  // TODO this would be nice to be able to close but I dont have it right yet
4
5
 
@@ -49,7 +50,9 @@ export const PaddleTopBar = ({ strapiLocale }: PaddleTopBarTypes) => {
49
50
  <span className="rain-check-reason">We're closed today due to {strapiLocale.RainCheckReason}</span>
50
51
  </p>
51
52
  ) : (
52
- <p>{strapiLocale.topbar.data.topbar}</p>
53
+ <Markdown>
54
+ {strapiLocale.topbar.data.topbar}
55
+ </Markdown>
53
56
  )
54
57
  }
55
58
  </div>
@@ -375,8 +375,6 @@ header {
375
375
  }
376
376
  }
377
377
 
378
- .location:not(:last-child)
379
-
380
378
  /*------------------*/
381
379
  /* #COMPOSITION */
382
380
  /*------------------*/
@@ -522,3 +520,110 @@ header {
522
520
  margin-inline: auto;
523
521
  }
524
522
  }
523
+
524
+ /*------------------*/
525
+ /* #COMPARE TABLE */
526
+ /*------------------*/
527
+
528
+ /* * test this in chrome, it doesnt have subgrid yet */
529
+ .comparesheet {
530
+ display: grid;
531
+ gap: 1rem;
532
+ grid-template-columns: 1fr 1fr;
533
+
534
+ @media (min-width: 30rem) {
535
+ grid-template-columns: auto 1fr 1fr;
536
+ }
537
+
538
+ h1,
539
+ h2,
540
+ h3,
541
+ h4,
542
+ h5,
543
+ h6,
544
+ p {
545
+ margin-block-end: 0;
546
+ }
547
+
548
+ > * {
549
+ grid-row: 1/11;
550
+ display: grid;
551
+ grid-template-rows: subgrid;
552
+ gap: 1rem;
553
+ /* border-inline-end: 1px solid var(--tin-soldier); */
554
+ padding-inline-end: 1rem;
555
+
556
+ > * {
557
+ align-self: stretch;
558
+ padding: 0.25rem;
559
+
560
+ @media (min-width: 30rem) {
561
+ padding: 0.5rem;
562
+ }
563
+ }
564
+
565
+ > *:nth-child(odd) {
566
+ border-radius: 0.25rem;
567
+ background-color: var(--brilliance);
568
+
569
+ @media (prefers-color-scheme: dark) {
570
+ background-color: var(--navy-300);
571
+ color: whitesmoke;
572
+ }
573
+ }
574
+
575
+ > *:first-child {
576
+ /* background-color: transparent; you cant do this due to dark mode */
577
+ }
578
+ }
579
+
580
+ > *:last-child {
581
+ border-inline-end: none;
582
+ padding-inline-end: 0;
583
+ }
584
+
585
+ .comparesheet_titles {
586
+ display: none;
587
+
588
+ @media (min-width: 30rem) {
589
+ display: grid;
590
+ }
591
+ padding-inline-end: 1rem;
592
+ text-align: end;
593
+ }
594
+
595
+ .comparesheet__title1 {
596
+ position: sticky;
597
+ top: -1px;
598
+ z-index: var(--understory);
599
+ background-color: var(--brilliance);
600
+ box-shadow: 0 0 0 100vmax var(--brilliance);
601
+ clip-path: inset(0 -100vmax);
602
+
603
+ @media (prefers-color-scheme: dark) {
604
+ background-color: var(--navy-300);
605
+ box-shadow: 0 0 0 100vmax var(--navy-300);
606
+ }
607
+ }
608
+
609
+ .comparesheet_freeze {
610
+ position: sticky;
611
+ top: -1px;
612
+ z-index: var(--canopy);
613
+ }
614
+
615
+ .comparesheet__title2 {
616
+ z-index: var(--canopy);
617
+ position: sticky;
618
+ top: -1px;
619
+ }
620
+
621
+ .comparesheet__transparent {
622
+ background-color: transparent;
623
+ }
624
+ }
625
+
626
+ .comparesheet_select {
627
+ z-index: var(--emergent);
628
+ max-width: calc(50vw - 2.25rem); /* guess and check */
629
+ }
@@ -6,121 +6,46 @@
6
6
  display: flex;
7
7
  text-align: center;
8
8
 
9
- /* columns */
10
- > * {
9
+ .column {
11
10
  display: flex;
12
11
  flex: 1 1 10rem;
13
12
  flex-direction: column;
13
+ border-right: 0.5px solid var(--neutral-400);
14
+ }
14
15
 
15
- /* rows */
16
- > * {
17
- > * {
18
- margin: 0;
19
- }
20
- }
21
-
22
- /* first row */
23
- > *:first-child {
24
- margin: 0;
25
- border-top: none;
26
- }
16
+ .column:last-child {
17
+ border-right: none;
27
18
  }
28
19
 
29
- h2,
30
- h4,
20
+ /* cells */
21
+ .title,
31
22
  p {
32
- font-size: clamp(0.75rem, 1.25vw, 1.5rem);
33
- line-height: clamp(1rem, 1.5vw, 2rem);
34
- padding: clamp(0.5rem, 1vw, 1rem);
23
+ /* * be careful of this it can break the footer flex */
24
+ font-size: clamp(var(--kosciuszko), 1vw, var(--kilimanjaro));
25
+
26
+ line-height: var(--denali);
27
+ padding: clamp(0.5rem, 1vw, var(--vinson));
35
28
  border-bottom: 0.5px solid var(--neutral-400);
36
- border-right: 0.5px solid var(--neutral-400);
37
29
  }
38
30
 
39
- h4 {
40
- margin: 0.25px;
41
- }
42
-
43
- p {
44
- font-size: 0.75rem;
45
- margin: 0.25px;
31
+ /* ? can this only be if it has the full length of cells? */
32
+ .column > *:last-child {
33
+ border-bottom: none;
46
34
  }
47
35
 
36
+ /* titles build spans automatically from strapi */
48
37
  h4 span {
49
38
  display: flex;
50
39
  flex-direction: column;
51
40
  white-space: nowrap;
52
41
  }
53
42
 
54
- p span {
55
- white-space: nowrap;
56
- }
57
-
58
- *:last-child > * {
59
- border-right: none;
60
- }
61
- }
62
-
63
- .charts {
64
- .pricing-chart:not(:last-child) {
65
- margin-block-end: 0;
66
- }
67
-
68
- .pricing-chart:last-child {
69
- margin-block-end: 1.5rem;
70
-
71
- p {
72
- border-block-end: none;
73
- }
74
-
75
- p:last-child {
76
- border-inline-end: none;
77
- }
78
- }
79
- }
80
-
81
- /*------------------*/
82
- /* #RENTAL CHART */
83
- /*------------------*/
84
-
85
- .rental-chart {
86
- display: grid;
87
- text-align: center;
88
- margin-block-end: 1.5rem;
89
-
90
- .row {
91
- display: grid;
92
- gap: 0;
93
- margin: 0;
94
- grid-template-columns: repeat(auto-fit, minmax(4rem, 1fr));
95
-
96
- /* box */
97
- > * {
98
- padding: clamp(0.5rem, 1vw, 1rem);
99
- }
100
-
101
- > *:last-child {
102
- border-inline-end: none;
103
- }
104
- }
105
-
106
- .row:last-child {
107
- > * {
108
- border-block-end: none;
109
- }
110
- }
111
-
112
- .row-header {
113
- font-weight: bold;
114
- }
115
-
116
- h4 {
43
+ h4,
44
+ p {
117
45
  margin: 0.25px;
118
- font-size: clamp(0.75rem, 1.25vw, 1.5rem);
119
- line-height: clamp(1rem, 1.5vw, 2rem);
120
46
  }
121
47
 
122
48
  p {
123
- font-size: 0.75rem;
124
- margin: 0.25px;
49
+ font-size: var(--kosciuszko);
125
50
  }
126
51
  }
@@ -256,6 +256,7 @@ select:active {
256
256
  /*------------------*/
257
257
 
258
258
  /* fixes a bug with new lines */
259
+ /* but creates a weird one with titles */
259
260
  .react-markdown {
260
261
  white-space: pre-wrap;
261
262
  line-height: 1.5;
@@ -2,10 +2,6 @@
2
2
  /* #VISIBILITY */
3
3
  /*------------------*/
4
4
 
5
- .pricing-chart__false {
6
- display: none;
7
- }
8
-
9
5
  .menu__large {
10
6
  padding-inline: var(--elbrus);
11
7
 
@@ -10,7 +10,7 @@ export type paddlePricingChartTypes = {
10
10
  fullDay: number;
11
11
  }[];
12
12
  };
13
- rentalAddons: {
13
+ rentalAddons?: {
14
14
  nodes: {
15
15
  id: React.Key;
16
16
  name: string;
@@ -19,7 +19,4 @@ export type paddlePricingChartTypes = {
19
19
  sup: number;
20
20
  }[];
21
21
  };
22
- book?: boolean;
23
- peek_base: string;
24
- strapiLocaleName: string;
25
22
  };
@@ -1,18 +0,0 @@
1
- // this is the Name.stories.tsx file
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { Badges } from './Badges';
4
-
5
- const meta = {
6
- component: Badges,
7
- title: 'Atoms/Badges',
8
- args: {},
9
- } satisfies Meta<typeof Badges>;
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Primary: Story = {
15
- args: {
16
- primary: true,
17
- },
18
- };
package/src/Badges.tsx DELETED
@@ -1,33 +0,0 @@
1
- // this is the Name.tsx file
2
- import { faker } from '@faker-js/faker/locale/zu_ZA';
3
- import React from 'react';
4
-
5
- interface NameTypes {
6
- name: string;
7
- }
8
- const Name = ({ name }: NameTypes) => {
9
- return (
10
- <div className="badge">
11
- <h5 className="capitalize">{name}</h5>
12
- </div>
13
- );
14
- }
15
-
16
- export const Badges = () => {
17
- // TODO: deal with multiple
18
-
19
- // Discount
20
- if (faker.datatype.boolean()) {
21
- return (
22
- <div className="badge">
23
- <h5 className="capitalize">{faker.number.int({ min: 1, max: 100 })}% off</h5>
24
- </div>
25
- );
26
- }
27
-
28
- if (faker.datatype.boolean()) {
29
- return <Name name={faker.helpers.arrayElement(['inflatable', 'demo', faker.airline.airline().name])} />;
30
- }
31
-
32
- return null;
33
- };
@@ -1,18 +0,0 @@
1
- // this is the Name.stories.tsx file
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { Bag } from './Bag';
4
-
5
- const meta = {
6
- component: Bag,
7
- title: 'Organisms/Bag',
8
- args: {},
9
- } satisfies Meta<typeof Bag>;
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Primary: Story = {
15
- args: {
16
- primary: true,
17
- },
18
- };
package/src/Bag.tsx DELETED
@@ -1,14 +0,0 @@
1
- // this is the Name.tsx file
2
- import React from "react";
3
- import { faker } from "@faker-js/faker";
4
- import { Purchase } from "./Purchase";
5
-
6
- export const Bag = () => {
7
- return (
8
- <div className="bag">
9
- {Array.from({ length: faker.number.int({ min: 1, max: 10 }) }).map(() => (
10
- <Purchase key={faker.string.uuid()} />
11
- ))}
12
- </div>
13
- );
14
- };
@@ -1,18 +0,0 @@
1
- // this is the Name.stories.tsx file
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { Purchase } from './Purchase';
4
-
5
- const meta = {
6
- component: Purchase,
7
- title: 'Molecules/Purchase',
8
- args: {},
9
- } satisfies Meta<typeof Purchase>;
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Primary: Story = {
15
- args: {
16
- primary: true,
17
- },
18
- };
package/src/Purchase.tsx DELETED
@@ -1,47 +0,0 @@
1
- // Retail Card
2
- import React from "react";
3
- import { faker } from "@faker-js/faker";
4
- import { Badges } from "./Badges";
5
- import { TextureBackgrounds } from "./TextureBackgrounds";
6
-
7
- export const Purchase = () => {
8
- return (
9
- <article key={faker.string.uuid()} className="purchase">
10
- {/* // This is currently a wrapper and not used */}
11
- <div className="purchase-collage">
12
- <TextureBackgrounds />
13
- <a href={faker.music.songName()} className="image-link">
14
- {/* <GatsbyImage
15
- image={cutout?.localFile?.childImageSharp?.gatsbyImageData}
16
- alt={cutout?.alternativeText || `${title} by ${brand.slug}`}
17
- className="cutout"
18
- objectFit="contain"
19
- // TODO: this has been causing some problems but keep an eye on it
20
- /> */}
21
- </a>
22
-
23
- <Badges
24
- // inflatable={faker.datatype.boolean()}
25
- // demo={faker.datatype.boolean()}
26
- // discount={faker.datatype.boolean() ? faker.number.int({ min: 1, max: 100 }) : undefined}
27
- />
28
- </div>
29
- <h4 className="purchase__title">
30
- <a href={faker.music.songName()}>{faker.music.album()}</a>
31
- </h4>
32
- <hr />
33
- {/* // ? I think this is too long */}
34
- <p>{faker.lorem.paragraph()}</p>
35
- <hr />
36
- <div className="purchase__details">
37
- <h4>
38
- {/* <Remainder inches={length} /> */}
39
- long by {faker.number.int({ min: 1, max: 100 })}" wide
40
- </h4>
41
- <h5 className="capitalize">
42
- Capacity {faker.number.int({ min: 1, max: 100 })}&thinsp;lbs
43
- </h5>
44
- </div>
45
- </article>
46
- );
47
- };
@@ -1,18 +0,0 @@
1
- // this is the Name.stories.tsx file
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { Select } from './Select';
4
-
5
- const meta = {
6
- component: Select,
7
- title: 'Atoms/Select',
8
- args: {},
9
- } satisfies Meta<typeof Select>;
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Primary: Story = {
15
- args: {
16
- primary: true,
17
- },
18
- };
package/src/Select.tsx DELETED
@@ -1,23 +0,0 @@
1
- // this is the Name.tsx file
2
- import React from 'react';
3
- import { faker } from '@faker-js/faker';
4
-
5
- export const Select = () => {
6
-
7
- return (
8
- <select
9
- className="comparesheet_select"
10
- name={faker.commerce.productName()}
11
- aria-label="Select a product"
12
- >
13
- {Array.from({ length: faker.number.int({ min: 1, max: 10 }) }).map(() => (
14
- <option
15
- key={faker.string.uuid()}
16
- value={faker.commerce.productName()}
17
- >
18
- {faker.commerce.productName()}
19
- </option>
20
- ))}
21
- </select>
22
- );
23
- };
@@ -1,18 +0,0 @@
1
- // this is the Name.stories.tsx file
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { TextureBackgrounds } from './TextureBackgrounds';
4
-
5
- const meta = {
6
- component: TextureBackgrounds,
7
- title: 'Atoms/TextureBackgrounds',
8
- args: {},
9
- } satisfies Meta<typeof TextureBackgrounds>;
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Primary: Story = {
15
- args: {
16
- primary: true,
17
- },
18
- };
@@ -1,31 +0,0 @@
1
- // this is the Name.tsx file
2
- import React from "react";
3
- import { faker } from "@faker-js/faker";
4
-
5
- export const TextureBackgrounds = () => {
6
- return (
7
- <>
8
- <img
9
- src={faker.image.dataUri()}
10
- className="texture-slice crop"
11
- alt="top texture"
12
- />
13
- <img
14
- src={faker.image.dataUri()}
15
- className="texture-slice"
16
- alt="bottom texture"
17
- />
18
- <svg viewBox="0 0 1200 630" xmlns="http://www.w3.org/2000/svg">
19
- <title>Diagonal line decoration</title>
20
- <line
21
- x1="0"
22
- y1="630"
23
- x2="1200"
24
- y2="0"
25
- // only color the stroke in css so it has dark mode
26
- strokeWidth="3"
27
- />
28
- </svg>
29
- </>
30
- );
31
- };
@@ -1,13 +0,0 @@
1
- // ? I dont think I can plug fragments but using types does enough
2
-
3
- import { graphql } from "gatsby"
4
-
5
- export const query = graphql`
6
- fragment testimonialFragment on STRAPI_TESTIMONIAL {
7
- id
8
- testimonial
9
- customer
10
- sign
11
- location
12
- }
13
- `