@startupjs-ui/div 0.1.12 → 0.1.16

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.mdx +21 -19
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.1.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/div
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.1.13](https://github.com/startupjs/startupjs-ui/compare/v0.1.12...v0.1.13) (2026-02-03)
15
+
16
+ **Note:** Version bump only for package @startupjs-ui/div
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.1.12](https://github.com/startupjs/startupjs-ui/compare/v0.1.11...v0.1.12) (2026-01-21)
7
23
 
8
24
 
package/README.mdx CHANGED
@@ -8,7 +8,7 @@ import Icon from '@startupjs-ui/icon'
8
8
 
9
9
  # Div
10
10
 
11
- Div is a basic building block for layouts. It is a wrapper around `View` with some extra features.
11
+ Div is a basic building block for layouts. It is a wrapper around `View` with extra features like press handling (`onPress`, `onLongPress`, `onPressIn`, `onPressOut`), layout helpers (`row`, `wrap`, `reverse`, `align`, `vAlign`, `gap`), shadows (`level`), corner shapes (`shape`), spacing (`pushed`, `bleed`), tooltips (`tooltip`, `tooltipStyle`), and built-in animation support. You can pass custom `style`, provide content as `children`, and use `ref` to access the underlying native view. Accessibility is supported via `accessible` and `accessibilityRole`, and `data-testid` can be used for testing.
12
12
 
13
13
  ```jsx
14
14
  import { Div } from 'startupjs-ui'
@@ -25,6 +25,8 @@ return (
25
25
 
26
26
  ## Clickable
27
27
 
28
+ When an `onPress` or `onLongPress` handler is provided, Div automatically becomes a pressable element with visual feedback. The `feedback` prop (defaults to `true`) controls whether hover and active states are shown. You can override the default feedback styles using `hoverStyle` and `activeStyle`. Set `disabled` to `true` to prevent all interactions.
29
+
28
30
  ```jsx example
29
31
  const divStyle = {
30
32
  width: 150,
@@ -47,14 +49,14 @@ return (
47
49
 
48
50
  ## Layout
49
51
 
50
- You can specify properties to manage layout:
52
+ You can use the following props to manage layout:
51
53
 
52
- - `row` - aligns children from left to right (default: `false`)
53
- - `reverse` - aligns the children in reverse order depending on the direction (default: `false`)
54
- - `wrap` - controls the wrapping of children into multiple rows (default: `false`)
55
- - `align` - controls horizontal alignment (possible values: `left`, `center`, `right`)
56
- - `vAlign` - controls vertical alignment (possible values: `top`, `center`, `bottom`)
57
- - `gap` - defines the size of the gap between items in [units](/docs/tutorial/TricksWithStyles#units) or the value `true` is equivalent to `2`
54
+ - `row` -- aligns children from left to right (default: `false`)
55
+ - `reverse` -- reverses the children order depending on the direction (default: `false`)
56
+ - `wrap` -- controls wrapping of children into multiple rows (default: `false`)
57
+ - `align` -- controls horizontal alignment (values: `'left'`, `'center'`, `'right'`)
58
+ - `vAlign` -- controls vertical alignment (values: `'top'`, `'center'`, `'bottom'`)
59
+ - `gap` -- defines the spacing between items in [units](/docs/tutorial/TricksWithStyles#units); passing `true` is equivalent to `2`
58
60
 
59
61
  ```jsx example
60
62
  return (
@@ -72,9 +74,7 @@ return (
72
74
 
73
75
  ## Full width (or height)
74
76
 
75
- To make `Div` take all remaining space in the parent container (according to its `flex-direction`), pass the `full` property.
76
-
77
- This property just sets `flex: 1` to it.
77
+ Pass the `full` prop to make Div take all remaining space in the parent container (according to its `flex-direction`). This sets `flex: 1` on the element.
78
78
 
79
79
  ```jsx example
80
80
  return (
@@ -89,9 +89,9 @@ return (
89
89
 
90
90
  ## Indentation between multiple Div
91
91
 
92
- When displaying multiple Div(s) in a line spacing between them can be adjusted using `pushed` prop to specify indent from the previous Div. Possible values of `pushed` prop can be found in the `Sandbox` section at the bottom of the page. The `true` value of prop is equivalent to `m` value.
92
+ When displaying multiple Divs in a row, use the `pushed` prop to add spacing from the previous sibling. Accepted values are `'s'`, `'m'`, and `'l'`; passing `true` is equivalent to `'m'`. See the Sandbox section below for all available values.
93
93
 
94
- Though instead of pushing each individual Div, in most cases it is better to use `gap` prop on the parent Div to set spacing between all children at once.
94
+ In most cases, it is better to use the `gap` prop on the parent Div to set uniform spacing between all children at once.
95
95
 
96
96
  ```jsx example
97
97
  const divStyle = {
@@ -121,11 +121,10 @@ return (
121
121
 
122
122
  ## Different clickable states
123
123
 
124
- There are two clickable variants of component, controlled by `variant` property.
125
-
126
- `opacity` variant - on press down, opacity of the component is decreased.
124
+ There are two clickable variants, controlled by the `variant` prop (defaults to `'opacity'`):
127
125
 
128
- `highlight` variant - on press down, the opacity of the component background is decreased.
126
+ - `'opacity'` -- on press, the entire component's opacity is decreased.
127
+ - `'highlight'` -- on press, the component's background opacity is decreased.
129
128
 
130
129
  ```jsx example
131
130
  const divStyle = {
@@ -149,8 +148,9 @@ return (
149
148
 
150
149
  ## Levels of emphasis
151
150
 
152
- Div `level` property determines different levels of emphasis by adding shadow to component. Possible values of `level` prop can be found in the `Sandbox` section at the bottom of the page.
153
- **IMPORTANT**: Shadow does not work without background color on mobile devices.
151
+ The `level` prop adds a shadow to the Div for visual emphasis. Accepted values range from `0` (no shadow) to `5`. See the Sandbox section below for all options.
152
+
153
+ **Important:** Shadows do not work without a background color on mobile devices.
154
154
 
155
155
  ```jsx example
156
156
  const divStyle = {
@@ -174,6 +174,8 @@ return (
174
174
 
175
175
  ## Tooltip
176
176
 
177
+ Pass the `tooltip` prop to display a simple text tooltip on hover. Use `tooltipStyle` to customize the tooltip's appearance.
178
+
177
179
  ```jsx example
178
180
  return pug`
179
181
  Div.root(tooltip='Tooltip content')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/div",
3
- "version": "0.1.12",
3
+ "version": "0.1.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,9 +12,9 @@
12
12
  "./useTooltip": "./useTooltip.tsx"
13
13
  },
14
14
  "dependencies": {
15
- "@startupjs-ui/abstract-popover": "^0.1.11",
15
+ "@startupjs-ui/abstract-popover": "^0.1.16",
16
16
  "@startupjs-ui/core": "^0.1.11",
17
- "@startupjs-ui/span": "^0.1.12"
17
+ "@startupjs-ui/span": "^0.1.16"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "react": "*",
@@ -22,5 +22,5 @@
22
22
  "react-native-reanimated": ">=4.0.0",
23
23
  "startupjs": "*"
24
24
  },
25
- "gitHead": "c0b4606437077bb6d170e2c0b16b674801c304fe"
25
+ "gitHead": "9943aa3566d5d80f5b404473906eb3c0611f9ee5"
26
26
  }