Skip to content

Instantly share code, notes, and snippets.

View dbanksdesign's full-sized avatar
🐈
hello

Danny Banks dbanksdesign

🐈
hello
View GitHub Profile
diff --git a/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js b/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js
index 7baea6d..402d497 100644
--- a/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js
+++ b/node_modules/@aws-amplify/graphql-api-construct/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js
@@ -92,8 +92,17 @@ class BedrockConverseAdapter {
},
},
});
- }
- else {
@dbanksdesign
dbanksdesign / StorageBrowser.tsx
Last active February 26, 2025 16:43
Storage Browser for S3 with a custom share action
import { shareAction } from "@/actions/shareAction";
import { ACCOUNT_ID, REGION } from "@/constants";
import { getCredentials } from "@/utils/credentialsProvider";
import {
createManagedAuthAdapter,
createStorageBrowser,
} from "@aws-amplify/ui-react-storage/browser";
export const { StorageBrowser, useView, useAction } = createStorageBrowser({
config: createManagedAuthAdapter({
@dbanksdesign
dbanksdesign / App.jsx
Created April 22, 2022 18:29
Amplify Studio collection item passing
import * as React from "react";
import { Routes, Route, Link, useNavigate, useLocation } from "react-router-dom";
import { Ampligram, AmpligramCollection } from './ui-components';
const Home = () => {
let navigate = useNavigate();
return (
<div>
<AmpligramCollection
overrideItems={({ item, index }) => {
// tokens/font.js
module.exports = {
font: {
heading: {
body: {
size: { value: 16 },
type: { value: 'Arial' },
weight: { value: 'bold' }
}
}
@dbanksdesign
dbanksdesign / build3.js
Created March 9, 2021 21:10
Custom Formats in Style Dictionary
// Way 3: calling StyleDictionary.extend().buildAllPlatforms()
// you would call this in your npm script like: "node build1.js"
// the filename doesn't really matter, I tend to use 'build.js' if this file is running and 'config.js' if it exports a config
const StyleDictionary = require('style-dictionary');
StyleDictionary.registerFormat({
name: 'myCustomFormat',
formatter: function({ dictionary }) {
// custom format code
@dbanksdesign
dbanksdesign / sd.config.js
Created November 18, 2020 23:31
Style Dictionary Custom attribute/cti
const StyleDictionary = require('style-dictionary');
const attributeCTI = StyleDictionary.transform['attribute/cti'].transformer;
const cssToCTIMap = {
'width': {category: 'size', type: 'dimension'},
'min-width': {category: 'size', type: 'dimension'},
'max-width': {category: 'size', type: 'dimension'},
'height': {category: 'size', type: 'dimension'},
'min-height': {category: 'size', type: 'dimension'},
'max-height': {category: 'size', type: 'dimension'},
{
"type": "APL",
"version": "1.3",
"import": [],
"theme": "dark",
"styles": {
"bigTest": {
"values": [
{
"fontSize": "40dp",
{
"type": "APL",
"version": "1.3",
"import": [],
"theme": "dark",
"styles": {
"bigTest": {
"values": [
{
"fontSize": "30dp",
const StyleDictionary = require('style-dictionary');
// Creating a function that takes a token value
// and returns an object of the transformed value for
// the platforms defined in the config
const sdValue = (value) => {
const styleDictionary = StyleDictionary.extend({
// You can directly set the 'properties' aka tokens
// of the dictionary by giving it an object
properties: {
@dbanksdesign
dbanksdesign / base.json
Last active June 11, 2020 16:46
sd-transitive-attribute-transform-example
{
"color": {
"base": {
"green": {
"100": {
"value": "#e8f5e9",
"attributes": {
"font": "base"
}
},