@banzamel/mineralui 0.2.1 → 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rafał Polak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # MineralUI
2
2
 
3
- Modern React UI component library with a unique **mineral dark aesthetic** — glassmorphism effects, cyan accents, and dark backgrounds. Zero runtime dependencies.
3
+ React component framework for dashboards, admin panels, documentation shells, settings screens and data-heavy internal products.
4
+
5
+ - npm: `@banzamel/mineralui`
6
+ - release version: `0.4.0`
7
+ - peer dependencies: `react >= 18`, `react-dom >= 18`
8
+ - repository: `https://github.com/Banzamel/mineralui`
9
+ - styles: plain `.css` files + CSS variables exposed as `--mineral-*`
4
10
 
5
11
  ## Installation
6
12
 
@@ -8,107 +14,179 @@ Modern React UI component library with a unique **mineral dark aesthetic** — g
8
14
  npm install @banzamel/mineralui
9
15
  ```
10
16
 
17
+ ```tsx
18
+ import '@banzamel/mineralui/styles.css'
19
+ ```
20
+
11
21
  ## Quick Start
12
22
 
13
23
  ```tsx
14
- import {MineralThemeProvider, Input, Select, DatePicker} from '@banzamel/mineralui';
15
- import '@banzamel/mineralui/styles.css';
16
-
17
- function App() {
24
+ import {
25
+ MThemeProvider,
26
+ MButton,
27
+ MCard,
28
+ MCardBody,
29
+ MCardHeader,
30
+ MInput,
31
+ MSelect,
32
+ MStack,
33
+ } from '@banzamel/mineralui'
34
+ import '@banzamel/mineralui/styles.css'
35
+
36
+ function AccountSettings() {
18
37
  return (
19
- <MineralThemeProvider>
20
- <Input label="Name" variant="outlined" />
21
- <Select
22
- label="Country"
23
- options={[
24
- {value: 'pl', label: 'Poland'},
25
- {value: 'de', label: 'Germany'},
26
- ]}
27
- />
28
- <DatePicker label="Birth date" locale="pl" />
29
- </MineralThemeProvider>
30
- );
38
+ <MThemeProvider mode="dark">
39
+ <MCard>
40
+ <MCardHeader title="Workspace settings" description="Basic account data and role assignment." />
41
+ <MCardBody>
42
+ <MStack gap="md">
43
+ <MInput label="Workspace name" placeholder="Banzamel Studio" fullWidth />
44
+ <MSelect
45
+ label="Default role"
46
+ fullWidth
47
+ options={[
48
+ {value: 'owner', label: 'Owner'},
49
+ {value: 'editor', label: 'Editor'},
50
+ ]}
51
+ />
52
+ <MButton>Save changes</MButton>
53
+ </MStack>
54
+ </MCardBody>
55
+ </MCard>
56
+ </MThemeProvider>
57
+ )
31
58
  }
32
59
  ```
33
60
 
34
- ## Components
61
+ ## What Is Included
35
62
 
36
- ### Inputs
37
- | Component | Description |
38
- |-----------|-------------|
39
- | `Input` | Base input variants, sizes, colors, icons, loading, clearable |
40
- | `Textarea` | Multiline with autoResize, minRows/maxRows |
41
- | `InputPassword` | Show/hide toggle, strength indicator |
42
- | `InputNumber` | Stepper buttons, min/max/step, long-press |
43
- | `InputSearch` | Debounced search with instant Enter |
44
- | `InputEmail` | RFC email validation |
45
- | `InputPhone` | Country code prefix, digit formatting |
46
- | `InputName` | Auto-capitalize, strip special chars |
47
- | `InputIBAN` | MOD-97 checksum, country-aware formatting |
48
- | `InputTaxId` | NIP/PESEL/REGON with weighted checksum |
49
- | `InputCurrency` | Symbol, thousand separators, precision |
63
+ ### Theme and primitives
64
+ - `MThemeProvider`, `useMTheme`
65
+ - `MPortal`, `MPopover`
66
+ - CSS variable token system for dark and light mode
67
+ - scoped theme overrides through the provider
68
+
69
+ ### Layout
70
+ - `MContainer`, `MSection`
71
+ - `MStack`, `MInline`, `MGrid`, `MGridItem`
72
+ - `MSurface`, `MDivider`
73
+ - `MHeader`, `MFooter`, `MNavbar`, `MNavs`, `MTabs`
74
+
75
+ ### Display
76
+ - `MCard`, `MCardHeader`, `MCardBody`, `MCardFooter`
77
+ - `MBadge`, `MAlert`
78
+ - `MTable`, `MTableRoot`, `MTableHead`, `MTableBody`, `MTableRow`, `MTableHeadCell`, `MTableCell`
79
+ - `MCollapsible`, `MSpinner`, `MLoader`
80
+ - `MAvatar`, `MModal`
81
+ - `MCalendarBoard`, `MCalendarDayCell`, `MCalendarEventList`, `MCalendarEventItem`, `MCalendarEventPopover`, `MCalendarTimeline`
82
+
83
+ ### Typography
84
+ - `MHeading`, `MText`, `MLink`, `MCode`, `MList`, `MListItem`
50
85
 
51
86
  ### Controls
52
- | Component | Description |
53
- |-----------|-------------|
54
- | `Checkbox` | Custom visual, indeterminate state, colors |
55
- | `Radio` / `RadioGroup` | Context-based group, arrow key navigation |
56
- | `Toggle` | Switch on/off with sliding knob |
87
+ - `MButton`
88
+ - `MCheckbox`
89
+ - `MRadio`, `MRadioGroup`
90
+ - `MToggle`
91
+
92
+ ### Inputs
93
+ - `MInput`, `MTextarea`
94
+ - `MInputPassword`, `MInputNumber`, `MInputSearch`, `MInputEmail`
95
+ - `MInputPhone`, `MInputName`, `MInputIBAN`, `MInputTaxId`, `MInputCurrency`
96
+ - `MInputCreditCard`, `MInputPostCode`
97
+ - `MInputGroup`
57
98
 
58
99
  ### Dropdowns
59
- | Component | Description |
60
- |-----------|-------------|
61
- | `Select` | Single/multi (chips), searchable, grouped, keyboard nav |
62
- | `Autocomplete` | Generic\<T\>, freeSolo, async loading, multiple tags |
63
- | `DatePicker` | Calendar grid, month/year nav, min/max, locale pl/en |
64
- | `TimePicker` | Scrollable columns, minuteStep, 12h/24h format |
100
+ - `MSelect`
101
+ - `MAutocomplete`
102
+ - `MDatePicker`
103
+ - `MDateRangePicker`
104
+ - `MTimePicker`
65
105
 
66
- ### Form
67
- | Component | Description |
68
- |-----------|-------------|
69
- | `Form` | FormContext provider, validation modes, submit handling |
70
- | `useFormField` | Hook for field registration and validation |
106
+ ### Form and validation
107
+ - `MForm`, `useFormField`, `useFormContext`
108
+ - validators: `validateEmail`, `validatePhone`, `validateIBAN`, `validateNIP`, `validatePESEL`, `validateREGON`
109
+ - formatters: `formatIBAN`, `formatPhone`, `formatNIP`, `formatCurrency`, `parseCurrencyToNumber`
110
+ - date helpers: `formatDate`, `parseDate`, `formatTime`, `parseTime`
71
111
 
72
- ### Primitives
73
- `Portal`, `Popover` (auto-flip positioning, glassmorphism)
112
+ ### Hooks and utilities
113
+ - `mergeClasses`
114
+ - `useDebounce`, `useDebouncedCallback`
115
+ - `useOutsideClick`
116
+ - `useKeyNavigation`
117
+ - `useClickEffect`
74
118
 
75
- ## Theming
119
+ ## Design System Notes
76
120
 
77
- MineralUI uses CSS Custom Properties for full customization:
121
+ MineralUI is driven by CSS variables and readable class names.
78
122
 
79
123
  ```css
80
124
  :root {
81
- --mineral-primary: #00A5DE;
82
- --mineral-dark: #0f172a;
83
- --mineral-surface: #1a1a2e;
84
- --mineral-text: #e2e8f0;
125
+ --mineral-primary-rgb: 0, 165, 222;
126
+ --mineral-primary: rgba(0, 165, 222, 1);
127
+ --mineral-surface: rgba(255, 255, 255, 1);
128
+ --mineral-text: rgba(17, 24, 39, 1);
129
+ --mineral-border: rgba(203, 213, 225, 1);
85
130
  }
86
131
  ```
87
132
 
88
- **4 levels of customization:** CSS Variables Props → className → ThemeProvider
133
+ You can theme the package in four layers:
134
+ - token overrides through `--mineral-*`
135
+ - component props such as `color`, `fcolor`, `spacing`, `padding`, `fsize`
136
+ - `className` for local integration
137
+ - `MThemeProvider` for `mode` and scoped token overrides
89
138
 
90
- ## Built-in Utilities
139
+ Framework defaults:
140
+ - plain CSS, not CSS Modules
141
+ - readable local class names
142
+ - no runtime dependencies besides React peer dependencies
143
+ - dark and light mode supported through the same token system
144
+ - default scrollbar styling and typography reset come from the framework styles
91
145
 
92
- ```tsx
93
- // Validators (zero dependencies)
94
- import {validateIBAN, validateNIP, validatePESEL, validateEmail} from '@banzamel/mineralui';
146
+ ## Feature Highlights
147
+
148
+ ### Layout-first API
149
+ - `MStack`, `MInline` and `MGrid` cover the majority of internal dashboard layouts without extra utility libraries.
150
+ - `MGrid` supports equal columns by default and responsive span overrides with `sm`, `md`, `lg`, `xl`.
151
+
152
+ ### Form-heavy components
153
+ - Specialized inputs handle formatting and validation instead of pushing that logic into every application.
154
+ - `MInputCreditCard` detects brand and keeps formatting readable.
155
+ - `MInputPostCode` validates against country-specific postal code rules.
95
156
 
96
- // Formatters
97
- import {formatIBAN, formatCurrency, formatPhone} from '@banzamel/mineralui';
157
+ ### Date workflows
158
+ - `MDatePicker` and `MDateRangePicker` support inline and popover usage.
159
+ - `MDateRangePicker` ships with built-in presets such as `Today`, `Last 7 days`, `Last 30 days`, `This month`, and `Previous month`.
160
+ - `MCalendarBoard` covers non-form calendar surfaces such as planning, invoices, birthdays, and task density views.
98
161
 
99
- // Hooks
100
- import {useDebounce, useClickOutside, useKeyboardNav} from '@banzamel/mineralui';
162
+ ### Interaction model
163
+ - Buttons, cards, avatars, tabs and interactive inputs can share the same click effect model.
164
+ - Navigation and picker overlays render through shared popover primitives.
165
+
166
+ ## Build and Checks
167
+
168
+ ```bash
169
+ npm run format
170
+ npm run format:check
171
+ npm run build
101
172
  ```
102
173
 
103
- ## Key Features
174
+ Known note:
175
+ - `vite-plugin-dts` / API Extractor currently warns about its bundled TypeScript version versus the installed project version, but the build completes successfully.
176
+
177
+ ## Local Verification Surface
178
+
179
+ The working documentation and preview site lives in the sibling project:
180
+
181
+ - `../mineralui-website`
182
+
183
+ That site is wired to the local package build through `file:../mineralui` and is the primary visual verification surface before release.
184
+
185
+ ## Repository
104
186
 
105
- - **Zero dependencies** — only React 18+ as peer dependency
106
- - **TypeScript-first** — complete types, full IDE autocomplete
107
- - **CSS Modules** — isolated styles, no global collisions
108
- - **API-friendly props** — `loading`, `debounceMs`, `validateOnBlur`, `onValueChange`
109
- - **Keyboard navigation** — full ARIA support, focus management
110
- - **Polish validators** — IBAN MOD-97, NIP/PESEL/REGON checksum built-in
187
+ - GitHub: `https://github.com/Banzamel/mineralui`
188
+ - npm: `https://www.npmjs.com/package/@banzamel/mineralui`
111
189
 
112
190
  ## License
113
191
 
114
- MIT [Rafal Polak](https://bitbucket.org/polaczq/mineralui)
192
+ MIT - Rafal Polak