@greghowe79/the-lib 0.8.6 → 0.8.7

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.
@@ -0,0 +1,60 @@
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
+ require("@fontsource/roboto-condensed/500.css");
6
+ const styles = require("./styles.css.qwik.cjs");
7
+ const Select = qwik.component$(({ id, label, options, selected }) => {
8
+ qwik.useStylesScoped$(styles);
9
+ const handleChange$ = qwik.$((event) => {
10
+ const target = event.target;
11
+ selected.value = target.value;
12
+ });
13
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
14
+ class: "select-container",
15
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
16
+ class: `select-wrapper ${selected.value ? "has-value" : ""}`,
17
+ children: [
18
+ /* @__PURE__ */ jsxRuntime.jsxs("select", {
19
+ id,
20
+ name: id,
21
+ class: "select-element",
22
+ onChange$: handleChange$,
23
+ children: [
24
+ /* @__PURE__ */ jsxRuntime.jsx("option", {
25
+ value: "",
26
+ disabled: true,
27
+ selected: true,
28
+ hidden: true
29
+ }),
30
+ options.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", {
31
+ value: option.value,
32
+ children: option.label
33
+ }, option.value))
34
+ ]
35
+ }),
36
+ /* @__PURE__ */ jsxRuntime.jsx("label", {
37
+ for: id,
38
+ class: "select-label",
39
+ children: label
40
+ }),
41
+ /* @__PURE__ */ jsxRuntime.jsx("div", {
42
+ class: "select-arrow",
43
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ viewBox: "0 0 32 32",
46
+ "aria-hidden": "true",
47
+ role: "presentation",
48
+ focusable: "false",
49
+ style: "display: block; fill: none; height: 16px; width: 16px; stroke: currentcolor; stroke-width: 4; overflow: visible;",
50
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", {
51
+ fill: "none",
52
+ d: "M28 12 16.7 23.3a1 1 0 0 1-1.4 0L4 12"
53
+ })
54
+ })
55
+ })
56
+ ]
57
+ })
58
+ });
59
+ });
60
+ exports.Select = Select;
@@ -0,0 +1,60 @@
1
+ import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$, useStylesScoped$, $ } from "@builder.io/qwik";
3
+ import "@fontsource/roboto-condensed/500.css";
4
+ import styles from "./styles.css.qwik.mjs";
5
+ const Select = component$(({ id, label, options, selected }) => {
6
+ useStylesScoped$(styles);
7
+ const handleChange$ = $((event) => {
8
+ const target = event.target;
9
+ selected.value = target.value;
10
+ });
11
+ return /* @__PURE__ */ jsx("div", {
12
+ class: "select-container",
13
+ children: /* @__PURE__ */ jsxs("div", {
14
+ class: `select-wrapper ${selected.value ? "has-value" : ""}`,
15
+ children: [
16
+ /* @__PURE__ */ jsxs("select", {
17
+ id,
18
+ name: id,
19
+ class: "select-element",
20
+ onChange$: handleChange$,
21
+ children: [
22
+ /* @__PURE__ */ jsx("option", {
23
+ value: "",
24
+ disabled: true,
25
+ selected: true,
26
+ hidden: true
27
+ }),
28
+ options.map((option) => /* @__PURE__ */ jsx("option", {
29
+ value: option.value,
30
+ children: option.label
31
+ }, option.value))
32
+ ]
33
+ }),
34
+ /* @__PURE__ */ jsx("label", {
35
+ for: id,
36
+ class: "select-label",
37
+ children: label
38
+ }),
39
+ /* @__PURE__ */ jsx("div", {
40
+ class: "select-arrow",
41
+ children: /* @__PURE__ */ jsx("svg", {
42
+ xmlns: "http://www.w3.org/2000/svg",
43
+ viewBox: "0 0 32 32",
44
+ "aria-hidden": "true",
45
+ role: "presentation",
46
+ focusable: "false",
47
+ style: "display: block; fill: none; height: 16px; width: 16px; stroke: currentcolor; stroke-width: 4; overflow: visible;",
48
+ children: /* @__PURE__ */ jsx("path", {
49
+ fill: "none",
50
+ d: "M28 12 16.7 23.3a1 1 0 0 1-1.4 0L4 12"
51
+ })
52
+ })
53
+ })
54
+ ]
55
+ })
56
+ });
57
+ });
58
+ export {
59
+ Select
60
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const styles = ".select-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n position: relative;\r\n width: 100%;\r\n /* max-width: 25rem; */ /* 400px */\r\n}\r\n\r\n.select-wrapper {\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n.select-element {\r\n width: 100%;\r\n padding: 1.2rem 2.5rem 0.4rem 0.75rem;\r\n font-size: 1rem;\r\n border: 0.063rem solid #86868b; /* 1px */\r\n border-radius: 0.375rem; /* 6px */\r\n background-color: white;\r\n appearance: none;\r\n height: 3.4375rem; /* 55px */\r\n}\r\n\r\n.select-label {\r\n position: absolute;\r\n top: 1rem; /* 16px */\r\n left: 0.75rem; /* 12px */\r\n font-size: 1rem;\r\n color: #888;\r\n transition: all 0.2s ease;\r\n pointer-events: none;\r\n}\r\n\r\n.select-wrapper.has-value .select-label,\r\n.select-element:focus + .select-label {\r\n top: 0.3rem; /* 4.8px */\r\n left: 0.6rem; /* 9.6px */\r\n font-size: 0.75rem;\r\n color: #555;\r\n}\r\n\r\n.select-arrow {\r\n position: absolute;\r\n top: 50%;\r\n right: 0.75rem; /* 12px */\r\n transform: translateY(-50%);\r\n pointer-events: none;\r\n color: #666;\r\n}\r\n";
3
+ module.exports = styles;
@@ -0,0 +1,4 @@
1
+ const styles = ".select-container {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n position: relative;\r\n width: 100%;\r\n /* max-width: 25rem; */ /* 400px */\r\n}\r\n\r\n.select-wrapper {\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n.select-element {\r\n width: 100%;\r\n padding: 1.2rem 2.5rem 0.4rem 0.75rem;\r\n font-size: 1rem;\r\n border: 0.063rem solid #86868b; /* 1px */\r\n border-radius: 0.375rem; /* 6px */\r\n background-color: white;\r\n appearance: none;\r\n height: 3.4375rem; /* 55px */\r\n}\r\n\r\n.select-label {\r\n position: absolute;\r\n top: 1rem; /* 16px */\r\n left: 0.75rem; /* 12px */\r\n font-size: 1rem;\r\n color: #888;\r\n transition: all 0.2s ease;\r\n pointer-events: none;\r\n}\r\n\r\n.select-wrapper.has-value .select-label,\r\n.select-element:focus + .select-label {\r\n top: 0.3rem; /* 4.8px */\r\n left: 0.6rem; /* 9.6px */\r\n font-size: 0.75rem;\r\n color: #555;\r\n}\r\n\r\n.select-arrow {\r\n position: absolute;\r\n top: 50%;\r\n right: 0.75rem; /* 12px */\r\n transform: translateY(-50%);\r\n pointer-events: none;\r\n color: #666;\r\n}\r\n";
2
+ export {
3
+ styles as default
4
+ };
@@ -9,6 +9,7 @@ const loader = require("./components/loader/loader.qwik.cjs");
9
9
  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
+ const select = require("./components/select/select.qwik.cjs");
12
13
  exports.Logo = logo.Logo;
13
14
  exports.Counter = counter.Counter;
14
15
  exports.Button = button.Button;
@@ -18,3 +19,4 @@ exports.Loader = loader.Loader;
18
19
  exports.Input = input.Input;
19
20
  exports.Hero = hero.Hero;
20
21
  exports.OnboardingSteps = onboardingsteps.OnboardingSteps;
22
+ exports.Select = select.Select;
@@ -7,6 +7,7 @@ import { Loader } from "./components/loader/loader.qwik.mjs";
7
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
+ import { Select } from "./components/select/select.qwik.mjs";
10
11
  export {
11
12
  Button,
12
13
  Counter,
@@ -16,5 +17,6 @@ export {
16
17
  Logo,
17
18
  Modal,
18
19
  NavigationMenu,
19
- OnboardingSteps
20
+ OnboardingSteps,
21
+ Select
20
22
  };
@@ -0,0 +1,12 @@
1
+ import { Signal } from '@builder.io/qwik';
2
+ import '@fontsource/roboto-condensed/500.css';
3
+ export interface SelectProps {
4
+ id: string;
5
+ options: Array<{
6
+ value: string;
7
+ label: string;
8
+ }>;
9
+ label: string;
10
+ selected: Signal<string>;
11
+ }
12
+ export declare const Select: import("@builder.io/qwik").Component<SelectProps>;
@@ -7,3 +7,4 @@ export { Loader } from './components/loader/loader';
7
7
  export { Input } from './components/input/input';
8
8
  export { Hero } from './components/hero/hero';
9
9
  export { OnboardingSteps } from './components/onboarding/onboardingsteps';
10
+ export { Select } from './components/select/select';
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from 'storybook-framework-qwik';
2
+ import { type SelectProps } from '../components/select/select';
3
+ declare const meta: Meta<SelectProps>;
4
+ export default meta;
5
+ type Story = StoryObj<SelectProps>;
6
+ export declare const SelectWithOptions: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",