@startupjs-ui/button 0.3.4 → 0.3.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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.3.5](https://github.com/startupjs/startupjs-ui/compare/v0.3.4...v0.3.5) (2026-06-19)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/button
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.3.4](https://github.com/startupjs/startupjs-ui/compare/v0.3.3...v0.3.4) (2026-06-18)
7
15
 
8
16
  **Note:** Version bump only for package @startupjs-ui/button
package/README.mdx CHANGED
@@ -173,6 +173,14 @@ You can fine-tune the button's appearance using style props:
173
173
  - **hoverStyle** -- custom styles applied on hover
174
174
  - **activeStyle** -- custom styles applied when pressed
175
175
 
176
+ ## Theme configuration
177
+
178
+ Button also exposes CSSX theme configuration for app-wide visual tuning:
179
+
180
+ - **$UI.Button.outlinedBorderColor** -- override the border color used by the `outlined` variant. By default the border uses the button color with opacity.
181
+ - **$UI.Button.useBgColorForFlat** -- when enabled, the `flat` variant first tries `bg-${color}` before falling back to the regular color token.
182
+ - **$UI.Button.webNativeButton** -- controls whether the web root renders with native button semantics. It is enabled by default.
183
+
176
184
  ## Call to Action
177
185
 
178
186
  Try to keep the variety of button combinations you use in your app to a minimum.
package/index.cssx.styl CHANGED
@@ -26,6 +26,9 @@ $this = merge({
26
26
  xxl: $UI.lineHeights.h4
27
27
  },
28
28
  outlinedBorderWidth: 1px,
29
+ outlinedBorderColor: null,
30
+ useBgColorForFlat: 0,
31
+ webNativeButton: 1,
29
32
  iconMargins: {
30
33
  xs: .5u,
31
34
  s: .5u,
package/index.tsx CHANGED
@@ -10,10 +10,19 @@ import STYLES from './index.cssx.styl'
10
10
 
11
11
  const {
12
12
  config: {
13
- heights, outlinedBorderWidth, iconMargins
13
+ heights,
14
+ outlinedBorderWidth,
15
+ outlinedBorderColor,
16
+ useBgColorForFlat,
17
+ webNativeButton,
18
+ iconMargins
14
19
  }
15
20
  } = STYLES
16
21
 
22
+ function isConfigEnabled (value: unknown): boolean {
23
+ return value !== false && value !== 0 && value !== '0'
24
+ }
25
+
17
26
  export default observer(themed('Button', Button))
18
27
 
19
28
  export const _PropsJsonSchema = {/* ButtonProps */} // used in docs generation
@@ -98,6 +107,8 @@ function Button ({
98
107
  if (!getColor(color)) console.error('Button component: Color for color property is incorrect. Use colors from Colors')
99
108
 
100
109
  const isFlat = variant === 'flat'
110
+ const shouldUseBgColorForFlat = isConfigEnabled(useBgColorForFlat)
111
+ const shouldUseWebNativeButton = isConfigEnabled(webNativeButton)
101
112
  const _color = getColor(color) as string | undefined
102
113
  const textColor = isFlat ? getFlatTextColorName() : color
103
114
  const _textColor = getColor(textColor) as string | undefined
@@ -121,11 +132,11 @@ function Button ({
121
132
 
122
133
  switch (variant) {
123
134
  case 'flat':
124
- rootStyle.backgroundColor = _color
135
+ rootStyle.backgroundColor = (shouldUseBgColorForFlat ? getColor(`bg-${color}`) : null) || _color
125
136
  break
126
137
  case 'outlined':
127
138
  rootStyle.borderWidth = outlinedBorderWidth
128
- rootStyle.borderColor = colorToRGBA(_colorString, 0.5)
139
+ rootStyle.borderColor = outlinedBorderColor || colorToRGBA(_colorString, 0.5)
129
140
  extraHoverStyle = { backgroundColor: colorToRGBA(_colorString, 0.05) }
130
141
  extraActiveStyle = { backgroundColor: colorToRGBA(_colorString, 0.25) }
131
142
  break
@@ -163,7 +174,7 @@ function Button ({
163
174
  return pug`
164
175
  Div.root(
165
176
  row
166
- _webNativeButton
177
+ _webNativeButton=shouldUseWebNativeButton
167
178
  shape=shape
168
179
  style=[rootStyle, style]
169
180
  styleName=[
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/button",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@startupjs-ui/core": "^0.3.0",
12
12
  "@startupjs-ui/div": "^0.3.4",
13
- "@startupjs-ui/icon": "^0.3.0",
13
+ "@startupjs-ui/icon": "^0.3.5",
14
14
  "@startupjs-ui/loader": "^0.3.0",
15
15
  "@startupjs-ui/span": "^0.3.4"
16
16
  },
@@ -19,5 +19,5 @@
19
19
  "react-native": "*",
20
20
  "startupjs": "*"
21
21
  },
22
- "gitHead": "ad84ad14d189280a9ce4618b3223093fd09ba60e"
22
+ "gitHead": "8fc799070c16fb24de4ad0dbd6054108fe342d7c"
23
23
  }