@serkonda7/solid-components 0.1.0 → 0.2.1

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,25 @@
1
+ import type { JSX } from 'solid-js';
2
+ export interface SearchBarProps {
3
+ value: string;
4
+ onInput: (value: string) => void;
5
+ /** Accessible name of the input. Defaults to `Search`. */
6
+ ariaLabel?: string;
7
+ /** Defaults to `Search…`. */
8
+ placeholder?: string;
9
+ /** Accessible name of the clear button. Defaults to `Clear search`. */
10
+ clearLabel?: string;
11
+ /**
12
+ * Key that focuses the input together with Ctrl/Cmd, from anywhere on the page.
13
+ * Defaults to `k`; `false` disables the shortcut and its hint.
14
+ */
15
+ shortcutKey?: string | false;
16
+ /** Text of the shortcut hint shown while empty. Defaults to `Ctrl <KEY>`. */
17
+ shortcutLabel?: string;
18
+ class?: string;
19
+ }
20
+ /**
21
+ * Search input with a leading icon, a clear button while filled, and a global
22
+ * Ctrl/Cmd+K shortcut that focuses and selects it. While the input is empty a
23
+ * `<kbd>` hint shows the shortcut (hidden on touch devices).
24
+ */
25
+ export declare function SearchBar(props: SearchBarProps): JSX.Element;
package/dist/styles.css CHANGED
@@ -79,13 +79,53 @@
79
79
  gap: 0.375rem;
80
80
  }
81
81
 
82
+ .data-table-customizer-item {
83
+ display: flex;
84
+ align-items: center;
85
+ gap: 0.25rem;
86
+ border-radius: 0.25rem;
87
+ }
88
+
89
+ .data-table-customizer-item-dragging {
90
+ opacity: 0.5;
91
+ }
92
+
93
+ .data-table-customizer-grip {
94
+ flex: none;
95
+ opacity: 0.5;
96
+ cursor: grab;
97
+ }
98
+
82
99
  .data-table-customizer-option {
83
100
  display: flex;
101
+ flex: 1;
84
102
  align-items: center;
85
103
  gap: 0.5rem;
86
104
  cursor: pointer;
87
105
  }
88
106
 
107
+ .data-table-customizer-move {
108
+ display: inline-flex;
109
+ padding: 0.125rem;
110
+ border: 0;
111
+ border-radius: 0.25rem;
112
+ background: none;
113
+ color: inherit;
114
+ cursor: pointer;
115
+ }
116
+
117
+ .data-table-customizer-move:hover:not(:disabled) {
118
+ background: var(
119
+ --data-table-customizer-hover-bg,
120
+ var(--surface-hover, light-dark(#f5f5f5, #292d33))
121
+ );
122
+ }
123
+
124
+ .data-table-customizer-move:disabled {
125
+ opacity: 0.3;
126
+ cursor: default;
127
+ }
128
+
89
129
  .data-table-customizer-option:has(input:disabled) {
90
130
  opacity: 0.6;
91
131
  cursor: not-allowed;
@@ -522,6 +562,29 @@
522
562
  background: transparent;
523
563
  }
524
564
 
565
+ .filter-table-saved {
566
+ display: flex;
567
+ align-items: center;
568
+ gap: 0.25rem;
569
+ flex: 0 1 14rem;
570
+ min-width: 9rem;
571
+ }
572
+
573
+ .filter-table-saved > :first-child {
574
+ flex: 1;
575
+ min-width: 0;
576
+ }
577
+
578
+ .filter-table-save {
579
+ display: flex;
580
+ align-items: center;
581
+ gap: 0.375rem;
582
+ }
583
+
584
+ .filter-table-save .filter-table-input {
585
+ width: 12rem;
586
+ }
587
+
525
588
  .filter-table-chip-remove {
526
589
  display: inline-flex;
527
590
  padding: 0;
@@ -647,3 +710,88 @@
647
710
  padding-left: 0;
648
711
  }
649
712
  }
713
+
714
+ /* SearchBar: input with a leading icon and trailing clear button / shortcut hint. */
715
+ .search-bar {
716
+ position: relative;
717
+ display: flex;
718
+ align-items: center;
719
+ }
720
+
721
+ .search-bar-input {
722
+ box-sizing: border-box;
723
+ width: 100%;
724
+ padding: 0.5rem 2.4rem;
725
+ border: 1px solid
726
+ var(--search-bar-border, var(--border, light-dark(#d0d0d0, #3a3e45)));
727
+ border-radius: 0.375rem;
728
+ background: var(
729
+ --search-bar-bg,
730
+ var(--surface, light-dark(#ffffff, #1d2024))
731
+ );
732
+ color: inherit;
733
+ font: inherit;
734
+ }
735
+
736
+ .search-bar-icon {
737
+ position: absolute;
738
+ left: 0.8rem;
739
+ color: var(
740
+ --search-bar-muted,
741
+ var(--text-secondary, light-dark(#616161, #9b9da5))
742
+ );
743
+ pointer-events: none;
744
+ }
745
+
746
+ .search-bar-clear {
747
+ position: absolute;
748
+ right: 0.4rem;
749
+ display: grid;
750
+ place-items: center;
751
+ width: 28px;
752
+ height: 28px;
753
+ padding: 0;
754
+ border: 1px solid transparent;
755
+ border-radius: 50%;
756
+ background: transparent;
757
+ color: var(
758
+ --search-bar-muted,
759
+ var(--text-secondary, light-dark(#616161, #9b9da5))
760
+ );
761
+ cursor: pointer;
762
+ }
763
+
764
+ .search-bar-clear:hover {
765
+ background: var(
766
+ --search-bar-hover-bg,
767
+ var(--surface-hover, light-dark(#f5f5f5, #292d33))
768
+ );
769
+ color: inherit;
770
+ }
771
+
772
+ .search-bar-shortcut {
773
+ position: absolute;
774
+ right: 0.7rem;
775
+ padding: 0.15rem 0.4rem;
776
+ border: 1px solid
777
+ var(--search-bar-border, var(--border, light-dark(#d0d0d0, #3a3e45)));
778
+ border-radius: 6px;
779
+ background: var(
780
+ --search-bar-hover-bg,
781
+ var(--surface-hover, light-dark(#f5f5f5, #292d33))
782
+ );
783
+ color: var(
784
+ --search-bar-muted,
785
+ var(--text-secondary, light-dark(#616161, #9b9da5))
786
+ );
787
+ font-family: inherit;
788
+ font-size: 0.75rem;
789
+ pointer-events: none;
790
+ user-select: none;
791
+ }
792
+
793
+ @media (pointer: coarse) {
794
+ .search-bar-shortcut {
795
+ display: none;
796
+ }
797
+ }
package/dist/vite.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import type { Plugin } from 'vite';
2
+ /**
3
+ * Keeps `@tabler/icons-solidjs` from loading its barrel, which re-exports ~6000
4
+ * icon modules. `vite-plugin-solid` adds the `solid` export condition, so in dev
5
+ * the barrel is unbundled source and the browser fetches every one of them.
6
+ *
7
+ * - Rewrites `import { IconX, IconY as Y } from '@tabler/icons-solidjs'` to
8
+ * per-icon default imports, in dev and build. `type` specifiers are dropped.
9
+ * - Fails the transform for anything it can't rewrite (namespace, default, or
10
+ * dynamic imports, re-exports, unknown names) instead of falling back.
11
+ * - In dev, resolving the package root from any other module is an error that
12
+ * names the importer, and the package is excluded from dependency pre-bundling.
13
+ *
14
+ * Add it before `solid()`: `plugins: [tablerIcons(), solid()]`.
15
+ */
16
+ export declare function tablerIcons(): Plugin;
package/dist/vite.js ADDED
@@ -0,0 +1,2 @@
1
+ import{existsSync as d}from"node:fs";import{join as b}from"node:path";var s="@tabler/icons-solidjs",m=`/${s}/`,I=/import\s+(type\s+)?\{([^}]*)\}\s*from\s*(['"])@tabler\/icons-solidjs\3;?/g,_=/(?:\bfrom\s*|\bimport\s*\(?\s*)(['"])@tabler\/icons-solidjs\1|\brequire\s*\(\s*(['"])@tabler\/icons-solidjs\2/,j=/^Icon[A-Za-z0-9]+$/,v=/\.[cm]?[jt]sx?$/;function M(){let p=!1,f=new Map;return{name:"solid-components:tabler-icons",enforce:"pre",config(e,t){return p=t.command==="serve",{optimizeDeps:{exclude:[s]}}},async resolveId(e,t,r){if(!p||e!==s||r.scan)return null;this.error(`${t??"unknown module"} imports the ${s} barrel, which loads every icon. Use plain named imports (import { IconX } from '${s}') in a file transformed by tablerIcons().`)},async transform(e,t){if(!e.includes(s)||t.startsWith("\x00")||t.includes(m))return;let r=t.split("?",1)[0]??t;if(!v.test(r))return;let l=await this.resolve(s,r,{skipSelf:!0});if(!l)this.error(`Cannot resolve ${s} from ${r}`);let c=l.id.slice(0,l.id.lastIndexOf(m)+m.length),o=f.get(c);if(!o){if(o=b(c,"dist/source/icons"),!d(o))this.error(`${s} has no per-icon modules at ${o}`);f.set(c,o)}let h=o,a=e.replace(I,(R,g,y)=>{if(g)return"";return y.split(",").map((n)=>n.trim()).filter((n)=>n!==""&&!n.startsWith("type ")).map((n)=>{let[i="",E=i]=n.split(/\s+as\s+/),u=b(h,`${i}.js`);if(!j.test(i)||!d(u))this.error(`${r}: '${i}' is not a ${s} icon`);return`import ${E} from ${JSON.stringify(u)};`}).join(`
2
+ `)});if(_.test(a))this.error(`${r}: only plain named imports from ${s} are supported (no namespace, default, or dynamic imports, or re-exports)`);return a===e?void 0:{code:a,map:null}}}}export{M as tablerIcons};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serkonda7/solid-components",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Reusable components for SolidJS",
5
5
  "license": "MIT",
6
6
  "author": "serkonda7",
@@ -19,6 +19,10 @@
19
19
  "types": "./dist/index.d.ts",
20
20
  "import": "./dist/index.js"
21
21
  },
22
+ "./vite": {
23
+ "types": "./dist/vite.d.ts",
24
+ "import": "./dist/vite.js"
25
+ },
22
26
  "./styles.css": "./dist/styles.css"
23
27
  },
24
28
  "main": "./dist/index.js",
@@ -27,7 +31,7 @@
27
31
  "scripts": {
28
32
  "lint": "biome check --write",
29
33
  "lint:ci": "biome ci",
30
- "check": "tsc --noEmit",
34
+ "check": "bun check",
31
35
  "test": "vitest run",
32
36
  "examples": "vite --config examples/vite.config.ts",
33
37
  "build:dev": "bun run scripts/build.ts --dev",
@@ -37,20 +41,26 @@
37
41
  "engines": {
38
42
  "node": ">=24"
39
43
  },
40
- "packageManager": "bun@1.4.2",
41
- "peerDependencies": {
42
- "solid-js": ">=1.9.0"
43
- },
44
+ "packageManager": "bun@1.4.3",
44
45
  "devDependencies": {
45
46
  "@biomejs/biome": "2.5.15",
46
47
  "@tabler/icons-solidjs": "~3.49.0",
47
- "@types/bun": "1.4.2",
48
- "@vitest/browser-playwright": "~5.0.4",
48
+ "@types/bun": "1.4.3",
49
+ "@vitest/browser-playwright": "~5.0.5",
49
50
  "playwright": "~1.64.0",
50
51
  "solid-js": "~1.9.17",
51
52
  "typescript": "~7.0.2",
52
53
  "vite": "~8.3.4",
53
54
  "vite-plugin-solid": "~2.11.14",
54
- "vitest": "~5.0.4"
55
+ "vitest": "~5.0.5"
56
+ },
57
+ "peerDependencies": {
58
+ "solid-js": ">=1.9.0",
59
+ "vite": ">=8.0.0"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "vite": {
63
+ "optional": true
64
+ }
55
65
  }
56
66
  }