bb_component_supertag 1.0.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 +25 -0
- package/dist/bb_component_supertag-1.0.1.tar.gz +0 -0
- package/dist/package.json +7 -0
- package/dist/plugin.min.js +2 -0
- package/dist/schema.json +72 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SuperTag
|
|
2
|
+
|
|
3
|
+
Super Tag
|
|
4
|
+
|
|
5
|
+
A tag and label component for displaying metadata, status indicators, or categorization badges with customizable colors and icons.
|
|
6
|
+
|
|
7
|
+
## Metadata
|
|
8
|
+
|
|
9
|
+
| | |
|
|
10
|
+
|---|---|
|
|
11
|
+
| **Type** | Budibase Component |
|
|
12
|
+
| **Category** | basic |
|
|
13
|
+
| **Topics** | `budibase`, `component`, `basic` |
|
|
14
|
+
|
|
15
|
+
## Development
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun install
|
|
19
|
+
bun link @poirazis/superlib
|
|
20
|
+
bun run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Schema
|
|
24
|
+
|
|
25
|
+
See `schema.json` for the component definition.
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(){try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".super-tag.svelte-1l9u2si{background-color:var(--super-tag-color);color:var(--spectrum-global-color-gray-900);border-radius:.25rem;flex:none;justify-content:center;align-items:center;gap:.5rem;width:fit-content;min-width:3rem;display:flex}.size-small.svelte-1l9u2si{height:1.25rem;padding:0 .5rem;font-size:10px}.size-medium.svelte-1l9u2si{height:1.65rem;padding:0 .75rem;font-size:12px}.size-large.svelte-1l9u2si{height:2rem;padding:0 1rem;font-size:14px}.tag-text.svelte-1l9u2si{color:var(--super-tag-text-color,var(--spectrum-global-color-gray-900));text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.size-small.svelte-1l9u2si .tag-text:where(.svelte-1l9u2si){font-size:11px}.size-medium.svelte-1l9u2si .tag-text:where(.svelte-1l9u2si){font-size:13px}.size-large.svelte-1l9u2si .tag-text:where(.svelte-1l9u2si){font-size:15px}.close.svelte-1l9u2si{color:var(--spectrum-global-color-gray-800)}.close.svelte-1l9u2si:hover{cursor:pointer;color:var(--spectrum-global-color-gray-900)}.size-small.svelte-1l9u2si .close:where(.svelte-1l9u2si){font-size:9px}.size-medium.svelte-1l9u2si .close:where(.svelte-1l9u2si){font-size:11px}.size-large.svelte-1l9u2si .close:where(.svelte-1l9u2si){font-size:13px}.plugin-error.svelte-1q1ah0h{border:1px solid var(--spectrum-global-color-red-400);background:var(--spectrum-global-color-red-100);color:var(--spectrum-global-color-red-800);box-sizing:border-box;border-radius:4px;flex-direction:column;gap:.25rem;width:100%;padding:.5rem .75rem;font-size:13px;display:flex}.plugin-error-title.svelte-1q1ah0h{font-weight:600}.plugin-error-detail.svelte-1q1ah0h{color:var(--spectrum-global-color-red-700);word-break:break-word;font-size:12px}\n/*$vite$:1*/")),document.head.appendChild(e)}}catch(l){console.error("vite-plugin-css-injected-by-js",l)}}();
|
|
2
|
+
var plugin=function(e,t,l){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var o,a,r,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;r=null!=(o=t)?n(c(o)):{};var u=(t=((e,t,l,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,r=p(t),n=0,c=r.length;n<c;n++)a=r[n],d.call(e,a)||a===l||s(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(o=i(t,a))||o.enumerable});return e})(!a&&o&&o.__esModule?r:s(r,"default",{value:o,enumerable:!0}),o)).from_html("<i></i>"),m=t.from_html('<i class="ri-close-line close svelte-1l9u2si"></i>'),f=t.from_html('<div><!> <span class="tag-text svelte-1l9u2si"> </span> <!></div>');var v=t.from_html('<span class="plugin-error-detail svelte-1q1ah0h"> </span>'),g=t.from_html('<div class="plugin-error svelte-1q1ah0h" role="alert"><span class="plugin-error-title svelte-1q1ah0h">Tag failed to render</span> <!></div>');function b(e,o){let a=t.rest_props(o,["$$slots","$$events","$$legacy"]);var r=t.comment(),n=t.first_child(r);{const e=(e,l=t.noop)=>{var o=g(),a=t.sibling(t.child(o),2),r=e=>{var o=v(),a=t.child(o,!0);t.reset(o),t.template_effect(()=>t.set_text(a,l().message)),t.append(e,o)};t.if(a,e=>{l()instanceof Error&&l().message&&e(r)}),t.reset(o),t.append(e,o)};t.boundary(n,{onerror:e=>{console.error("[SuperTag]",e)},failed:e},e=>{!function(e,o){t.push(o,!0);const a=()=>t.store_get(i,"$component",r),[r,n]=t.setup_stores(),{styleable:s}=(0,l.getContext)("sdk"),i=(0,l.getContext)("component");let p=t.prop(o,"hideable",3,!1),c=t.prop(o,"size",3,"medium"),d=t.state(!1),v=t.derived(()=>({...a().styles,normal:{...a().styles?.normal,"--super-tag-color":o.color,"--super-tag-text-color":o.textColor,"--super-tag-width":o.icon?"6rem":"5rem"}}));function g(){t.set(d,!0),o.onHide?.()}var b=t.comment(),y=t.first_child(b),h=e=>{var l=f(),a=t.child(l),r=e=>{var l=u();t.template_effect(()=>t.set_class(l,1,t.clsx(o.icon),"svelte-1l9u2si")),t.append(e,l)};t.if(a,e=>{o.icon&&e(r)});var n=t.sibling(a,2),i=t.child(n,!0);t.reset(n);var d=t.sibling(n,2),b=e=>{var l=m();t.event("click",l,g),t.append(e,l)};t.if(d,e=>{p()&&e(b)}),t.reset(l),t.action(l,(e,t)=>s?.(e,t),()=>t.get(v)),t.template_effect(()=>{t.set_class(l,1,`super-tag size-${c()??""}`,"svelte-1l9u2si"),t.set_text(i,o.text??"")}),t.append(e,l)};t.if(y,e=>{t.get(d)||e(h)}),t.append(e,b),t.pop(),n()}(e,t.spread_props(()=>a))})}t.append(e,r)}var y={type:"component",metadata:{svelteMajor:5},schema:{name:"bb_component_supertag",friendlyName:"Super Tag",description:"A Tag Component for Budibase",icon:"Bookmark",settings:[{type:"text",key:"text",label:"Text",defaultValue:"Tag"},{type:"icon",key:"icon",label:"Icon",defaultValue:"ri-bookmark-fill"},{type:"select",key:"size",label:"Size",options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"}],defaultValue:"medium"},{type:"color",key:"color",label:"Color",defaultValue:"var(--spectrum-global-color-static-blue-800)"},{type:"color",key:"textColor",label:"Text Color",defaultValue:"var(--spectrum-global-color-gray-800)"},{type:"boolean",key:"hideable",label:"Hideable",defaultValue:!1},{type:"event",key:"onHide",label:"On Hide",dependsOn:"hideable"}]}},h="1.0.1";if(window){const e={Component:b,schema:y,version:h};window["##BUDIBASE_CUSTOM_COMPONENTS##"]||(window["##BUDIBASE_CUSTOM_COMPONENTS##"]=[]),window["##BUDIBASE_CUSTOM_COMPONENTS##"].push(e),window.registerCustomComponent&&window.registerCustomComponent(e)}var _=b,O=h;return e.Component=_,e.schema=y,e.version=O,e}({},svelteInternal,svelte);
|
package/dist/schema.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "component",
|
|
3
|
+
"metadata": {
|
|
4
|
+
"svelteMajor": 5
|
|
5
|
+
},
|
|
6
|
+
"schema": {
|
|
7
|
+
"name": "bb_component_supertag",
|
|
8
|
+
"friendlyName": "Super Tag",
|
|
9
|
+
"description": "A Tag Component for Budibase",
|
|
10
|
+
"icon": "Bookmark",
|
|
11
|
+
"settings": [
|
|
12
|
+
{
|
|
13
|
+
"type": "text",
|
|
14
|
+
"key": "text",
|
|
15
|
+
"label": "Text",
|
|
16
|
+
"defaultValue": "Tag"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "icon",
|
|
20
|
+
"key": "icon",
|
|
21
|
+
"label": "Icon",
|
|
22
|
+
"defaultValue": "ri-bookmark-fill"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "select",
|
|
26
|
+
"key": "size",
|
|
27
|
+
"label": "Size",
|
|
28
|
+
"options": [
|
|
29
|
+
{
|
|
30
|
+
"label": "Small",
|
|
31
|
+
"value": "small"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"label": "Medium",
|
|
35
|
+
"value": "medium"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "Large",
|
|
39
|
+
"value": "large"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"defaultValue": "medium"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "color",
|
|
46
|
+
"key": "color",
|
|
47
|
+
"label": "Color",
|
|
48
|
+
"defaultValue": "var(--spectrum-global-color-static-blue-800)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "color",
|
|
52
|
+
"key": "textColor",
|
|
53
|
+
"label": "Text Color",
|
|
54
|
+
"defaultValue": "var(--spectrum-global-color-gray-800)"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"key": "hideable",
|
|
59
|
+
"label": "Hideable",
|
|
60
|
+
"defaultValue": false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"type": "event",
|
|
64
|
+
"key": "onHide",
|
|
65
|
+
"label": "On Hide",
|
|
66
|
+
"dependsOn": "hideable"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"hash": "f6e3423783e6ca4ae026a2240284df1bf50d85d6",
|
|
71
|
+
"version": "1.0.1"
|
|
72
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bb_component_supertag",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Super Tag",
|
|
5
|
+
"author": "Michael Poirazi - https://github.com/poirazis",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"svelte": "index.js",
|
|
8
|
+
"module": "dist/plugin.min.js",
|
|
9
|
+
"schema.metadata.svelteMajor": 5,
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "vite build",
|
|
17
|
+
"watch": "NODE_ENV=development vite build --watch --mode development"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": "./dist/plugin.min.js",
|
|
23
|
+
"require": "./dist/plugin.min.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@budibase/backend-core": "^3.39.22",
|
|
28
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
29
|
+
"tar": "^7.5.16",
|
|
30
|
+
"terser": "^5.48.0",
|
|
31
|
+
"vite": "^8.1.0",
|
|
32
|
+
"vite-plugin-css-injected-by-js": "^5.0.1",
|
|
33
|
+
"vite-plugin-singlefile": "^2.3.3",
|
|
34
|
+
"svelte": "5.55.10"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"svelte": "5.55.10"
|
|
38
|
+
},
|
|
39
|
+
"overrides": {
|
|
40
|
+
"svelte": "5.55.10"
|
|
41
|
+
}
|
|
42
|
+
}
|