@webority/ui-react 0.55.0 → 0.56.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{shortcutAria as n,shortcutChip as r}from"../lib/shortcutChip.js";import i from"./withTooltip.js";import a from"./AppIcon.js";import{Button as o}from"react-bootstrap";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l={primary:`primary`,secondary:`secondary`,outline:`outline-primary`,ghost:`ghost`,danger:`danger`,success:`success`,"secondary-danger":`secondary-danger`,"outline-danger":`outline-danger`,light:`light`,warning:`warning`,subtle:`subtle`,"outline-light":`outline-light`},u={sm:14,md:16,lg:20};function d(e,t,n){if(!e)return null;let r=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?s(a,{name:e,size:u[n]??u.md,className:r}):s(`span`,{className:`d-inline-flex ${r}`,children:e})}function f({children:a,variant:f=`primary`,size:p=`md`,type:m=`button`,loading:h=!1,disabled:g=!1,block:_=!1,leftIcon:v=null,rightIcon:y=null,href:b,static:x=!1,tooltip:S,tooltipPlacement:C,shortcut:w,className:T=``,...E}){if(t(`AppButton`,E),e(`AppButton`,`variant`,f,Object.keys(l)),e(`AppButton`,`size`,p,Object.keys(u)),x)return i(c(`span`,{className:[`btn`,`btn-${l[f]??`primary`}`,p===`sm`?`btn-sm`:p===`lg`?`btn-lg`:``,_?`w-100`:``,`btn-static`,T].filter(Boolean).join(` `),...E,children:[d(v,`left`,p),a,d(y,`right`,p)]}),S,C);let D=[_?`w-100`:``,h?`is-loading`:``,T].filter(Boolean).join(` `),O=(E.as===void 0||E.as===`button`)&&b===void 0&&E.to===void 0,k=O?{}:{role:void 0,tabIndex:g||h?-1:void 0},A=S!=null&&S!==``;return i(c(o,{type:O?m:void 0,href:b,variant:l[f]??`primary`,size:p===`md`?void 0:p,disabled:g||h,"aria-busy":h||void 0,"aria-keyshortcuts":n(w),className:D||void 0,...k,...E,children:[h&&s(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!h&&d(v,`left`,p),a,!h&&d(y,`right`,p),!A&&r(w)]}),S,C,w)}export{f as default};
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{shortcutAria as n,shortcutChip as r}from"../lib/shortcutChip.js";import i from"./withTooltip.js";import a from"./AppIcon.js";import{Button as o}from"react-bootstrap";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l={primary:`primary`,secondary:`secondary`,outline:`outline-primary`,ghost:`ghost`,danger:`danger`,success:`success`,"secondary-danger":`secondary-danger`,"outline-danger":`outline-danger`,light:`light`,warning:`warning`,subtle:`subtle`,"outline-light":`outline-light`,"outline-secondary":`outline-secondary`},u={sm:14,md:16,lg:20};function d(e,t,n){if(!e)return null;let r=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?s(a,{name:e,size:u[n]??u.md,className:r}):s(`span`,{className:`d-inline-flex ${r}`,children:e})}function f({children:a,variant:f=`primary`,size:p=`md`,type:m=`button`,loading:h=!1,disabled:g=!1,block:_=!1,leftIcon:v=null,rightIcon:y=null,href:b,static:x=!1,tooltip:S,tooltipPlacement:C,shortcut:w,className:T=``,...E}){if(t(`AppButton`,E),e(`AppButton`,`variant`,f,Object.keys(l)),e(`AppButton`,`size`,p,Object.keys(u)),x)return i(c(`span`,{className:[`btn`,`btn-${l[f]??`primary`}`,p===`sm`?`btn-sm`:p===`lg`?`btn-lg`:``,_?`w-100`:``,`btn-static`,T].filter(Boolean).join(` `),...E,children:[d(v,`left`,p),a,d(y,`right`,p)]}),S,C);let D=[_?`w-100`:``,h?`is-loading`:``,T].filter(Boolean).join(` `),O=(E.as===void 0||E.as===`button`)&&b===void 0&&E.to===void 0,k=O?{}:{role:void 0,tabIndex:g||h?-1:void 0},A=S!=null&&S!==``;return i(c(o,{type:O?m:void 0,href:b,variant:l[f]??`primary`,size:p===`md`?void 0:p,disabled:g||h,"aria-busy":h||void 0,"aria-keyshortcuts":n(w),className:D||void 0,...k,...E,children:[h&&s(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!h&&d(v,`left`,p),a,!h&&d(y,`right`,p),!A&&r(w)]}),S,C,w)}export{f as default};
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @param {() => void} [props.onClick] Called when the main button is pressed.
|
|
14
14
|
* @param {string} [props.href] Make the main button a link.
|
|
15
15
|
* @param {'button'|'submit'|'reset'} [props.type='button'] The main button's type.
|
|
16
|
-
* @param {'primary'|'secondary'|'outline'|'ghost'|'danger'|'success'|'secondary-danger'|'outline-danger'|'light'|'warning'|'subtle'|'outline-light'} [props.variant='primary'] Both halves share it.
|
|
16
|
+
* @param {'primary'|'secondary'|'outline'|'ghost'|'danger'|'success'|'secondary-danger'|'outline-danger'|'light'|'warning'|'subtle'|'outline-light'|'outline-secondary'} [props.variant='primary'] Both halves share it.
|
|
17
17
|
* @param {'sm'|'md'|'lg'} [props.size='md']
|
|
18
18
|
* @param {boolean} [props.disabled=false] Disables both halves.
|
|
19
19
|
* @param {boolean} [props.loading=false] Shows the spinner on the main button and disables both halves.
|
|
@@ -40,7 +40,7 @@ export default function AppSplitButton({ label, items, onClick, href, type, vari
|
|
|
40
40
|
onClick?: () => void;
|
|
41
41
|
href?: string;
|
|
42
42
|
type?: 'button' | 'submit' | 'reset';
|
|
43
|
-
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'success' | 'secondary-danger' | 'outline-danger' | 'light' | 'warning' | 'subtle' | 'outline-light';
|
|
43
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'success' | 'secondary-danger' | 'outline-danger' | 'light' | 'warning' | 'subtle' | 'outline-light' | 'outline-secondary';
|
|
44
44
|
size?: 'sm' | 'md' | 'lg';
|
|
45
45
|
disabled?: boolean;
|
|
46
46
|
loading?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@webority/
|
|
31
|
-
"@webority/
|
|
30
|
+
"@webority/ui-elements": "0.56.0",
|
|
31
|
+
"@webority/theme": "0.56.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@webority/analytics": "^0.21.0",
|