@greghowe79/the-lib 0.9.4 → 0.9.6
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/lib/components/input/input.qwik.cjs +5 -4
- package/lib/components/input/input.qwik.mjs +5 -4
- package/lib/components/text_area/styles.css.qwik.cjs +3 -0
- package/lib/components/text_area/styles.css.qwik.mjs +4 -0
- package/lib/components/text_area/text_area.qwik.cjs +30 -0
- package/lib/components/text_area/text_area.qwik.mjs +30 -0
- package/lib/index.qwik.cjs +2 -0
- package/lib/index.qwik.mjs +3 -1
- package/lib-types/components/input/input.d.ts +1 -0
- package/lib-types/components/text_area/text_area.d.ts +11 -0
- package/lib-types/index.d.ts +1 -0
- package/lib-types/stories/text-area.stories.d.ts +6 -0
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ const uploadImage = qwik.$(async (_event, input, currentFile, selectedFile, imag
|
|
|
26
26
|
if (selectedFile) selectedFile.value = file.name;
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix }) => {
|
|
29
|
+
const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false }) => {
|
|
30
30
|
qwik.useStylesScoped$(styles);
|
|
31
31
|
const internalError = qwik.useSignal(null);
|
|
32
32
|
const showError = error ?? internalError;
|
|
@@ -72,7 +72,7 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
|
|
|
72
72
|
name: id,
|
|
73
73
|
accept: ".png, .jpg, .jpeg, .avif",
|
|
74
74
|
onChange$: (_, el) => uploadImage(_, el, currentFile, selectedFile),
|
|
75
|
-
required
|
|
75
|
+
required
|
|
76
76
|
})
|
|
77
77
|
]
|
|
78
78
|
}),
|
|
@@ -108,7 +108,8 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
|
|
|
108
108
|
"bind:value": value,
|
|
109
109
|
onInput$: inputHandler,
|
|
110
110
|
onBlur$: inputHandler,
|
|
111
|
-
maxLength: 14
|
|
111
|
+
maxLength: 14,
|
|
112
|
+
required
|
|
112
113
|
})
|
|
113
114
|
]
|
|
114
115
|
})
|
|
@@ -130,7 +131,7 @@ const Input = qwik.component$(({ id, type, placeholder, value, error, onValidate
|
|
|
130
131
|
"bind:value": value,
|
|
131
132
|
onInput$: inputHandler,
|
|
132
133
|
onBlur$: inputHandler,
|
|
133
|
-
required
|
|
134
|
+
required
|
|
134
135
|
})
|
|
135
136
|
]
|
|
136
137
|
})
|
|
@@ -24,7 +24,7 @@ const uploadImage = $(async (_event, input, currentFile, selectedFile, imageUrl)
|
|
|
24
24
|
if (selectedFile) selectedFile.value = file.name;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix }) => {
|
|
27
|
+
const Input = component$(({ id, type, placeholder, value, error, onValidate$, onInput$, bgLight, currentFile, selectedFile, icon, prefix, required = false }) => {
|
|
28
28
|
useStylesScoped$(styles);
|
|
29
29
|
const internalError = useSignal(null);
|
|
30
30
|
const showError = error ?? internalError;
|
|
@@ -70,7 +70,7 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
|
|
|
70
70
|
name: id,
|
|
71
71
|
accept: ".png, .jpg, .jpeg, .avif",
|
|
72
72
|
onChange$: (_, el) => uploadImage(_, el, currentFile, selectedFile),
|
|
73
|
-
required
|
|
73
|
+
required
|
|
74
74
|
})
|
|
75
75
|
]
|
|
76
76
|
}),
|
|
@@ -106,7 +106,8 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
|
|
|
106
106
|
"bind:value": value,
|
|
107
107
|
onInput$: inputHandler,
|
|
108
108
|
onBlur$: inputHandler,
|
|
109
|
-
maxLength: 14
|
|
109
|
+
maxLength: 14,
|
|
110
|
+
required
|
|
110
111
|
})
|
|
111
112
|
]
|
|
112
113
|
})
|
|
@@ -128,7 +129,7 @@ const Input = component$(({ id, type, placeholder, value, error, onValidate$, on
|
|
|
128
129
|
"bind:value": value,
|
|
129
130
|
onInput$: inputHandler,
|
|
130
131
|
onBlur$: inputHandler,
|
|
131
|
-
required
|
|
132
|
+
required
|
|
132
133
|
})
|
|
133
134
|
]
|
|
134
135
|
})
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const styles = ".text-area-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.25rem;\r\n width: 100%;\r\n}\r\n\r\n.text-area-container label {\r\n font-size: 0.8125rem;\r\n letter-spacing: 0.0625rem;\r\n color: #333;\r\n padding-left: 0.25rem;\r\n}\r\n\r\n.text-area {\r\n border-radius: 0.5rem;\r\n font-size: 1rem;\r\n line-height: 1.5;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n font-weight: 100;\r\n letter-spacing: inherit;\r\n color: #333;\r\n background: rgba(0, 0, 0, 0.04);\r\n padding: 0.75rem 0.9375rem;\r\n resize: vertical;\r\n min-height: 3.29412rem;\r\n border: none;\r\n transition:\r\n color 0.15s ease,\r\n box-shadow 0.15s ease,\r\n background 0.15s ease;\r\n}\r\n\r\n.text-area::placeholder {\r\n color: #6e6e73;\r\n}\r\n\r\n.text-area:focus {\r\n outline: none;\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n background: white;\r\n}\r\n.text-area.bg_light {\r\n background: white;\r\n box-shadow: inset 0 0 0 1px #86868b;\r\n}\r\n\r\n.text-area.bg_light:focus {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n";
|
|
3
|
+
module.exports = styles;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const styles = ".text-area-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 0.25rem;\r\n width: 100%;\r\n}\r\n\r\n.text-area-container label {\r\n font-size: 0.8125rem;\r\n letter-spacing: 0.0625rem;\r\n color: #333;\r\n padding-left: 0.25rem;\r\n}\r\n\r\n.text-area {\r\n border-radius: 0.5rem;\r\n font-size: 1rem;\r\n line-height: 1.5;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n font-weight: 100;\r\n letter-spacing: inherit;\r\n color: #333;\r\n background: rgba(0, 0, 0, 0.04);\r\n padding: 0.75rem 0.9375rem;\r\n resize: vertical;\r\n min-height: 3.29412rem;\r\n border: none;\r\n transition:\r\n color 0.15s ease,\r\n box-shadow 0.15s ease,\r\n background 0.15s ease;\r\n}\r\n\r\n.text-area::placeholder {\r\n color: #6e6e73;\r\n}\r\n\r\n.text-area:focus {\r\n outline: none;\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n background: white;\r\n}\r\n.text-area.bg_light {\r\n background: white;\r\n box-shadow: inset 0 0 0 1px #86868b;\r\n}\r\n\r\n.text-area.bg_light:focus {\r\n box-shadow: inset 0 0 0 1.5px #007aff;\r\n}\r\n";
|
|
2
|
+
export {
|
|
3
|
+
styles as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
4
|
+
const qwik = require("@builder.io/qwik");
|
|
5
|
+
const styles = require("./styles.css.qwik.cjs");
|
|
6
|
+
require("@fontsource/roboto-condensed/500.css");
|
|
7
|
+
const TextArea = qwik.component$(({ id, title, content, required = false, placeholder, bgLight }) => {
|
|
8
|
+
qwik.useStylesScoped$(styles);
|
|
9
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
10
|
+
class: "text-area-container",
|
|
11
|
+
children: [
|
|
12
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("label", {
|
|
13
|
+
for: id,
|
|
14
|
+
children: title
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsx("textarea", {
|
|
17
|
+
id,
|
|
18
|
+
name: "story",
|
|
19
|
+
rows: 5,
|
|
20
|
+
cols: 33,
|
|
21
|
+
"bind:value": content,
|
|
22
|
+
required,
|
|
23
|
+
placeholder,
|
|
24
|
+
class: `text-area ${bgLight ? "bg_light" : ""}`,
|
|
25
|
+
children: content.value
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
exports.TextArea = TextArea;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useStylesScoped$ } from "@builder.io/qwik";
|
|
3
|
+
import styles from "./styles.css.qwik.mjs";
|
|
4
|
+
import "@fontsource/roboto-condensed/500.css";
|
|
5
|
+
const TextArea = component$(({ id, title, content, required = false, placeholder, bgLight }) => {
|
|
6
|
+
useStylesScoped$(styles);
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8
|
+
class: "text-area-container",
|
|
9
|
+
children: [
|
|
10
|
+
title && /* @__PURE__ */ jsx("label", {
|
|
11
|
+
for: id,
|
|
12
|
+
children: title
|
|
13
|
+
}),
|
|
14
|
+
/* @__PURE__ */ jsx("textarea", {
|
|
15
|
+
id,
|
|
16
|
+
name: "story",
|
|
17
|
+
rows: 5,
|
|
18
|
+
cols: 33,
|
|
19
|
+
"bind:value": content,
|
|
20
|
+
required,
|
|
21
|
+
placeholder,
|
|
22
|
+
class: `text-area ${bgLight ? "bg_light" : ""}`,
|
|
23
|
+
children: content.value
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
TextArea
|
|
30
|
+
};
|
package/lib/index.qwik.cjs
CHANGED
|
@@ -10,6 +10,7 @@ const input = require("./components/input/input.qwik.cjs");
|
|
|
10
10
|
const hero = require("./components/hero/hero.qwik.cjs");
|
|
11
11
|
const onboardingsteps = require("./components/onboarding/onboardingsteps.qwik.cjs");
|
|
12
12
|
const select = require("./components/select/select.qwik.cjs");
|
|
13
|
+
const text_area = require("./components/text_area/text_area.qwik.cjs");
|
|
13
14
|
exports.Logo = logo.Logo;
|
|
14
15
|
exports.Counter = counter.Counter;
|
|
15
16
|
exports.Button = button.Button;
|
|
@@ -20,3 +21,4 @@ exports.Input = input.Input;
|
|
|
20
21
|
exports.Hero = hero.Hero;
|
|
21
22
|
exports.OnboardingSteps = onboardingsteps.OnboardingSteps;
|
|
22
23
|
exports.Select = select.Select;
|
|
24
|
+
exports.TextArea = text_area.TextArea;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { Input } from "./components/input/input.qwik.mjs";
|
|
|
8
8
|
import { Hero } from "./components/hero/hero.qwik.mjs";
|
|
9
9
|
import { OnboardingSteps } from "./components/onboarding/onboardingsteps.qwik.mjs";
|
|
10
10
|
import { Select } from "./components/select/select.qwik.mjs";
|
|
11
|
+
import { TextArea } from "./components/text_area/text_area.qwik.mjs";
|
|
11
12
|
export {
|
|
12
13
|
Button,
|
|
13
14
|
Counter,
|
|
@@ -18,5 +19,6 @@ export {
|
|
|
18
19
|
Modal,
|
|
19
20
|
NavigationMenu,
|
|
20
21
|
OnboardingSteps,
|
|
21
|
-
Select
|
|
22
|
+
Select,
|
|
23
|
+
TextArea
|
|
22
24
|
};
|
|
@@ -14,6 +14,7 @@ export interface InputProps {
|
|
|
14
14
|
selectedFile?: Signal<string>;
|
|
15
15
|
icon?: JSXOutput | Component<unknown>;
|
|
16
16
|
prefix?: string;
|
|
17
|
+
required?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const displayLocalImage: QRL<(file: File, imageUrl?: Signal<string>) => void>;
|
|
19
20
|
export declare const uploadImage: QRL<(_event: Event, input: HTMLInputElement, currentFile?: Signal<any>, selectedFile?: Signal<string>, imageUrl?: Signal<string>) => Promise<void>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Signal } from '@builder.io/qwik';
|
|
2
|
+
import '@fontsource/roboto-condensed/500.css';
|
|
3
|
+
export interface TextAreaProps {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
content: Signal<string>;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
bgLight?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const TextArea: import("@builder.io/qwik").Component<TextAreaProps>;
|
package/lib-types/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export { Input } from './components/input/input';
|
|
|
8
8
|
export { Hero } from './components/hero/hero';
|
|
9
9
|
export { OnboardingSteps } from './components/onboarding/onboardingsteps';
|
|
10
10
|
export { Select } from './components/select/select';
|
|
11
|
+
export { TextArea } from './components/text_area/text_area';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from 'storybook-framework-qwik';
|
|
2
|
+
import { type TextAreaProps } from '../components/text_area/text_area';
|
|
3
|
+
declare const meta: Meta<TextAreaProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<TextAreaProps>;
|
|
6
|
+
export declare const TextAreaWithLabel: Story;
|