basefn 1.1.0 → 1.1.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.
package/README.md CHANGED
@@ -1,102 +1,98 @@
1
- # basefn-UI
1
+ # basefn
2
2
 
3
- A simple, neutrally styled UI component library for [Xote](https://github.com/brnrdog/xote) applications, primarily used to battle-test the Xote framework against a real-world user interface system.
3
+ [![npm version](https://img.shields.io/npm/v/basefn.svg)](https://www.npmjs.com/package/basefn)
4
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/basefn)](https://bundlephobia.com/package/basefn)
5
+
6
+ A UI component library for [Xote](https://github.com/brnrdog/xote) applications. Built with ReScript, designed to be lightweight and customizable.
4
7
 
5
8
  ## Installation
6
9
 
10
+ Ensure you have the dependencies installed:
11
+
7
12
  ```bash
8
- npm install basefn
13
+ npm install xote @rescript/core
9
14
  ```
10
15
 
11
- Make sure you have installed [xote](https://github.com/brnrdog/xote) and [rescript-signals](https://github.com/brnrdog/rescript-signals).
16
+ Install `basefn`:
12
17
 
13
- ## Usage Patterns
18
+ ```bash
19
+ npm install basefn
20
+ ```
21
+
22
+ **Required peer dependencies:**
23
+ - `xote` - The reactive framework
24
+ - `@rescript/core` - ReScript standard library
25
+
26
+ **Add to your `rescript.json`:**
27
+ ```json
28
+ {
29
+ "dependencies": [
30
+ // Standard ReScript library
31
+ "@rescript/core",
32
+ // Signals library
33
+ "rescript-signals",
34
+ // UI library
35
+ "xote"
36
+ ],
37
+ }
38
+ ```
14
39
 
15
- Components accept both regular values and signals. Use the `static()` for static values, or `reactive()` for reactive signals:
40
+ ## Quick Start
16
41
 
17
42
  ```rescript
18
- open basefnUI
19
- open ReactiveProp
43
+ open Xote
44
+ open Basefn
20
45
 
21
- // Using regular values (static)
46
+ // Static values
22
47
  <Button
23
- variant={Button.Primary}
48
+ variant={Primary}
24
49
  label={static("Click me")}
25
- onClick={_ => Console.log("You clicked!")}
50
+ onClick={_ => Console.log("Clicked")}
26
51
  />
27
52
 
28
- // Using signals (reactive)
29
- let labelSignal = Signal.make("Click me")
53
+ // Reactive values
54
+ let count = Signal.make(0)
30
55
  <Button
31
- variant={Button.Primary}
32
- label={reactive(labelSignal)}
33
- onClick={_ => Signal.set(labelSignal, "You clicked!")}
56
+ variant={Primary}
57
+ label={reactive(count->Signal.map(n => `Clicked ${n->Int.toString} times`))}
58
+ onClick={_ => count->Signal.update(n => n + 1)}
34
59
  />
35
60
  ```
36
61
 
37
62
  ## Components
38
63
 
39
- See the available components at [src/components](https://github.com/brnrdog/basefn-ui/tree/main/src/components). Contributions are welcome if features are missing.
64
+ **Forms:** [Button](src/components/Basefn__Button.res) · [Input](src/components/Basefn__Input.res) · [Textarea](src/components/Basefn__Textarea.res) · [Checkbox](src/components/Basefn__Checkbox.res) · [Radio](src/components/Basefn__Radio.res) · [Select](src/components/Basefn__Select.res) · [Switch](src/components/Basefn__Switch.res) · [Slider](src/components/Basefn__Slider.res)
65
+
66
+ **Layout:** [Card](src/components/Basefn__Card.res) · [Grid](src/components/Basefn__Grid.res) · [Separator](src/components/Basefn__Separator.res) · [AppLayout](src/components/Basefn__AppLayout.res) · [Sidebar](src/components/Basefn__Sidebar.res) · [Topbar](src/components/Basefn__Topbar.res)
67
+
68
+ **Feedback:** [Alert](src/components/Basefn__Alert.res) · [Toast](src/components/Basefn__Toast.res) · [Modal](src/components/Basefn__Modal.res) · [Drawer](src/components/Basefn__Drawer.res) · [Spinner](src/components/Basefn__Spinner.res) · [Progress](src/components/Basefn__Progress.res) · [Tooltip](src/components/Basefn__Tooltip.res)
69
+
70
+ **Navigation:** [Tabs](src/components/Basefn__Tabs.res) · [Breadcrumb](src/components/Basefn__Breadcrumb.res) · [Stepper](src/components/Basefn__Stepper.res) · [Dropdown](src/components/Basefn__Dropdown.res)
71
+
72
+ **Data Display:** [Typography](src/components/Basefn__Typography.res) · [Badge](src/components/Basefn__Badge.res) · [Avatar](src/components/Basefn__Avatar.res) · [Timeline](src/components/Basefn__Timeline.res) · [Accordion](src/components/Basefn__Accordion.res) · [Kbd](src/components/Basefn__Kbd.res) · [Icon](src/components/Basefn__Icon.res)
73
+
74
+ **Utilities:** [ThemeToggle](src/components/Basefn__ThemeToggle.res) · [Label](src/components/Basefn__Label.res)
40
75
 
41
76
  ## Theming
42
77
 
43
- All components use CSS variables for styling, making them easy to customize. Override the variables in your CSS:
78
+ Customize via CSS variables:
44
79
 
45
80
  ```css
46
81
  :root {
47
- --basefn-color-primary: #your-color;
48
- --basefn-color-secondary: #your-color;
49
- /* ... other variables */
82
+ --basefn-color-primary: #0066cc;
83
+ --basefn-color-secondary: #6c757d;
84
+ --basefn-radius: 0.375rem;
85
+ /* See src/styles/variables.css for all variables */
50
86
  }
51
87
  ```
52
88
 
53
- See `src/styles/variables.css` for all available CSS variables.
54
-
55
89
  ## Development
56
90
 
57
91
  ```bash
58
- # Install dependencies
59
- npm install
60
-
61
- # Start development server with Vite (hot reload)
62
- npm run dev
63
-
64
- # Build ReScript code
65
- npm run build
66
-
67
- # Watch mode for ReScript
68
- npm run watch
69
-
70
- # Build for production
71
- npm run build:vite
72
-
73
- # Preview production build
74
- npm run preview
75
-
76
- # Clean ReScript build
77
- npm run clean
78
- ```
79
-
80
- ### Running the Demo
81
-
82
- 1. Install dependencies: `npm install`
83
- 2. Build the ReScript code: `npm run build`
84
- 3. Start the dev server: `npm run dev`
85
- 4. Open your browser to `http://localhost:3000`
86
-
87
- The demo application showcases all components with live form state updates.
88
-
89
- ## Project Structure
90
-
91
- ```
92
- basefn-ui/
93
- ├── src/
94
- │ ├── components/ # All UI components
95
- │ ├── styles/ # CSS variables and theming
96
- │ ├── Basefn__Dom.res # Simple dom bindings used in the lib
97
- │ └── Basefn.res # Main export file
98
- ├── package.json
99
- └── rescript.json
92
+ npm install # Install dependencies
93
+ npm run build # Build ReScript
94
+ npm run watch # Watch mode
95
+ npm run dev # Dev server with demo
100
96
  ```
101
97
 
102
98
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basefn",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/brnrdog/basefn.git"
package/src/Basefn.res CHANGED
@@ -54,52 +54,122 @@ type gridItemColumnSpan = Basefn__Grid.Item.columnSpan
54
54
  type gridItemRowSpan = Basefn__Grid.Item.rowSpan
55
55
 
56
56
  // Form Components
57
- module Button = Basefn__Button
58
- module Input = Basefn__Input
59
- module Textarea = Basefn__Textarea
60
- module Select = Basefn__Select
61
- module Checkbox = Basefn__Checkbox
62
- module Radio = Basefn__Radio
63
- module Label = Basefn__Label
57
+ module Button = {
58
+ include Basefn__Button
59
+ }
60
+ module Input = {
61
+ include Basefn__Input
62
+ }
63
+ module Textarea = {
64
+ include Basefn__Textarea
65
+ }
66
+ module Select = {
67
+ include Basefn__Select
68
+ }
69
+ module Checkbox = {
70
+ include Basefn__Checkbox
71
+ }
72
+ module Radio = {
73
+ include Basefn__Radio
74
+ }
75
+ module Label = {
76
+ include Basefn__Label
77
+ }
64
78
 
65
79
  // Tier 1 Foundation Components
66
- module Badge = Basefn__Badge
67
- module Spinner = Basefn__Spinner
68
- module Separator = Basefn__Separator
69
- module Kbd = Basefn__Kbd
70
- module Typography = Basefn__Typography
80
+ module Badge = {
81
+ include Basefn__Badge
82
+ }
83
+ module Spinner = {
84
+ include Basefn__Spinner
85
+ }
86
+ module Separator = {
87
+ include Basefn__Separator
88
+ }
89
+ module Kbd = {
90
+ include Basefn__Kbd
91
+ }
92
+ module Typography = {
93
+ include Basefn__Typography
94
+ }
71
95
 
72
96
  // Tier 2
73
- module Card = Basefn__Card
74
- module Avatar = Basefn__Avatar
75
- module Grid = Basefn__Grid
76
- module Alert = Basefn__Alert
77
- module Progress = Basefn__Progress
78
- module Tabs = Basefn__Tabs
79
- module Accordion = Basefn__Accordion
80
- module Breadcrumb = Basefn__Breadcrumb
97
+ module Card = {
98
+ include Basefn__Card
99
+ }
100
+ module Avatar = {
101
+ include Basefn__Avatar
102
+ }
103
+ module Grid = {
104
+ include Basefn__Grid
105
+ }
106
+ module Alert = {
107
+ include Basefn__Alert
108
+ }
109
+ module Progress = {
110
+ include Basefn__Progress
111
+ }
112
+ module Tabs = {
113
+ include Basefn__Tabs
114
+ }
115
+ module Accordion = {
116
+ include Basefn__Accordion
117
+ }
118
+ module Breadcrumb = {
119
+ include Basefn__Breadcrumb
120
+ }
81
121
 
82
122
  // Tier 3
83
- module Modal = Basefn__Modal
84
- module Tooltip = Basefn__Tooltip
85
- module Switch = Basefn__Switch
86
- module Slider = Basefn__Slider
87
- module Dropdown = Basefn__Dropdown
88
- module Toast = Basefn__Toast
123
+ module Modal = {
124
+ include Basefn__Modal
125
+ }
126
+ module Tooltip = {
127
+ include Basefn__Tooltip
128
+ }
129
+ module Switch = {
130
+ include Basefn__Switch
131
+ }
132
+ module Slider = {
133
+ include Basefn__Slider
134
+ }
135
+ module Dropdown = {
136
+ include Basefn__Dropdown
137
+ }
138
+ module Toast = {
139
+ include Basefn__Toast
140
+ }
89
141
 
90
142
  // Tier 4 - Navigation & Layout
91
- module Stepper = Basefn__Stepper
92
- module Drawer = Basefn__Drawer
93
- module Timeline = Basefn__Timeline
143
+ module Stepper = {
144
+ include Basefn__Stepper
145
+ }
146
+ module Drawer = {
147
+ include Basefn__Drawer
148
+ }
149
+ module Timeline = {
150
+ include Basefn__Timeline
151
+ }
94
152
 
95
153
  // Application Layout
96
- module Sidebar = Basefn__Sidebar
97
- module Topbar = Basefn__Topbar
98
- module AppLayout = Basefn__AppLayout
154
+ module Sidebar = {
155
+ include Basefn__Sidebar
156
+ }
157
+ module Topbar = {
158
+ include Basefn__Topbar
159
+ }
160
+ module AppLayout = {
161
+ include Basefn__AppLayout
162
+ }
99
163
 
100
164
  // Theme
101
- module Theme = Basefn__Theme
102
- module ThemeToggle = Basefn__ThemeToggle
165
+ module Theme = {
166
+ include Basefn__Theme
167
+ }
168
+ module ThemeToggle = {
169
+ include Basefn__ThemeToggle
170
+ }
103
171
 
104
172
  // Icons
105
- module Icon = Basefn__Icon
173
+ module Icon = {
174
+ include Basefn__Icon
175
+ }
@@ -1,78 +1,113 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Basefn__Kbd from "./components/Basefn__Kbd.res.mjs";
4
+ import * as Basefn__Card from "./components/Basefn__Card.res.mjs";
5
+ import * as Basefn__Grid from "./components/Basefn__Grid.res.mjs";
6
+ import * as Basefn__Icon from "./components/Basefn__Icon.res.mjs";
7
+ import * as Basefn__Tabs from "./components/Basefn__Tabs.res.mjs";
8
+ import * as Basefn__Alert from "./components/Basefn__Alert.res.mjs";
9
+ import * as Basefn__Badge from "./components/Basefn__Badge.res.mjs";
10
+ import * as Basefn__Input from "./components/Basefn__Input.res.mjs";
11
+ import * as Basefn__Label from "./components/Basefn__Label.res.mjs";
12
+ import * as Basefn__Modal from "./components/Basefn__Modal.res.mjs";
13
+ import * as Basefn__Radio from "./components/Basefn__Radio.res.mjs";
14
+ import * as Basefn__Theme from "./styles/Basefn__Theme.res.mjs";
15
+ import * as Basefn__Toast from "./components/Basefn__Toast.res.mjs";
16
+ import * as Basefn__Avatar from "./components/Basefn__Avatar.res.mjs";
17
+ import * as Basefn__Button from "./components/Basefn__Button.res.mjs";
18
+ import * as Basefn__Drawer from "./components/Basefn__Drawer.res.mjs";
19
+ import * as Basefn__Select from "./components/Basefn__Select.res.mjs";
20
+ import * as Basefn__Slider from "./components/Basefn__Slider.res.mjs";
21
+ import * as Basefn__Switch from "./components/Basefn__Switch.res.mjs";
22
+ import * as Basefn__Topbar from "./components/Basefn__Topbar.res.mjs";
23
+ import * as Basefn__Sidebar from "./components/Basefn__Sidebar.res.mjs";
24
+ import * as Basefn__Spinner from "./components/Basefn__Spinner.res.mjs";
25
+ import * as Basefn__Stepper from "./components/Basefn__Stepper.res.mjs";
26
+ import * as Basefn__Tooltip from "./components/Basefn__Tooltip.res.mjs";
27
+ import * as Basefn__Checkbox from "./components/Basefn__Checkbox.res.mjs";
28
+ import * as Basefn__Dropdown from "./components/Basefn__Dropdown.res.mjs";
29
+ import * as Basefn__Progress from "./components/Basefn__Progress.res.mjs";
30
+ import * as Basefn__Textarea from "./components/Basefn__Textarea.res.mjs";
31
+ import * as Basefn__Timeline from "./components/Basefn__Timeline.res.mjs";
32
+ import * as Basefn__Accordion from "./components/Basefn__Accordion.res.mjs";
33
+ import * as Basefn__AppLayout from "./components/Basefn__AppLayout.res.mjs";
34
+ import * as Basefn__Separator from "./components/Basefn__Separator.res.mjs";
35
+ import * as Basefn__Breadcrumb from "./components/Basefn__Breadcrumb.res.mjs";
36
+ import * as Basefn__Typography from "./components/Basefn__Typography.res.mjs";
37
+ import * as Basefn__ThemeToggle from "./components/Basefn__ThemeToggle.res.mjs";
3
38
 
4
39
  import './basefn.css'
5
40
  ;
6
41
 
7
- let Button;
42
+ let Button = Basefn__Button;
8
43
 
9
- let Input;
44
+ let Input = Basefn__Input;
10
45
 
11
- let Textarea;
46
+ let Textarea = Basefn__Textarea;
12
47
 
13
- let Select;
48
+ let Select = Basefn__Select;
14
49
 
15
- let Checkbox;
50
+ let Checkbox = Basefn__Checkbox;
16
51
 
17
- let Radio;
52
+ let Radio = Basefn__Radio;
18
53
 
19
- let Label;
54
+ let Label = Basefn__Label;
20
55
 
21
- let Badge;
56
+ let Badge = Basefn__Badge;
22
57
 
23
- let Spinner;
58
+ let Spinner = Basefn__Spinner;
24
59
 
25
- let Separator;
60
+ let Separator = Basefn__Separator;
26
61
 
27
- let Kbd;
62
+ let Kbd = Basefn__Kbd;
28
63
 
29
- let Typography;
64
+ let Typography = Basefn__Typography;
30
65
 
31
- let Card;
66
+ let Card = Basefn__Card;
32
67
 
33
- let Avatar;
68
+ let Avatar = Basefn__Avatar;
34
69
 
35
- let Grid;
70
+ let Grid = Basefn__Grid;
36
71
 
37
- let Alert;
72
+ let Alert = Basefn__Alert;
38
73
 
39
- let Progress;
74
+ let Progress = Basefn__Progress;
40
75
 
41
- let Tabs;
76
+ let Tabs = Basefn__Tabs;
42
77
 
43
- let Accordion;
78
+ let Accordion = Basefn__Accordion;
44
79
 
45
- let Breadcrumb;
80
+ let Breadcrumb = Basefn__Breadcrumb;
46
81
 
47
- let Modal;
82
+ let Modal = Basefn__Modal;
48
83
 
49
- let Tooltip;
84
+ let Tooltip = Basefn__Tooltip;
50
85
 
51
- let Switch;
86
+ let Switch = Basefn__Switch;
52
87
 
53
- let Slider;
88
+ let Slider = Basefn__Slider;
54
89
 
55
- let Dropdown;
90
+ let Dropdown = Basefn__Dropdown;
56
91
 
57
- let Toast;
92
+ let Toast = Basefn__Toast;
58
93
 
59
- let Stepper;
94
+ let Stepper = Basefn__Stepper;
60
95
 
61
- let Drawer;
96
+ let Drawer = Basefn__Drawer;
62
97
 
63
- let Timeline;
98
+ let Timeline = Basefn__Timeline;
64
99
 
65
- let Sidebar;
100
+ let Sidebar = Basefn__Sidebar;
66
101
 
67
- let Topbar;
102
+ let Topbar = Basefn__Topbar;
68
103
 
69
- let AppLayout;
104
+ let AppLayout = Basefn__AppLayout;
70
105
 
71
- let Theme;
106
+ let Theme = Basefn__Theme;
72
107
 
73
- let ThemeToggle;
108
+ let ThemeToggle = Basefn__ThemeToggle;
74
109
 
75
- let Icon;
110
+ let Icon = Basefn__Icon;
76
111
 
77
112
  export {
78
113
  Button,